55 return id == sampler.id && period == sampler.period &&
56 sensors.size() == sampler.sensors.size();
107 std::chrono::nanoseconds period;
110 std::vector<std::pair<AbstractSensor*, SensorInfo>>
sensors;
Base abstract class for sensor drivers.
static PrintLogger getLogger(const string &name)
Virtual sensor sampler class.
unsigned int getNumSensors()
SensorSampler(uint8_t id, std::chrono::nanoseconds period)
std::vector< std::pair< AbstractSensor *, SensorInfo > > sensors
void disableAllSensors()
Disable sampling for all the sensors.
static bool compareByPeriod(SensorSampler *left, SensorSampler *right)
const SensorInfo getSensorInfo(AbstractSensor *sensor)
void enableAllSensors()
Enable sampling for all the sensors.
void toggleSensor(AbstractSensor *sensor, bool isEnabled)
Enabled or disable a sensor.
virtual void addSensor(AbstractSensor *sensor, SensorInfo sensorInfo)=0
Add a sensor to the sensors map.
bool operator==(const SensorSampler &sampler) const
std::chrono::nanoseconds getSamplingPeriod()
void sampleAndCallback()
For each sensor, sample it and call the corresponding callback.
Sampler for simple sensors, those that are simply sampled by calling the sample() method.
SimpleSensorSampler(uint8_t id, std::chrono::nanoseconds period)
void sampleSensor(AbstractSensor *s) override
Perform the update of all the sensors in the sampler.
void addSensor(AbstractSensor *sensor, SensorInfo sensorInfo) override
Add a sensor to the sensors map.
This file includes all the types the logdecoder script will decode.
Sensors information struct needed by the SensorManager.