obmon  0.0.0
 All Classes Functions Variables Enumerations Groups Pages
ObSensor Class Reference

Base Obmon sensor class. More...

#include <ObSensor.h>

Inheritance diagram for ObSensor:
ObSensorSystem ObSensorTest

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.
 

Detailed Description

Base Obmon sensor class.

Author
Martin Vala mvala.nosp@m.@cer.nosp@m.n.ch

Definition at line 19 of file ObSensor.h.

Constructor & Destructor Documentation

ObSensor::ObSensor ( std::string  name = {"sensor"})

Constructor

Definition at line 3 of file ObSensor.cpp.

ObSensor::~ObSensor ( )
virtual

Destructor

Definition at line 10 of file ObSensor.cpp.

Member Function Documentation

void ObSensor::init ( )
virtual

Init sensor function

Reimplemented in ObSensorSystem, and ObSensorTest.

Definition at line 16 of file ObSensor.cpp.

References _sensors.

std::string ObSensor::json ( const std::string  name = {}) const
virtual

Return json string from current sensor

Reimplemented in ObSensorSystem, and ObSensorTest.

Definition at line 50 of file ObSensor.cpp.

References _name, _sensors, and name().

void ObSensor::update ( int  timeout)
finalvirtual

Update sensor function

Definition at line 26 of file ObSensor.cpp.

References _first, _second, _sensors, and type().


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