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

Async operation to await Data Acquisition state. More...

#include <awaitState.hpp>

Public Types

using ResultType = ::daq::Result< Status >
 

Public Member Functions

 AwaitStateAsync (boost::asio::io_context &io_ctx, std::shared_ptr< ObservableStatus > status, State state, std::chrono::milliseconds timeout, log4cplus::Logger const &logger)
 Constructs operation with the privided parameters. More...
 
boost::future< ResultTypeInitiate ()
 Initiates operation that await state. More...
 
void Abort () noexcept
 Aborts the operation and completes the operation with DaqOperationAborted. More...
 

Detailed Description

Async operation to await Data Acquisition state.

Satisfies concept requirements for op::InitiateAbortableOperation and op::InitiateOperation.

Definition at line 32 of file awaitState.hpp.

Member Typedef Documentation

◆ ResultType

Definition at line 34 of file awaitState.hpp.

Constructor & Destructor Documentation

◆ AwaitStateAsync()

daq::op::AwaitStateAsync::AwaitStateAsync ( boost::asio::io_context &  io_ctx,
std::shared_ptr< ObservableStatus status,
State  state,
std::chrono::milliseconds  timeout,
log4cplus::Logger const &  logger 
)
explicit

Constructs operation with the privided parameters.

Parameters
io_ctxASIO context.
statusDAQ status to monitor/observe changes on.
stateTarget state.
timeoutOperation timeout.

Definition at line 18 of file awaitState.cpp.

Member Function Documentation

◆ Abort()

void daq::op::AwaitStateAsync::Abort ( )
noexcept

Aborts the operation and completes the operation with DaqOperationAborted.

Definition at line 92 of file awaitState.cpp.

◆ Initiate()

boost::future< AwaitStateAsync::ResultType > daq::op::AwaitStateAsync::Initiate ( )

Initiates operation that await state.

Returns
future with value being set when condition is satisifed or times out. Exception DaqOperationAborted is set when operation is aborted. ResultType::error is true if operation times out with await condition unsatisfied.
Note
Caller is responsible for keeping object alive until result is set.

Definition at line 33 of file awaitState.cpp.


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