ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
daq::Source< T > Struct Template Reference

Simple class that holds the source and associated state. More...

#include <source.hpp>

Public Types

using StateSignal = boost::signals2::signal< void(State, bool)>
 

Public Member Functions

 Source (T &&s)
 
template<class Subscriber >
boost::signals2::connection ConnectStateListener (Subscriber subscriber)
 Connect subscriber that is invoked on state changes. More...
 
void SetState (State state, std::optional< bool > error_flag={})
 
void ClearErrorFlag ()
 
void SetErrorFlag ()
 
bool GetErrorFlag () const
 
State GetState () const
 
T & GetSource ()
 
T const & GetSource () const
 

Protected Attributes

m_source
 
State m_state = State::NotStarted
 
bool m_error_flag = false
 
StateSignal m_state_signal
 

Friends

std::ostream & operator<< (std::ostream &os, Source< T > const &s)
 

Detailed Description

template<class T>
struct daq::Source< T >

Simple class that holds the source and associated state.

Definition at line 29 of file source.hpp.

Member Typedef Documentation

◆ StateSignal

template<class T >
using daq::Source< T >::StateSignal = boost::signals2::signal<void(State, bool)>

Definition at line 30 of file source.hpp.

Constructor & Destructor Documentation

◆ Source()

template<class T >
daq::Source< T >::Source ( T &&  s)
inline

Definition at line 32 of file source.hpp.

Member Function Documentation

◆ ClearErrorFlag()

template<class T >
void daq::Source< T >::ClearErrorFlag ( )
inline

Definition at line 59 of file source.hpp.

◆ ConnectStateListener()

template<class T >
template<class Subscriber >
boost::signals2::connection daq::Source< T >::ConnectStateListener ( Subscriber  subscriber)
inline

Connect subscriber that is invoked on state changes.

Type requirements of subscriber: Signature void(State, bool)

Definition at line 47 of file source.hpp.

◆ GetErrorFlag()

template<class T >
bool daq::Source< T >::GetErrorFlag ( ) const
inline

Definition at line 69 of file source.hpp.

◆ GetSource() [1/2]

template<class T >
T& daq::Source< T >::GetSource ( )
inline

Definition at line 76 of file source.hpp.

◆ GetSource() [2/2]

template<class T >
T const& daq::Source< T >::GetSource ( ) const
inline

Definition at line 80 of file source.hpp.

◆ GetState()

template<class T >
State daq::Source< T >::GetState ( ) const
inline

Definition at line 72 of file source.hpp.

◆ SetErrorFlag()

template<class T >
void daq::Source< T >::SetErrorFlag ( )
inline

Definition at line 64 of file source.hpp.

◆ SetState()

template<class T >
void daq::Source< T >::SetState ( State  state,
std::optional< bool >  error_flag = {} 
)
inline

Definition at line 51 of file source.hpp.

Friends And Related Function Documentation

◆ operator<<

template<class T >
std::ostream& operator<< ( std::ostream &  os,
Source< T > const &  s 
)
friend

Definition at line 34 of file source.hpp.

Member Data Documentation

◆ m_error_flag

template<class T >
bool daq::Source< T >::m_error_flag = false
protected

Definition at line 87 of file source.hpp.

◆ m_source

template<class T >
T daq::Source< T >::m_source
protected

Definition at line 85 of file source.hpp.

◆ m_state

template<class T >
State daq::Source< T >::m_state = State::NotStarted
protected

Definition at line 86 of file source.hpp.

◆ m_state_signal

template<class T >
StateSignal daq::Source< T >::m_state_signal
protected

Definition at line 88 of file source.hpp.


The documentation for this struct was generated from the following file: