|
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) |
|
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.
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:
- Constructs the operation by forwarding the parameters Params.
- Invokes
Op::Initiate() -> boost::future<R>
- Returns result of
Op::Initiate()
.
- 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.
template<class R , class Iterator , class Pred , class Sender , class ReplyHandler >
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.
- Todo:
- : Need to generalize based on requestor reply type.
- Parameters
-
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. |
- Returns
- Future of R, as returned by replies handler
Type requirement:
with T
being the requestor reply type.
Sender
: boost::future<T> (Source&) ReplyHandler
: R (AsyncOpParams, Source, boost::future<T>)
Definition at line 176 of file util.hpp.