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. More...
|
| |
| void | DisableSignals () noexcept |
| | Disable signals from being sent (unless forced). More...
|
| |
Stores data acquisition status and allows subscription to status changes.
DaqController instances will update ObservableStatus as changes occur.
Definition at line 210 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();
ObservableStatus(std::string id, std::string file_id) noexcept
Construct a new object.
Definition at line 381 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 221 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 397 of file status.hpp.
◆ ClearAlert()
| void daq::ObservableStatus::ClearAlert |
( |
AlertId const & |
alert | ) |
|
Clear alert.
- Parameters
-
Definition at line 327 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 383 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 386 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 368 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 333 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 361 of file status.cpp.
◆ GetAlerts()
| std::vector< Alert > const & daq::ObservableStatus::GetAlerts |
( |
| ) |
const |
|
noexcept |
- Returns
- list of alerts.
Definition at line 258 of file status.cpp.
◆ GetError()
| bool daq::ObservableStatus::GetError |
( |
| ) |
const |
|
noexcept |
- Returns
- Data acquisition error flag.
Definition at line 274 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 254 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 301 of file status.cpp.
◆ GetState()
| State daq::ObservableStatus::GetState |
( |
| ) |
const |
|
noexcept |
- Returns
- Data acquisition state
Definition at line 270 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 357 of file status.cpp.
◆ GetTimestamp()
| Status::Clock::time_point daq::ObservableStatus::GetTimestamp |
( |
| ) |
const |
|
noexcept |
◆ operator Status()
| daq::ObservableStatus::operator Status |
( |
| ) |
const |
Allow implicit conversion to non-observable status.
Definition at line 353 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 225 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 322 of file status.cpp.
◆ SetError()
| void daq::ObservableStatus::SetError |
( |
bool |
error | ) |
|
|
noexcept |
Set error flag for data acquisition.
- Parameters
-
| error | New error flag status. |
- Postcondition
- Connected observers have been signalled.
Definition at line 309 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 291 of file status.cpp.
◆ SetResult()
| void daq::ObservableStatus::SetResult |
( |
std::string |
result | ) |
|
Set resulting data product path.
- Parameters
-
Definition at line 317 of file status.cpp.
◆ SetState()
| void daq::ObservableStatus::SetState |
( |
State |
s, |
|
|
std::optional< bool > |
error = std::nullopt |
|
) |
| |
|
noexcept |
Set state of data acquisition.
- Parameters
-
| s | New state |
| error | Optional new error flag value. |
- Postcondition
- Connected observers have been signalled.
Definition at line 278 of file status.cpp.
◆ DeferSignal
The documentation for this class was generated from the following files: