TwirreLink
 All Classes Functions Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
twirre::SerialSensor Class Reference
Inheritance diagram for twirre::SerialSensor:
Inheritance graph
[legend]
Collaboration diagram for twirre::SerialSensor:
Collaboration graph
[legend]

Public Member Functions

 SerialSensor (const int id, const std::string name, const std::string description, SerialRW &serialRW, const std::string valuesString, std::mutex &mutex)
 
 SerialSensor (const SerialSensor &)=delete
 
 SerialSensor (SerialSensor &&)=delete
 
SerialSensoroperator= (const SerialSensor &)=delete
 
SerialSensoroperator= (SerialSensor &&)=delete
 
virtual std::map< std::string,
Value * > 
Sense_impl (const std::vector< std::string > &names) override
 Returns the updated requested values. More...
 
- Public Member Functions inherited from twirre::Sensor
 Sensor (const std::string name, const std::string description)
 
 Sensor (const Sensor &)=delete
 
 Sensor (Sensor &&)=delete
 
Sensoroperator= (const Sensor &)=delete
 
Sensoroperator= (Sensor &&)=delete
 
virtual std::map< std::string,
Value * > 
SenseAll ()
 
virtual std::vector< std::string > getAvailableValues ()
 
virtual bool haveValue (std::string name)
 
virtual bool haveValues (std::vector< std::string >)
 
virtual ValuepeekValue (std::string name)
 
virtual std::map< std::string,
Value * > 
peekValues (const std::vector< std::string > &names)
 
virtual void onSense (const std::vector< std::string > &names)
 
ValueSense (const std::string &name)
 
std::map< std::string, Value * > Sense (const std::vector< std::string > &names)
 
Valueoperator[] (const std::string &name)
 
std::map< std::string, Value * > operator[] (const std::vector< std::string > &names)
 
virtual std::string ToString () override
 
void clearLoggerCallback ()
 
void setLoggerCallback (std::function< void(Sensor *, std::map< std::string, Value * > &)> cbfn)
 
- Public Member Functions inherited from twirre::Device
 Device (const std::string name, const std::string description)
 
virtual const std::string & getName () const
 
virtual const std::string & getDescription () const
 
- Public Member Functions inherited from twirre::SerialDevice
int getId () const
 

Protected Member Functions

void _ProcessValuesString (const std::string &s)
 
- Protected Member Functions inherited from twirre::Sensor
void registerValue (Value *val)
 
void registerValues (std::vector< Value * > vals)
 
- Protected Member Functions inherited from twirre::SerialDevice
 SerialDevice (const int id)
 

Protected Attributes

SerialRW_serial
 
std::mutex & _serialMutex
 
- Protected Attributes inherited from twirre::Sensor
std::function< void(Sensor
*, std::map< std::string,
Value * > &)> 
_loggerCallback
 
std::map< std::string, Value * > _valueList
 
- Protected Attributes inherited from twirre::Device
const std::string _name
 
const std::string _description
 
- Protected Attributes inherited from twirre::SerialDevice
const int _id
 

Member Function Documentation

map< string, Value * > twirre::SerialSensor::Sense_impl ( const std::vector< std::string > &  names)
overridevirtual

Returns the updated requested values.

Duplicate names will be ignored If a given value name is invalid, ErrorValue will be returned for that name If the serial communication failed the old values will be returned

Reimplemented from twirre::Sensor.


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