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 165 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:
c.disconnect();
ObservableStatus(std::string id, std::string file_id) noexcept
Construct a new object.
Definition at line 309 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 170 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 254 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 311 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 314 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 207 of file status.cpp.
◆ GetError()
bool daq::ObservableStatus::GetError |
( |
| ) |
const |
|
noexcept |
- Returns
- Data acquisition error flag.
Definition at line 219 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 203 of file status.cpp.
◆ GetState()
State daq::ObservableStatus::GetState |
( |
| ) |
const |
|
noexcept |
- Returns
- Data acquisition state
Definition at line 215 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 274 of file status.cpp.
◆ operator Status()
daq::ObservableStatus::operator Status |
( |
| ) |
const |
Allow implicit conversion to non-observable status.
Definition at line 270 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 174 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 249 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 236 of file status.cpp.
◆ SetResult()
void daq::ObservableStatus::SetResult |
( |
std::string |
result | ) |
|
Set resulting data product path.
- Parameters
-
Definition at line 244 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 223 of file status.cpp.
◆ SignalChanges()
void daq::ObservableStatus::SignalChanges |
( |
bool |
forced = false | ) |
|
|
protectednoexcept |
Signal changes to observers.
Definition at line 260 of file status.cpp.
◆ DeferSignal
The documentation for this class was generated from the following files: