Stores data acquisition status and allows subscription to status changes.
More...
#include <status.hpp>
Stores data acquisition status and allows subscription to status changes.
DaqController instances will update ObservableStatus as changes occur.
Definition at line 161 of file status.hpp.
◆ Signal
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 305 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 139 of file status.cpp.
◆ ObservableStatus() [2/4]
daq::ObservableStatus::ObservableStatus |
( |
Status |
status | ) |
|
|
explicit |
◆ ObservableStatus() [3/4]
◆ ObservableStatus() [4/4]
◆ ClearAlert()
void daq::ObservableStatus::ClearAlert |
( |
AlertId const & |
alert | ) |
|
Clear alert.
- Parameters
-
Definition at line 223 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 307 of file status.hpp.
◆ ConnectStatus()
boost::signals2::connection daq::ObservableStatus::ConnectStatus |
( |
Signal::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 310 of file status.hpp.
◆ DisableSignals()
void daq::ObservableStatus::DisableSignals |
( |
| ) |
|
|
protectednoexcept |
◆ EnableSignals()
void daq::ObservableStatus::EnableSignals |
( |
| ) |
|
|
protectednoexcept |
◆ GetAlerts()
std::vector< Alert > const & daq::ObservableStatus::GetAlerts |
( |
| ) |
const |
|
noexcept |
- Returns
- Data acquisition identifier
Definition at line 176 of file status.cpp.
◆ GetError()
bool daq::ObservableStatus::GetError |
( |
| ) |
const |
|
noexcept |
- Returns
- Data acquisition error flag.
Definition at line 188 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 172 of file status.cpp.
◆ GetState()
State daq::ObservableStatus::GetState |
( |
| ) |
const |
|
noexcept |
- Returns
- Data acquisition state
Definition at line 184 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 243 of file status.cpp.
◆ operator Status()
daq::ObservableStatus::operator Status |
( |
| ) |
const |
Allow implicit conversion to non-observable status.
Definition at line 239 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 143 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 218 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 205 of file status.cpp.
◆ SetResult()
void daq::ObservableStatus::SetResult |
( |
std::string |
result | ) |
|
Set resulting data product path.
- Parameters
-
Definition at line 213 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 192 of file status.cpp.
◆ SignalChanges()
void daq::ObservableStatus::SignalChanges |
( |
bool |
forced = false | ) |
|
|
protectednoexcept |
Signal changes to observers.
Definition at line 229 of file status.cpp.
◆ DeferSignal
The documentation for this class was generated from the following files: