ifw-daq  1.0.0
IFW Data Acquisition modules
Namespaces | Classes | Functions
daq::op Namespace Reference

Namespaces

 eventlog
 

Classes

struct  AbortAsync
 A composite async operation that aborts a DAQ. More...
 
struct  AsyncOpParams
 Parameters required for each async operation. More...
 
struct  AwaitOpParams
 Await specific parameters that is not provided with AsyncOpParams. More...
 
struct  AwaitPrimAsync
 A composite async operation that awaits primary data sources. More...
 
struct  AwaitStateAsync
 Async operation to await Data Acquisition state. More...
 
struct  OpStat
 Keeps record when operation started and finished. More...
 
struct  StartAsync
 A composite async operation that starts DAQ. More...
 
struct  StopAsync
 A composite async operation that starts DAQ. More...
 

Functions

template<class Op , class R = decltype(std::declval<Op&>().Initiate()), class... Params>
InitiateOperation (Params &&... params)
 Constructs and initiates Op and return the future result. More...
 
template<class Op , class R = decltype(std::declval<Op&>().Initiate()), class... Params>
std::pair< R, std::function< bool()> > InitiateAbortableOperation (Params &&... params)
 Like InitiateOperation but in addition to returning the future it also returns an unspecified object Abort that can be invoked to abort the operation. More...
 
template<class R , class Iterator , class Pred , class Sender , class ReplyHandler >
boost::future< std::vector< boost::future< R > > > SendRequestAndCollectReplies (Iterator begin, Iterator end, Pred filter_pred, AsyncOpParams params, Sender sender, ReplyHandler reply_handler, std::string_view logging_description)
 Utility function to Send requests and collect replies. More...
 
template<class T >
std::vector< std::exception_ptr > ExtractExceptions (std::vector< boost::future< T >> &futures)
 
void UnwrapVoidReplies (boost::future< std::vector< boost::future< void >>> &&futures)
 Unwrap futures to extract errors. More...
 
template<class R >
std::vector< R > UnwrapReplies (boost::future< std::vector< boost::future< R >>> &&futures)
 Unwrap replies. More...
 
template<class ReplyType >
std::optional< ReplyType > HandleMetaDaqReply (std::optional< State > expected_state, State success_state, std::optional< State > error_state, AsyncOpParams params, Source< MetaSource > &source, boost::future< ReplyType > &&fut)
 Reply handler that checks for exceptions in reply. More...
 
template<class ReplyType >
std::optional< ReplyType > HandlePrimDaqReply (std::optional< State > expected_state, State success_state, std::optional< State > error_state, AsyncOpParams params, Source< PrimSource > &source, boost::future< ReplyType > &&fut)
 Reply handler that checks for exceptions in reply. More...
 
template std::optional< std::shared_ptr< DaqReply > > HandleMetaDaqReply< std::shared_ptr< DaqReply > > (std::optional< State > expected_state, State success_state, std::optional< State > error_state, AsyncOpParams params, Source< MetaSource > &source, boost::future< std::shared_ptr< DaqReply >> &&fut)
 
template std::optional< std::shared_ptr< DaqStopReply > > HandleMetaDaqReply< std::shared_ptr< DaqStopReply > > (std::optional< State > expected_state, State success_state, std::optional< State > error_state, AsyncOpParams params, Source< MetaSource > &source, boost::future< std::shared_ptr< DaqStopReply >> &&fut)
 
template std::optional< std::string > HandlePrimDaqReply< std::string > (std::optional< State > expected_state, State success_state, std::optional< State > error_state, AsyncOpParams params, Source< PrimSource > &source, boost::future< std::string > &&fut)
 
template std::optional< std::shared_ptr< RecStatus > > HandlePrimDaqReply< std::shared_ptr< RecStatus > > (std::optional< State > expected_state, State success_state, std::optional< State > error_state, AsyncOpParams params, Source< PrimSource > &source, boost::future< std::shared_ptr< RecStatus >> &&fut)
 

Class Documentation

◆ daq::op::OpStat

struct daq::op::OpStat

Keeps record when operation started and finished.

Definition at line 24 of file start.hpp.

Class Members
time_point< steady_clock > begin
time_point< steady_clock > end

Function Documentation

◆ ExtractExceptions()

template<class T >
std::vector<std::exception_ptr> daq::op::ExtractExceptions ( std::vector< boost::future< T >> &  futures)

Definition at line 92 of file util.hpp.

◆ HandleMetaDaqReply< std::shared_ptr< DaqReply > >()

template std::optional<std::shared_ptr<DaqReply> > daq::op::HandleMetaDaqReply< std::shared_ptr< DaqReply > > ( std::optional< State expected_state,
State  success_state,
std::optional< State error_state,
AsyncOpParams  params,
Source< MetaSource > &  source,
boost::future< std::shared_ptr< DaqReply >> &&  fut 
)

◆ HandleMetaDaqReply< std::shared_ptr< DaqStopReply > >()

template std::optional<std::shared_ptr<DaqStopReply> > daq::op::HandleMetaDaqReply< std::shared_ptr< DaqStopReply > > ( std::optional< State expected_state,
State  success_state,
std::optional< State error_state,
AsyncOpParams  params,
Source< MetaSource > &  source,
boost::future< std::shared_ptr< DaqStopReply >> &&  fut 
)

◆ HandlePrimDaqReply< std::shared_ptr< RecStatus > >()

template std::optional<std::shared_ptr<RecStatus> > daq::op::HandlePrimDaqReply< std::shared_ptr< RecStatus > > ( std::optional< State expected_state,
State  success_state,
std::optional< State error_state,
AsyncOpParams  params,
Source< PrimSource > &  source,
boost::future< std::shared_ptr< RecStatus >> &&  fut 
)

◆ HandlePrimDaqReply< std::string >()

template std::optional<std::string> daq::op::HandlePrimDaqReply< std::string > ( std::optional< State expected_state,
State  success_state,
std::optional< State error_state,
AsyncOpParams  params,
Source< PrimSource > &  source,
boost::future< std::string > &&  fut 
)

◆ InitiateAbortableOperation()

template<class Op , class R = decltype(std::declval<Op&>().Initiate()), class... Params>
std::pair< R, std::function< bool()> > daq::op::InitiateAbortableOperation ( Params &&...  params)

Like InitiateOperation but in addition to returning the future it also returns an unspecified object Abort that can be invoked to abort the operation.

If Abort return true it will have invoked Op::Abort(). If Abort return false the operation has already been completed and future value has been set.

Type Requirements:

Op: Op::Op(Params...) Op::Initiate() -> boost::future<R> Op::Abort() -> void note: It's not required that the future returned from Initiate() has a value set when returning from Abort.

Definition at line 75 of file initiate.hpp.

◆ InitiateOperation()

template<class Op , class R = decltype(std::declval<Op&>().Initiate()), class... Params>
R daq::op::InitiateOperation ( Params &&...  params)

Constructs and initiates Op and return the future result.

InitiateOperation performs the following:

  1. Constructs the operation by forwarding the parameters Params.
  2. Invokes Op::Initiate() -> boost::future<R>
  3. Returns result of Op::Initiate().
  4. Keeps Operation alive until result of Op::Initiate() is set, such that the operation itself does not have to manage this.

Type Requirements:

Op: Op::Op(Params...) Op::Initiate() -> boost::future<R>

Definition at line 66 of file initiate.hpp.