obmon
0.0.0
|
Base Obmon sensor class. More...
#include <ObSensor.h>
Public Types | |
enum | SensorType { VALUE, SPEED } |
Enums for sensor type. | |
Public Member Functions | |
ObSensor (std::string name={"sensor"}) | |
virtual | ~ObSensor () |
virtual void | init () |
virtual void | process () |
Process function. | |
virtual void | speed (ObSensor *, ObSensor *, int) |
Calculate time change (speed) | |
virtual std::string | json (const std::string name={}) const |
virtual void | update (int timeout) final |
std::string | name () const |
Returns name of sensor. | |
void | type (SensorType t) |
Sets sensor type. | |
SensorType | type () const |
Returns sensor type. | |
std::vector< ObSensor * > & | sensors () |
Return list of sensors. | |
Protected Attributes | |
std::shared_ptr< spdlog::logger > | _logger |
Pointer to spd logger. | |
std::string | _name |
Sensor name. | |
SensorType | _type |
Sensor type. | |
ObSensor * | _first {} |
Pointer to first sensor. | |
ObSensor * | _second {} |
Pointer to second sensor. | |
ObSensor * | _change {} |
Pointer to change sensor. | |
std::vector< ObSensor * > | _sensors {} |
List of subsensors. | |
Base Obmon sensor class.
Definition at line 19 of file ObSensor.h.
ObSensor::ObSensor | ( | std::string | name = {"sensor"} | ) |
Constructor
Definition at line 3 of file ObSensor.cpp.
|
virtual |
Destructor
Definition at line 10 of file ObSensor.cpp.
|
virtual |
Init sensor function
Reimplemented in ObSensorSystem, and ObSensorTest.
Definition at line 16 of file ObSensor.cpp.
References _sensors.
|
virtual |
Return json string from current sensor
Reimplemented in ObSensorSystem, and ObSensorTest.
Definition at line 50 of file ObSensor.cpp.
|
finalvirtual |