8 #ifndef DAQ_OCM_OCM_DAQ_SERVICE_HPP_
9 #define DAQ_OCM_OCM_DAQ_SERVICE_HPP_
15 #include <boost/asio/io_context.hpp>
20 #include <log4cplus/logger.h>
21 #include <mal/Mal.hpp>
23 namespace mal = ::elt::mal;
99 public std::enable_shared_from_this<OcmDaqService> {
114 std::string proc_name,
115 std::string output_path,
116 std::shared_ptr<daq::ObservableEventLog> event_log);
119 boost::future<std::shared_ptr<::daqif::DaqReply>>
121 const std::string& file_prefix,
122 const std::string& primary_sources,
123 const std::string& metadata_sources,
124 const std::string& properties)
override;
125 boost::future<std::shared_ptr<::daqif::DaqReply>>
126 StartDaqV2(
const std::string& specification)
override;
128 boost::future<std::shared_ptr<::daqif::DaqReply>>
StopDaq(
const std::string&
id)
override;
130 boost::future<std::shared_ptr<::daqif::DaqReply>>
ForceStopDaq(
const std::string&
id)
override;
132 boost::future<std::shared_ptr<::daqif::DaqReply>>
AbortDaq(
const std::string&
id)
override;
134 boost::future<std::shared_ptr<::daqif::DaqReply>>
ForceAbortDaq(
const std::string&
id)
override;
136 boost::future<std::shared_ptr<::daqif::DaqReply>>
137 UpdateKeywords(
const std::string&
id,
const std::string& keywords)
override;
139 boost::future<std::shared_ptr<::daqif::AwaitDaqReply>>
141 daqif::DaqState state,
142 daqif::DaqSubState substate,
143 double timeout)
override;
145 boost::future<std::shared_ptr<::daqif::DaqStatus>>
GetStatus(
const std::string&
id)
override;
147 boost::future<std::vector<std::shared_ptr<::daqif::DaqStatus>>>
GetActiveList()
override;
150 std::string MakeExceptionMessageWithStatus(std::string
const&
id,
151 std::exception_ptr
const& exception)
const;
159 boost::future<std::shared_ptr<::daqif::DaqReply>>
161 boost::future<std::shared_ptr<::daqif::DaqReply>>
StopDaq(
const std::string&
id,
bool forced);
162 boost::future<std::shared_ptr<::daqif::DaqReply>>
AbortDaq(
const std::string&
id,
bool forced);
169 boost::asio::io_context& m_io_ctx;
176 std::string m_proc_name;
181 std::string m_output_path;
183 std::shared_ptr<daq::ObservableEventLog> m_event_log;
184 boost::signals2::connection m_log_observer_connection;
190 log4cplus::Logger m_logger;
A simple daq::ObservableEventLog observer that logs observed events to provided logger.
Manager owns DaqController and FitsController (active data acquisitions) instances and multiplexes re...
Adapts boost::asio::io_context into a compatible boost::thread Executor type.
Contains declaration of daq::Context.
Contains declaration for EventLogObserverLogger.
Contains declaration for EventLog, ObservableEventLog and related events.
boost::future< std::vector< std::shared_ptr<::daqif::DaqStatus > > > GetActiveList() override
OcmDaqService(boost::asio::io_context &io_ctx, mal::Mal &mal, daq::Manager &mgr, std::string proc_name, std::string output_path, std::shared_ptr< daq::ObservableEventLog > event_log)
boost::future< std::shared_ptr<::daqif::DaqReply > > StopDaq(const std::string &id) override
boost::future< std::shared_ptr<::daqif::AwaitDaqReply > > AwaitDaqState(const std::string &id, daqif::DaqState state, daqif::DaqSubState substate, double timeout) override
boost::future< std::shared_ptr<::daqif::DaqReply > > AbortDaq(const std::string &id) override
boost::future< std::shared_ptr<::daqif::DaqReply > > StartDaqV2(const std::string &specification) override
boost::future< std::shared_ptr<::daqif::DaqReply > > UpdateKeywords(const std::string &id, const std::string &keywords) override
boost::future< std::shared_ptr<::daqif::DaqReply > > StartDaq(const std::string &id, const std::string &file_prefix, const std::string &primary_sources, const std::string &metadata_sources, const std::string &properties) override
boost::future< std::shared_ptr<::daqif::DaqReply > > ForceStopDaq(const std::string &id) override
boost::future< std::shared_ptr<::daqif::DaqStatus > > GetStatus(const std::string &id) override
static constexpr char const * LOGGER_NAME
boost::future< std::shared_ptr<::daqif::DaqReply > > ForceAbortDaq(const std::string &id) override
Implements the MAL interface daqif::OcmDaq (async version).
Declaration of daq::Manager
Structure with a close mapping from JSON representation in the StartDaqV2 MAL request.
daq::DaqContext ParseStartDaqContext(std::string const &properties)
Parse the JSON properties user provides with StartDaq.
ParsedSource ParseSourceUri(std::string_view s)
Parse user provided string in the format "<name>@<rr-uri>".
daq::DaqContext ParseStartDaqV2(std::string const &specification)
Parse JSON specification and returns corresponding DaqContext.
std::vector< ParsedSource > ParseSourceUris(std::string_view s)
Parse user provided string in the format "<name>@<rr-uri>[ <name>@...]".
std::ostream & operator<<(std::ostream &os, ParsedSource const &s)
ParsedSource & operator=(ParsedSource const &rhs)=default
bool operator==(ParsedSource const &rhs) const
ParsedSource(ParsedSource &&)=default
ParsedSource(ParsedSource const &)=default
ParsedSource & operator=(ParsedSource &&rhs)=default
Structure carrying context needed to start a Data Acquisition and construct a Data Product Specificat...