ifw-daq
2.1.0-pre1
IFW Data Acquisition modules
|
Go to the documentation of this file.
8 #ifndef OCM_DAQ_DAQ_STATUS_HPP_
9 #define OCM_DAQ_DAQ_STATUS_HPP_
16 #include <boost/signals2/signal.hpp>
31 constexpr std::string_view
REQUEST =
"request";
72 using Clock = std::chrono::system_clock;
83 Alert MakeAlert(std::string_view category, std::string key, std::string description);
121 using TimePoint = std::chrono::time_point<std::chrono::steady_clock>;
124 explicit Status(std::string
id, std::string
file_id) noexcept;
183 void Reset() noexcept;
189 return m_status !=
nullptr;
227 std::string
const&
GetId() const noexcept;
232 std::
string const&
GetFileId() const noexcept;
306 template <class Observer>
308 return m_signal.connect(std::move(o));
311 return m_signal.connect(slot);
334 unsigned m_deferred_signals = 0;
340 #endif // #ifndef OCM_DAQ_DAQ_STATUS_HPP_
void EnableSignals() noexcept
Status(Status const &)=default
Clock::time_point TimePoint
State
Observable states of the data acquisition process.
void SetAlert(Alert alert)
Set alert.
bool operator==(Status const &rhs) const noexcept
AlertId MakeAlertId(std::string_view category, std::string key)
Status & operator=(Status const &)=default
void DisableSignals() noexcept
std::vector< Alert > alerts
Active alerts.
void Reset() noexcept
If object is valid.
ObservableStatus & operator=(ObservableStatus &&)=default
void SetAlert(std::vector< Alert > &alerts, Alert alert)
Set alert.
void SetResult(std::string result)
Set resulting data product path.
constexpr std::string_view TRANSFERRING_RSYNC
Failure during rsync source copy.
State GetState() const noexcept
std::string key
Unique key for each alert.
Contains data structure for FITS keywords.
Defer signal changes until later time.
std::chrono::system_clock Clock
void SignalChanges(bool forced=false) noexcept
Signal changes to observers.
bool GetError() const noexcept
std::string const & GetFileId() const noexcept
std::string category
Standardized category.
Status & operator=(Status &&)=default
bool operator!=(ObservableStatus const &rhs) const noexcept
std::chrono::time_point< std::chrono::steady_clock > TimePoint
Stores data acquisition status and allows subscription to status changes.
void SetError(bool error) noexcept
Set error flag for data acquisition.
std::string const & GetId() const noexcept
Describes an active Data Acquisition alert.
constexpr std::string_view MERGING_MERGE
Merging failed.
bool operator==(ObservableStatus const &rhs) const noexcept
ObservableStatus(ObservableStatus &&)=default
std::string result
Path to resulting data product.
ObservableStatus(ObservableStatus const &)=delete
bool operator!=(Status const &rhs) const noexcept
daqif::DaqStatus & operator<<(daqif::DaqStatus &status, daq::Status const &rhs)
Convert daq::Status -> daqif::DaqStatus by populating from rhs.
void ClearAlert(AlertId const &alert)
Clear alert.
bool ClearAlert(std::vector< Alert > &alerts, AlertId const &alert)
Clear alert.
Alert MakeAlert(std::string_view category, std::string key, std::string description)
Construct alert.
ObservableStatus(std::string id, std::string file_id) noexcept
Construct a new object.
Status const & GetStatus() const noexcept
Connect observer that is invoked when state is modified.
std::vector< Alert > const & GetAlerts() const noexcept
Uniquely identfies an alert.
Declares daq::State and related functions.
Non observable status object that keeps stores status of data acquisition.
bool operator!=(AlertId const &lhs, AlertId const &rhs) noexcept
bool IsValid() const noexcept
constexpr std::string_view REQUEST
Request.
Contains declaration for DpPart.
void SetState(State s, std::optional< bool > error=std::nullopt) noexcept
Set state of data acquisition.
boost::signals2::connection ConnectStatus(Signal::slot_type const &slot)
Connect observer that is invoked when state is modified.
bool operator==(DaqContext const &lhs, DaqContext const &rhs) noexcept
boost::signals2::connection ConnectObserver(Observer o)
Connect observer that is invoked when state is modified.
ObservableStatus & operator=(ObservableStatus const &)=delete
boost::signals2::signal< void(ObservableStatus const &)> Signal
Connect observer that is invoked when state is modified.
Status(Status &&)=default