roo_transceivers
API Documentation for roo_transceivers
Loading...
Searching...
No Matches
roo_transceivers::SimpleSensorUniverse Class Referenceabstract

Convenience Universe for identical, basic sensor-only transceivers. More...

#include <simple_sensor_universe.h>

Inheritance diagram for roo_transceivers::SimpleSensorUniverse:
[legend]
Collaboration diagram for roo_transceivers::SimpleSensorUniverse:
[legend]

Public Member Functions

bool getDeviceDescriptor (const DeviceLocator &locator, roo_transceivers_Descriptor &descriptor) const override
 Synthesizes a single-sensor descriptor for locator.
 
Measurement read (const SensorLocator &locator) const override
 Reads the single sensor of a device.
 
bool write (const ActuatorLocator &locator, float value) override
 This universe is sensor-only; writes are always rejected.
 
- Public Member Functions inherited from roo_transceivers::Universe
virtual ~Universe ()=default
 
virtual size_t deviceCount () const =0
 Returns the total number of transceiver devices in this universe.
 
virtual bool forEachDevice (std::function< bool(const DeviceLocator &)> callback) const =0
 Iterates over all transceiver devices in this universe, calling callback for each device.
 
virtual void requestUpdate ()=0
 Requests sensor reading update from underlying devices.
 
virtual void addEventListener (EventListener *listener)
 Registers a listener for device-set and reading update events.
 
virtual void removeEventListener (EventListener *listener)
 Removes a previously registered event listener.
 

Protected Member Functions

virtual Measurement readSensor (const DeviceLocator &locator) const =0
 
virtual roo_transceivers_Quantity getSensorQuantity (DeviceLocator device_locator) const =0
 

Detailed Description

Convenience Universe for identical, basic sensor-only transceivers.

Each device exposes exactly one sensor and no actuators.

Can be used e.g. for a collection of identical thermometers.

This class implements the full Universe contract. Implementations only need to provide:

Definition at line 17 of file simple_sensor_universe.h.

Member Function Documentation

◆ getDeviceDescriptor()

bool roo_transceivers::SimpleSensorUniverse::getDeviceDescriptor ( const DeviceLocator locator,
roo_transceivers_Descriptor descriptor 
) const
inlineoverridevirtual

◆ getSensorQuantity()

virtual roo_transceivers_Quantity roo_transceivers::SimpleSensorUniverse::getSensorQuantity ( DeviceLocator  device_locator) const
protectedpure virtual

◆ read()

Measurement roo_transceivers::SimpleSensorUniverse::read ( const SensorLocator locator) const
inlineoverridevirtual

Reads the single sensor of a device.

Only empty sensor id ("") is valid. Any non-empty sensor id returns an initial/unspecified measurement.

Implements roo_transceivers::Universe.

Definition at line 40 of file simple_sensor_universe.h.

References roo_transceivers::SensorLocator::device_locator(), readSensor(), and roo_transceivers::SensorLocator::sensor_id().

◆ readSensor()

virtual Measurement roo_transceivers::SimpleSensorUniverse::readSensor ( const DeviceLocator locator) const
protectedpure virtual

Implemented in roo_transceivers::OneWireUniverse.

Referenced by read().

◆ write()

bool roo_transceivers::SimpleSensorUniverse::write ( const ActuatorLocator locator,
float  value 
)
inlineoverridevirtual

This universe is sensor-only; writes are always rejected.

Implements roo_transceivers::Universe.

Definition at line 48 of file simple_sensor_universe.h.


The documentation for this class was generated from the following file: