Stores data acquisition status and allows subscription to status changes.
More...
#include <status.hpp>
|
| void | EnableSignals (bool force) noexcept |
| | Decrement signal blocker and if number of blocks reaches zero emit signal if generations are differnt, unless forced in which case signal is always emitted.
|
| |
| void | DisableSignals () noexcept |
| | Disable signals from being sent (unless forced).
|
| |
|
| using | SignalType = boost::signals2::signal< void(ObservableStatus const &)> |
| | Connect observer that is invoked when state is modified.
|
| |
| void | SetState (State s) noexcept |
| | Set state of data acquisition.
|
| |
| void | SetReceiverStatus (std::size_t index, ReceiverStatus status) |
| | Set receiver status.
|
| |
| ReceiverStatus | GetReceiverStatus (std::size_t index) const noexcept |
| | Get receiver status.
|
| |
| void | SetResult (std::string result) |
| | Set resulting data product path.
|
| |
| void | SetAlert (Alert alert) |
| | Set alert.
|
| |
| void | ClearAlert (AlertId const &alert) |
| | Clear alert.
|
| |
| template<class Observer > |
| boost::signals2::connection | ConnectObserver (Observer o) |
| | Connect observer that is invoked when state is modified.
|
| |
| boost::signals2::connection | ConnectStatus (SignalType::slot_type const &slot) |
| | Connect observer that is invoked when state is modified.
|
| |
| void | EmitSignal (bool forced=false) noexcept |
| | Emit signal, which unless force == true, will only emit signal unless blocked.
|
| |
| unsigned | ChangesSinceLastSignal () const noexcept |
| | Query number of changes made since last signal.
|
| |
| | operator Status () const |
| | Allow implicit conversion to non-observable status.
|
| |
| Status const & | GetStatus () const noexcept |
| | Connect observer that is invoked when state is modified.
|
| |
Stores data acquisition status and allows subscription to status changes.
DaqController instances will update ObservableStatus as changes occur.
Definition at line 224 of file status.hpp.
◆ SignalType
Connect observer that is invoked when state is modified.
- Parameters
-
| o | Observer callable invoked on status changes (state or file changes) Observer must be invocable with signature void(ObservableStatus const&). |
- Returns
- signal connection object that can be used to disconnect observer:
c.disconnect();
Stores data acquisition status and allows subscription to status changes.
Definition at line 404 of file status.hpp.
◆ ObservableStatus() [1/4]
| daq::ObservableStatus::ObservableStatus |
( |
std::string |
id, |
|
|
std::string |
file_id |
|
) |
| |
|
explicitnoexcept |
Construct a new object.
- Parameters
-
| id | Data acquisition identifier. |
Definition at line 248 of file status.cpp.
◆ ObservableStatus() [2/4]
| daq::ObservableStatus::ObservableStatus |
( |
Status |
status | ) |
|
|
explicit |
◆ ObservableStatus() [3/4]
◆ ObservableStatus() [4/4]
◆ ChangesSinceLastSignal()
| unsigned daq::ObservableStatus::ChangesSinceLastSignal |
( |
| ) |
const |
|
inlinenoexcept |
Query number of changes made since last signal.
Definition at line 420 of file status.hpp.
◆ ClearAlert()
| void daq::ObservableStatus::ClearAlert |
( |
AlertId const & |
alert | ) |
|
Clear alert.
- Parameters
-
Definition at line 341 of file status.cpp.
◆ ConnectObserver()
template<class Observer >
| boost::signals2::connection daq::ObservableStatus::ConnectObserver |
( |
Observer |
o | ) |
|
|
inline |
Connect observer that is invoked when state is modified.
- Parameters
-
| o | Observer callable invoked on status changes (state or file changes) Observer must be invocable with signature void(ObservableStatus const&). |
- Returns
- signal connection object that can be used to disconnect observer:
Definition at line 406 of file status.hpp.
◆ ConnectStatus()
| boost::signals2::connection daq::ObservableStatus::ConnectStatus |
( |
SignalType::slot_type const & |
slot | ) |
|
|
inline |
Connect observer that is invoked when state is modified.
- Parameters
-
| o | Observer callable invoked on status changes (state or file changes) Observer must be invocable with signature void(ObservableStatus const&). |
- Returns
- signal connection object that can be used to disconnect observer:
Definition at line 409 of file status.hpp.
◆ DisableSignals()
| void daq::ObservableStatus::DisableSignals |
( |
| ) |
|
|
protectednoexcept |
Disable signals from being sent (unless forced).
- Returns
- generation counter which can be used to detect if Status has been modified.
Definition at line 382 of file status.cpp.
◆ EmitSignal()
| void daq::ObservableStatus::EmitSignal |
( |
bool |
forced = false | ) |
|
|
noexcept |
Emit signal, which unless force == true, will only emit signal unless blocked.
Definition at line 347 of file status.cpp.
◆ EnableSignals()
| void daq::ObservableStatus::EnableSignals |
( |
bool |
force | ) |
|
|
protectednoexcept |
Decrement signal blocker and if number of blocks reaches zero emit signal if generations are differnt, unless forced in which case signal is always emitted.
- Parameters
-
| force | Force signal to be emitted even though |
- Returns
- generation counter which can be used to detect if Status has been modified.
Definition at line 375 of file status.cpp.
◆ GetAlerts()
| std::vector< Alert > const & daq::ObservableStatus::GetAlerts |
( |
| ) |
const |
|
noexcept |
- Returns
- list of alerts.
Definition at line 285 of file status.cpp.
◆ GetFileId()
| std::string const & daq::ObservableStatus::GetFileId |
( |
| ) |
const |
|
noexcept |
◆ GetId()
| std::string const & daq::ObservableStatus::GetId |
( |
| ) |
const |
|
noexcept |
- Returns
- Data acquisition identifier
Definition at line 281 of file status.cpp.
◆ GetReceiverStatus()
| ReceiverStatus daq::ObservableStatus::GetReceiverStatus |
( |
std::size_t |
index | ) |
const |
|
noexcept |
Get receiver status.
- Parameters
-
| index | Index of receiver in DpSpec. |
- Returns
- Status structure.
Definition at line 323 of file status.cpp.
◆ GetState()
| State daq::ObservableStatus::GetState |
( |
| ) |
const |
|
noexcept |
- Returns
- Data acquisition state
Definition at line 297 of file status.cpp.
◆ GetStatus()
| Status const & daq::ObservableStatus::GetStatus |
( |
| ) |
const |
|
noexcept |
Connect observer that is invoked when state is modified.
- Parameters
-
| o | Observer callable invoked on status changes (state or file changes) Observer must be invocable with signature void(ObservableStatus const&). |
- Returns
- signal connection object that can be used to disconnect observer:
Definition at line 371 of file status.cpp.
◆ GetTimestamp()
| Status::Clock::time_point daq::ObservableStatus::GetTimestamp |
( |
| ) |
const |
|
noexcept |
◆ HasError()
| bool daq::ObservableStatus::HasError |
( |
| ) |
const |
|
noexcept |
- Returns
- Data acquisition error flag.
Definition at line 301 of file status.cpp.
◆ operator Status()
| daq::ObservableStatus::operator Status |
( |
| ) |
const |
Allow implicit conversion to non-observable status.
Definition at line 367 of file status.cpp.
◆ operator!=() [1/2]
◆ operator!=() [2/2]
| bool daq::ObservableStatus::operator!= |
( |
Status const & |
rhs | ) |
const |
|
noexcept |
◆ operator=() [1/3]
◆ operator=() [2/3]
◆ operator=() [3/3]
Assign new status where the new status refers to the same DAQ.
- Parameters
-
| status | New status to assign from. |
- Exceptions
-
| std::invalid_argument | if status.id is not equal to this->id. |
Definition at line 252 of file status.cpp.
◆ operator==() [1/2]
◆ operator==() [2/2]
| bool daq::ObservableStatus::operator== |
( |
Status const & |
rhs | ) |
const |
|
noexcept |
◆ SetAlert()
| void daq::ObservableStatus::SetAlert |
( |
Alert |
alert | ) |
|
Set alert.
- Note
- An existing alert with same ID will be overwritten.
- Parameters
-
Definition at line 336 of file status.cpp.
◆ SetReceiverStatus()
| void daq::ObservableStatus::SetReceiverStatus |
( |
std::size_t |
index, |
|
|
ReceiverStatus |
status |
|
) |
| |
Set receiver status.
- Parameters
-
| index | Index of receiver in DpSpec. |
| status | Status structure to write. |
Definition at line 313 of file status.cpp.
◆ SetResult()
| void daq::ObservableStatus::SetResult |
( |
std::string |
result | ) |
|
Set resulting data product path.
- Parameters
-
Definition at line 331 of file status.cpp.
◆ SetState()
| void daq::ObservableStatus::SetState |
( |
State |
s | ) |
|
|
noexcept |
Set state of data acquisition.
- Parameters
-
- Postcondition
- Connected observers have been signalled.
Definition at line 305 of file status.cpp.
◆ DeferSignal
The documentation for this class was generated from the following files: