Meta class that handles the timing, triggering and processing of sensor measurements. Internally it runs a looping state machine.
More...
#include <MeasurementManager.hpp>
Meta class that handles the timing, triggering and processing of sensor measurements. Internally it runs a looping state machine.
◆ MeasurementManager()
Construct the manager with parameters and owned SensorRing.
- Parameters
-
| [in] | params | Manager configuration. |
| [in] | sensor_ring | SensorRing instance to manage (ownership transferred). |
◆ enqueueExtraAction()
| void eduart::manager::MeasurementManager::enqueueExtraAction |
( |
std::function< void()> | action | ) |
|
Queue a callable to run once in the next extra-actions slot of the state machine.
- Parameters
-
| [in] | action | Callable executed once from the measurement thread; should be non-blocking and exception-safe. |
◆ getManagerState()
| ManagerState eduart::manager::MeasurementManager::getManagerState |
( |
| ) |
const |
|
noexcept |
Return the current health state of the state machine worker.
- Returns
- Current manager state.
◆ getParams()
| ManagerParams eduart::manager::MeasurementManager::getParams |
( |
| ) |
const |
|
noexcept |
Return the parameters used to initialize the manager.
- Returns
- Initial parameter struct.
◆ getSensorRing()
Return the SensorRing managed by this manager.
- Returns
- Pointer to the managed SensorRing (never null while manager is alive).
◆ isMeasuring()
| bool eduart::manager::MeasurementManager::isMeasuring |
( |
| ) |
|
|
noexcept |
Report whether the measurement worker thread is running.
- Returns
- true if the measurement thread is running.
◆ measureSome()
| bool eduart::manager::MeasurementManager::measureSome |
( |
| ) |
|
|
noexcept |
Run one processing cycle of the state machine worker.
- Returns
- true on success.
◆ startMeasuring()
| bool eduart::manager::MeasurementManager::startMeasuring |
( |
| ) |
|
|
noexcept |
Start the state machine worker loop in a dedicated thread.
- Returns
- true on success.
◆ stopMeasuring()
| bool eduart::manager::MeasurementManager::stopMeasuring |
( |
| ) |
|
|
noexcept |
Stop the state machine worker loop and join the thread.
- Returns
- true on success.
◆ subscribeToDeviceGroup()
Subscribe to device group updates; callback is invoked when the group is updated.
- Parameters
-
| [in] | key | Device group to subscribe to. |
| [in] | callback | Invoked with the updated DeviceGroup. |
- Returns
- RAII Subscription that auto-cancels on destruction.
◆ subscribeToStateChanges()
Subscribe to state changes; callback is invoked when the state changes.
- Parameters
-
- Returns
- RAII Subscription that auto-cancels on destruction.
◆ unsubscribe()
Cancel a subscription.
- Parameters
-
| [in] | token | Token returned by subscribeToDeviceGroup or subscribeToStateChanges. |
The documentation for this class was generated from the following file: