Implements daq::DaqController
for states responsible to be executed by OCM.
More...
#include <daqController.hpp>
Implements daq::DaqController
for states responsible to be executed by OCM.
The states executed by DPM are implemented by DpmDaqController.
Definition at line 390 of file daqController.hpp.
◆ daq::OcmDaqController::Aborted
struct daq::OcmDaqController::Aborted |
◆ daq::OcmDaqController::Aborting
struct daq::OcmDaqController::Aborting |
◆ daq::OcmDaqController::Acquiring
struct daq::OcmDaqController::Acquiring |
◆ daq::OcmDaqController::NotStarted
struct daq::OcmDaqController::NotStarted |
◆ daq::OcmDaqController::Starting
struct daq::OcmDaqController::Starting |
◆ daq::OcmDaqController::Stopped
struct daq::OcmDaqController::Stopped |
◆ daq::OcmDaqController::Stopping
struct daq::OcmDaqController::Stopping |
◆ StateVariant
◆ OcmDaqController()
◆ AbortAsync()
Aborts the data acquisition.
- Parameters
-
policy | Error policy determining if errors are tolerated or not. |
It is possible to issue this request more than once, to e.g. retry a failed abort attempt.
- Precondition
GetState() not in (State::Aborted, State::Stopped)
- Postcondition
GetState() == State::Aborting
if a data acquisition was ongoing otherwise GetState() == State::Aborted
.
Implements daq::DaqController.
Definition at line 409 of file daqController.cpp.
◆ AddInitialKeywords()
void daq::OcmDaqController::AddInitialKeywords |
( |
| ) |
|
|
protected |
◆ AwaitAsync()
boost::future< State > daq::OcmDaqController::AwaitAsync |
( |
std::vector< std::string > |
sources, |
|
|
std::chrono::milliseconds |
timeout |
|
) |
| |
|
overridevirtual |
Awaits that data acquisition stops or aborts.
It is possible to await only only a subset of data sources by specifying their ids in sources
.
- Parameters
-
sources | An optional vector of source-ids to await, if empty all primary sources are awaited on. |
- Returns
- future set with std::invalid_argument if source-id is not recognized.
-
future set with boost::broken_promise if DaqController is destroyed before operation completes.
Implements daq::DaqController.
Definition at line 493 of file daqController.cpp.
◆ Create()
Construct object.
- Parameters
-
io_context | Executor used for continuations and timer. |
context | General context used to control DAQ execution. |
status | Data acquisition status object, also contains identifier (may not be empty). Caller is responsible for making the id unique. |
prim | Primary data sources |
meta | Metadata sources |
- Precondition
status == true
.
-
event_log == true
.
- Exceptions
-
std::invalid_argument | if arguments are invalid. |
Definition at line 157 of file daqController.cpp.
◆ FindSource()
std::optional< std::variant< gsl::not_null< Source< PrimSource > * >, gsl::not_null< Source< MetaSource > * > > > daq::OcmDaqController::FindSource |
( |
std::string_view |
source_id | ) |
|
|
protected |
◆ GetLogger()
constexpr log4cplus::Logger const & daq::OcmDaqController::GetLogger |
( |
| ) |
const |
|
constexprnoexcept |
◆ GetState()
State daq::OcmDaqController::GetState |
( |
| ) |
const |
|
overridevirtual |
◆ InitiateAwaitPrimarySources()
void daq::OcmDaqController::InitiateAwaitPrimarySources |
( |
| ) |
|
|
protected |
Await completion of primary sources.
If there are no sources this method does nothing.
Definition at line 669 of file daqController.cpp.
◆ MakeAwaitParams()
◆ MakeParams()
Constructs the parameters used for asynchronous operations.
- Note
- OcmAsyncOpParams will bind references to member variables so caller must guarantee that DaqController outlives the async operation. This is normally done by holding a shared copy in the last .then continuation for the async operation, thus guaranteeing that all intermediate continuations will access a valid object.
Definition at line 268 of file daqController.cpp.
◆ MakeSources()
template<class SourceType >
std::vector< Source< SourceType > > daq::OcmDaqController::MakeSources |
( |
std::vector< SourceType > |
sources | ) |
|
|
protected |
◆ MakeState()
◆ ScheduleMergeAsync()
boost::future< State > daq::OcmDaqController::ScheduleMergeAsync |
( |
| ) |
|
|
overridevirtual |
Schedules DAQ for merging by sending request to DPM.
- Returns
- future containing exception:
- std::logic_error if DAQ has already been scheduled
- mal::TimeoutException if DPM is offline (timeout).
- unspecified DPM fails
Implements daq::DaqController.
Definition at line 473 of file daqController.cpp.
◆ SetErrorFlag()
void daq::OcmDaqController::SetErrorFlag |
( |
bool |
error | ) |
|
|
protectednoexcept |
◆ SetState()
◆ StartAsync()
boost::future< State > daq::OcmDaqController::StartAsync |
( |
| ) |
|
|
overridevirtual |
Starts the data acquisition.
- Returns
- A future that will be Set once data acquisition has started or or fails.
- Exceptions
-
std::exception-derived | exception if internal error occurs. |
- Returns
- Future that is ready once all sources are started or failed.
- Precondition
GetState() == State::Notstarted
- Postcondition
GetState() == State::Starting
on success GetState() == State::Error
on error
Implements daq::DaqController.
Definition at line 297 of file daqController.cpp.
◆ StopAsync()
◆ UpdateKeywords()
◆ m_abort_await_primary_sources
std::function<bool()> daq::OcmDaqController::m_abort_await_primary_sources |
|
protected |
If DaqController is awaiting the completion of primary data sources this function will hold the abort function.
@important Users must check if it is valid before invoking it.
Definition at line 501 of file daqController.hpp.
◆ m_async_ops
◆ m_logger
log4cplus::Logger daq::OcmDaqController::m_logger |
|
protected |
◆ m_meta_sources
◆ m_pending_replies
std::shared_ptr<PendingReplies> daq::OcmDaqController::m_pending_replies |
|
protected |
◆ m_prim_sources
◆ m_state
◆ m_timers
std::vector<std::unique_ptr<boost::asio::steady_timer> > daq::OcmDaqController::m_timers |
|
protected |
The documentation for this class was generated from the following files: