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

Tesing Obmon sensor class. More...

#include <ObSensorTest.h>

Inheritance diagram for ObSensorTest:
ObSensor

Public Types

enum  SensorType { VALUE, SPEED }
 Enums for sensor type.
 

Public Member Functions

 ObSensorTest (std::string _name={"sys"})
 
virtual ~ObSensorTest ()
 
void init () override
 
void process () override
 Process function. More...
 
void speed (ObSensor *s1, ObSensor *s2, int timeout=1000) override
 Calculate time change (speed) More...
 
std::string json (const std::string name={"static"}) const override
 
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

Tesing Obmon sensor class.

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

Definition at line 20 of file ObSensorTest.h.

Constructor & Destructor Documentation

ObSensorTest::ObSensorTest ( std::string  _name = {"sys"})

Constructor

Definition at line 3 of file ObSensorTest.cpp.

Referenced by init().

ObSensorTest::~ObSensorTest ( )
virtual

Destructor

Definition at line 8 of file ObSensorTest.cpp.

Member Function Documentation

void ObSensorTest::init ( )
overridevirtual

Init sensor function

Reimplemented from ObSensor.

Definition at line 14 of file ObSensorTest.cpp.

References ObSensor::_change, ObSensor::_first, ObSensor::_second, and ObSensorTest().

std::string ObSensorTest::json ( const std::string  name = {"static"}) const
overridevirtual

Returns current sensor representation in json format

Reimplemented from ObSensor.

Definition at line 46 of file ObSensorTest.cpp.

References ObSensor::_logger, and ObSensor::name().

void ObSensorTest::process ( )
overridevirtual

Process function.

Process sensor function

Reimplemented from ObSensor.

Definition at line 23 of file ObSensorTest.cpp.

References ObSensor::_logger, and ObSensor::_name.

void ObSensorTest::speed ( ObSensor ,
ObSensor ,
int  = 1000 
)
overridevirtual

Calculate time change (speed)

Calculate change over time (speed)

Reimplemented from ObSensor.

Definition at line 31 of file ObSensorTest.cpp.

References ObSensor::_logger, and ObSensor::name().

void ObSensor::update ( int  timeout)
finalvirtualinherited

Update sensor function

Definition at line 26 of file ObSensor.cpp.

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


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