20#include "sensorring/platform/SensorringExport.hpp"
29class SENSORRING_EXPORT MeasurementManagerImpl;
85 subscription::Subscription
subscribeToDeviceGroup(device::DeviceType key, std::function<
void(const device::DeviceGroup&)> callback);
118 std::unique_ptr<MeasurementManagerImpl> _mm_impl;
Container for a group of devices with filtering and iteration by type.
Enumeration of supported device hardware types.
Parameter structure for the MeasurementManager.
ManagerState and helpers for the MeasurementManager.
ManagerState
Health state of the sensorring state machine worker.
Definition ManagerState.hpp:25
Top-level container managing multiple sensor buses.
Opaque token identifying a subscription.
RAII wrapper pairing a SubscriberToken with its cancel function.
bool stopMeasuring() noexcept
Stop the state machine worker loop and join the thread.
ring::SensorRing * getSensorRing() const noexcept
Return the SensorRing managed by this manager.
void unsubscribe(subscription::SubscriberToken token)
Cancel a subscription.
~MeasurementManager() noexcept
Destructor.
void enqueueExtraAction(std::function< void()> action)
Queue a callable to run once in the next extra-actions slot of the state machine.
MeasurementManager(ManagerParams params, std::unique_ptr< ring::SensorRing > sensor_ring)
Construct the manager with parameters and owned SensorRing.
bool measureSome() noexcept
Run one processing cycle of the state machine worker.
bool isMeasuring() noexcept
Report whether the measurement worker thread is running.
subscription::Subscription subscribeToDeviceGroup(device::DeviceType key, std::function< void(const device::DeviceGroup &)> callback)
Subscribe to device group updates; callback is invoked when the group is updated.
ManagerState getManagerState() const noexcept
Return the current health state of the state machine worker.
ManagerParams getParams() const noexcept
Return the parameters used to initialize the manager.
subscription::Subscription subscribeToStateChanges(std::function< void(const ManagerState state)> callback)
Subscribe to state changes; callback is invoked when the state changes.
bool startMeasuring() noexcept
Start the state machine worker loop in a dedicated thread.
Parameter structure of the MeasurementManager. The MeasurementManager handles the timing and communic...
Definition ManagerParams.hpp:24