|
ifw-daq
1.0.0
IFW Data Acquisition modules
|
Go to the documentation of this file.
8 #ifndef OCF_DAQ_SOURCE_HPP_
9 #define OCF_DAQ_SOURCE_HPP_
15 #include <boost/signals2/signal.hpp>
16 #include <Metadaqif.hpp>
46 template<
class Subscriber>
103 PrimSource(std::string name, std::shared_ptr<RrClient> client) : m_name(std::move(name)), m_rr_client(std::move(client)) {
104 if (m_name.empty()) {
105 throw std::invalid_argument(
"'name' is invalid");
108 throw std::invalid_argument(
"'client' is invalid");
125 os <<
"PrimSource: " << s.m_name;
131 std::shared_ptr<RrClient> m_rr_client;
146 MetaSource(std::string name, std::shared_ptr<RrClient> client) : m_name(std::move(name)), m_rr_client(std::move(client)) {
147 if (m_name.empty()) {
148 throw std::invalid_argument(
"'name' is invalid");
151 throw std::invalid_argument(
"'client' is invalid");
168 os <<
"MetaSource: " << s.m_name;
174 std::shared_ptr<RrClient> m_rr_client;
180 #endif // #ifndef OCF_DAQ_SOURCE_HPP_
State
Observable states of the data acquisition process.
MetaSource(MetaSource const &)=default
MetaSource & operator=(MetaSource const &)=default
StateSignal m_state_signal
std::string_view GetName() const
PrimSource(PrimSource const &)=default
Simple class that holds the source and associated state.
Config class header file.
MetaSource & operator=(MetaSource &&)=default
void SetState(State state, std::optional< bool > error_flag={})
PrimSource(PrimSource &&)=default
PrimSource(std::string name, std::shared_ptr< RrClient > client)
friend std::ostream & operator<<(std::ostream &os, Source< T > const &s)
PrimSource & operator=(PrimSource &)=default
boost::signals2::connection ConnectStateListener(Subscriber subscriber)
Connect subscriber that is invoked on state changes.
T const & GetSource() const
boost::signals2::signal< void(State, bool)> StateSignal
std::string_view GetName() const
PrimSource & operator=(PrimSource &&)=default
bool GetErrorFlag() const
Declares daq::State and related functions.
metadaqif::MetaDaqAsync RrClient
friend std::ostream & operator<<(std::ostream &os, PrimSource const &s)
std::variant< PrimSource, MetaSource > SourceVariant
recif::RecCmdsAsync RrClient
MetaSource(std::string name, std::shared_ptr< RrClient > client)
MetaSource(MetaSource &&)=default
friend std::ostream & operator<<(std::ostream &os, MetaSource const &s)
Keeps relevant state to be able to communicate with a primary data source.