ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
Public Types | Public Member Functions | List of all members
daq::ObservableEventLog Class Reference

Stores data acquisition status and allows subscription to status changes. More...

#include <eventLog.hpp>

Public Types

using Signal = boost::signals2::signal< void(EventLog::EventType const &)>
 

Public Member Functions

 ObservableEventLog ()=default
 Construct a new object. More...
 
 ObservableEventLog (ObservableEventLog const &)=delete
 
ObservableEventLogoperator= (ObservableEventLog const &)=delete
 
Modifiers
void AddEvent (EventLog::EventType event)
 Records that a file has been produced for this data acquisition. More...
 
template<class T , class... Args>
void EmplaceEvent (Args &&... args)
 Like AddEvent but emplaces the specified event type. More...
 
template<class Observer >
boost::signals2::connection ConnectObserver (Observer o)
 Connect observer that is invoked when state is modified. More...
 
Accessors
 operator EventLog const & ()
 Allow implicit conversion to non-observable status. More...
 
EventLog const & GetEventLog () const noexcept
 Allow implicit conversion to non-observable status. More...
 
std::vector< EventLog::EventType > const & GetEventContainer () const noexcept
 Allow implicit conversion to non-observable status. More...
 

Detailed Description

Stores data acquisition status and allows subscription to status changes.

DaqController and other objects will update ObservableEvent as changes occur.

Definition at line 107 of file eventLog.hpp.

Member Typedef Documentation

◆ Signal

using daq::ObservableEventLog::Signal = boost::signals2::signal<void(EventLog::EventType const&)>

Definition at line 109 of file eventLog.hpp.

Constructor & Destructor Documentation

◆ ObservableEventLog() [1/2]

daq::ObservableEventLog::ObservableEventLog ( )
explicitdefault

Construct a new object.

Parameters
idData acquisition identifier.

◆ ObservableEventLog() [2/2]

daq::ObservableEventLog::ObservableEventLog ( ObservableEventLog const &  )
delete

Member Function Documentation

◆ AddEvent()

void daq::ObservableEventLog::AddEvent ( EventLog::EventType  event)

Records that a file has been produced for this data acquisition.

Parameters
filesFiles to add/record.
Postcondition
Connected observers have been signalled.

Definition at line 56 of file eventLog.cpp.

◆ ConnectObserver()

template<class Observer >
boost::signals2::connection daq::ObservableEventLog::ConnectObserver ( Observer  o)
inline

Connect observer that is invoked when state is modified.

Parameters
oObserver callable invoked on status changes (state or file changes) Observer must be invocable with signature void(ObservableEvent const&).
Returns
signal connection object that can be used to disconnect observer:
auto c = status.ConnectObserver([](ObservableEvent const& s){});
// later the connection object can be used to disconnect
c.disconnect();

Definition at line 154 of file eventLog.hpp.

◆ EmplaceEvent()

template<class T , class... Args>
void daq::ObservableEventLog::EmplaceEvent ( Args &&...  args)
inline

Like AddEvent but emplaces the specified event type.

Definition at line 134 of file eventLog.hpp.

◆ GetEventContainer()

std::vector<EventLog::EventType> const& daq::ObservableEventLog::GetEventContainer ( ) const
inlinenoexcept

Allow implicit conversion to non-observable status.

Definition at line 172 of file eventLog.hpp.

◆ GetEventLog()

EventLog const& daq::ObservableEventLog::GetEventLog ( ) const
inlinenoexcept

Allow implicit conversion to non-observable status.

Definition at line 168 of file eventLog.hpp.

◆ operator EventLog const &()

daq::ObservableEventLog::operator EventLog const & ( )
inline

Allow implicit conversion to non-observable status.

Definition at line 164 of file eventLog.hpp.

◆ operator=()

ObservableEventLog& daq::ObservableEventLog::operator= ( ObservableEventLog const &  )
delete

The documentation for this class was generated from the following files: