ifw-daq
2.1.0-pre1
IFW Data Acquisition modules
|
Namespaces | |
eventlog | |
Classes | |
struct | AbortAsync |
A composite async operation that aborts a DAQ. More... | |
struct | AlertState |
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 | |
void | MergeAlerts (ObservableStatus &dest, AlertState &src) |
Merge alerts. More... | |
template<class Op , class R = decltype(std::declval<Op&>().Initiate()), class... Params> | |
R | 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 (char const *request, 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 (char const *request, 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 > > (char const *request, 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 > > (char const *request, 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 > (char const *request, 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 > > (char const *request, 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) |
struct daq::op::OpStat |
std::vector<std::exception_ptr> daq::op::ExtractExceptions | ( | std::vector< boost::future< T >> & | futures | ) |
std::optional< ReplyType > daq::op::HandleMetaDaqReply | ( | char const * | request, |
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.
Exception | contained in reply. |
expected_state | The state the source is expected to be in when receving the reply. |
success_state | The state the source is set to on success. |
daq | Data acquisition the operation belongs to. |
source | The source to handle reply from. |
fut | Reply. |
template std::optional<std::shared_ptr<DaqReply> > daq::op::HandleMetaDaqReply< std::shared_ptr< DaqReply > > | ( | char const * | request, |
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> > daq::op::HandleMetaDaqReply< std::shared_ptr< DaqStopReply > > | ( | char const * | request, |
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 | ||
) |
std::optional< ReplyType > daq::op::HandlePrimDaqReply | ( | char const * | request, |
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.
Exception | contained in reply. |
expected_state | The state the source is expected to be in when receving the reply. |
success_state | The state the source is set to on success. |
daq | Data acquisition the operation belongs to. |
source | The source to handle reply from. |
fut | Reply. |
template std::optional<std::shared_ptr<RecStatus> > daq::op::HandlePrimDaqReply< std::shared_ptr< RecStatus > > | ( | char const * | request, |
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 | ||
) |
template std::optional<std::string> daq::op::HandlePrimDaqReply< std::string > | ( | char const * | request, |
std::optional< State > | expected_state, | ||
State | success_state, | ||
std::optional< State > | error_state, | ||
AsyncOpParams | params, | ||
Source< PrimSource > & | source, | ||
boost::future< std::string > && | fut | ||
) |
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.
R daq::op::InitiateOperation | ( | Params &&... | params | ) |
Constructs and initiates Op
and return the future result.
InitiateOperation performs the following:
Op::Initiate() -> boost::future<R>
Op::Initiate()
.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.
|
inline |
Merge alerts.
It only set/clears if timestamp is newer.
Definition at line 43 of file asyncOpParams.hpp.
boost::future< std::vector< boost::future< R > > > daq::op::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.
begin | Beginning of sequence of sources to send request. |
end | End of sequence of sources to send request. |
params | Parameters for this async operation. |
sender | Functor that sends request and returns future. |
reply_handler | Handler invoked once for each reply received. The handler may transform the reply and return a value containing a different type than the input. It should not return a future. |
replies_handler | Handler invoked once when all replies are received. It will be passed the vector of replies returned from reply_handler. To communicate failure it shall throw an exception. |
Type requirement:
with T
being the requestor reply type.
Sender
: boost::future<T> (Source&) ReplyHandler
: R (AsyncOpParams, Source, boost::future<T>)
std::vector<R> daq::op::UnwrapReplies | ( | boost::future< std::vector< boost::future< R >>> && | futures | ) |
void daq::op::UnwrapVoidReplies | ( | boost::future< std::vector< boost::future< void >>> | futures | ) |
Unwrap futures to extract errors.
DaqSourceErrors | containing all exceptions. |