ifw-daq
2.1.0-pre1
IFW Data Acquisition modules
|
Go to the documentation of this file. 1 #ifndef DAQ_OP_ASYNC_OP_PARAMS_HPP_
2 #define DAQ_OP_ASYNC_OP_PARAMS_HPP_
4 #include <boost/asio/io_context.hpp>
5 #include <log4cplus/logger.h>
9 #include "../status.hpp"
10 #include "../eventLog.hpp"
11 #include "../pendingReplies.hpp"
12 #include "../source.hpp"
13 #include "../state.hpp"
14 #include "../utility.hpp"
19 std::vector<Alert>
set;
26 auto alert =
MakeAlert(std::move(
id),
"");
30 *it = std::move(alert);
33 cleared.emplace_back(std::move(alert));
46 for (
auto& a : src.
set) {
47 auto it = std::find(active.begin(), active.end(), a);
49 if (it == active.end() || a.timestamp > it->timestamp) {
54 auto it = std::find(active.begin(), active.end(), a);
56 if (it != active.end() && a.timestamp > it->timestamp) {
72 log4cplus::Logger& logger_arg,
73 std::string
const& id_arg,
102 std::string
const&
id;
132 #endif // #ifndef DAQ_OP_ASYNC_OP_PARAMS_HPP_
std::vector< Source< PrimSource > > & prim_sources
Note: Consider vector immutable!
log4cplus::Logger & logger
PendingReplies & pending_replies
void SetAlert(Alert alert)
Set alert.
AsyncOpParams(AsyncOpParams const &)=default
std::vector< Source< MetaSource > > & meta_sources
Note: Consider vector immutable!a.
AwaitOpParams(AwaitOpParams &&)=default
AsyncOpParams(ObservableStatus &status_arg, ObservableEventLog &event_log_arg, AlertState &alerts, rad::IoExecutor &executor_arg, log4cplus::Logger &logger_arg, std::string const &id_arg, PendingReplies &pending_replies_arg, std::vector< Source< PrimSource >> &prim_sources_arg, std::vector< Source< MetaSource >> &meta_sources_arg)
Simple class that allows you to keep track of how many replies are pending.
void SetAlert(std::vector< Alert > &alerts, Alert alert)
Set alert.
Adapts boost::asio::io_context into a compatible boost::thread Executor type.
ObservableEventLog & event_log
Simple class that holds the source and associated state.
ObservableStatus & status
Async operations should not modify state directly DaqController does that.
Await specific parameters that is not provided with AsyncOpParams.
AwaitOpParams(AsyncOpParams common_arg, AwaitOpParams::Duration wait_interval_arg) noexcept
std::chrono::milliseconds Duration
rad::IoExecutor & executor
AlertState & alerts
Alerts to be merged only after completion of async operation.
Stores data acquisition status and allows subscription to status changes.
std::vector< Alert > cleared
Describes an active Data Acquisition alert.
void ClearAlert(AlertId const &alert)
Clear alert.
Alert MakeAlert(std::string_view category, std::string key, std::string description)
Construct alert.
AwaitOpParams(AwaitOpParams const &)=default
std::vector< Alert > const & GetAlerts() const noexcept
Uniquely identfies an alert.
void MergeAlerts(ObservableStatus &dest, AlertState &src)
Merge alerts.
Parameters required for each async operation.
Duration wait_interval
Total amount of time to wait for condition to be fulfilled.
Stores data acquisition status and allows subscription to status changes.
AsyncOpParams(AsyncOpParams &&)=default