Robox Library for Cpp: BCC/31 module 1.0.0
RLibCpp BCC/31 protocol implementation
|
Abstract base class for monitors handling. More...
#include <basemonitor.h>
Public Member Functions | |
BaseMonitor () | |
Class constructor. | |
virtual | ~BaseMonitor () |
Class desstructor. | |
virtual Globals::Results | clear () |
Clears the monitor, i.e. removes all the defined variables etc. | |
virtual Globals::Results | add (const Variable &var) |
Adds a variable to the monitor definition. | |
virtual bool | connected () |
Get the flag to indicate if the monitor is connected to the device. | |
virtual uint32_t | count () |
Get the number of registered variables. | |
virtual bool | coherentValues () |
Get the flag setted to use coherent operations , i.e. don't split the command into multiple requests. | |
virtual void | setCoherentValues (bool value) |
Set the flag setted to use coherent operations , i.e. don't split the command into multiple requests. | |
virtual Client * | client () |
Get the owner setted Client object. | |
virtual void | setClient (Client *value) |
Set the owner setted Client object. | |
virtual Connection * | connection () |
Get the Connection object. | |
virtual void | setConnection (Connection *value) |
Set the Connection object. | |
Protected Member Functions | |
void | synchronizeCompleted (uint64_t senderId, RLibCpp::Bcc::Globals::Results re) |
Private handler for the Connection::synchronizeCompleted(uint64_t , Globals::Results); event. | |
void | clearUserMonitors () |
Clears the BaseMonitorStruct::UserMonitorItem | |
void | clearDevices () |
Clear the BaseMonitorStruct::DeviceItem | |
void | addUserMonitor (BaseMonitorStruct::UserMonitorItem *item) |
Adds the item to the BaseMonitorStruct::UserMonitorItem list. | |
void | addDevice (BaseMonitorStruct::DeviceItem *item) |
Adds the item to the BaseMonitorStruct::DeviceItem list. | |
virtual Globals::Results | doPrepareRuntime (Client *client, bool coherentValues) |
Prepare the runtime device monitor definitions, i.e. splits the original user mnonitor into chuncks to fit the maximum BCC message data size and setup other the relevant properties. | |
Globals::Results | doSetupReadData (BaseMonitorStruct::BaseData &data) |
Setups the BaseMonitorStruct::DeviceMonitorItem::readSrcValues() and BaseMonitorStruct::DeviceMonitorItem::readSrcValuesOffset(); of the BaseMonitorStruct::DeviceItem to the data values storage. | |
Globals::Results | doParseReadData (BaseMonitorStruct::DeviceItem *deviceItem, ByteVector &rawData, uint32_t dataOff) |
Parses the rawData raw data buffer read from the devices and stores values into the deviceItem proper list (BaseMonitorStruct::DeviceMonitorItem::readSrcValues()) | |
Globals::Results | doParseReadData (BaseMonitorStruct::DeviceItem *deviceItem, const uint8_t *rawData, uint32_t rawDataSize, uint32_t dataOff) |
Parses the rawData raw data buffer read from the devices and stores values into the deviceItem proper list (BaseMonitorStruct::DeviceMonitorItem::readSrcValues()) | |
Globals::Results | doSetupWriteData (BaseMonitorStruct::BaseData &data) |
Setups the BaseMonitorStruct::DeviceMonitorItem::writeSrcValues() and BaseMonitorStruct::DeviceMonitorItem::writeSrcValuesOffset() of the BaseMonitorStruct::DeviceItem to the data values storage. | |
Globals::Results | doParseWriteData (ByteVector &data, uint32_t dataOff, BaseMonitorStruct::DeviceItem *deviceItem) |
Parses the deviceItem proper list (BaseMonitorStruct::DeviceMonitorItem::readSrcValues()) and stores the data into the rawData raw data buffer to be written to the device. | |
Globals::Results | doParseWriteData (uint8_t *rawData, uint32_t rawDataSize, uint32_t dataOff, BaseMonitorStruct::DeviceItem *deviceItem) |
Parses the deviceItem proper list (BaseMonitorStruct::DeviceMonitorItem::readSrcValues()) and stores the data into the rawData raw data buffer to be written to the device. | |
virtual Message::MsgCodes | createMsgCode ()=0 |
The message code used for read operations. | |
virtual ByteVector * | createMsgDataPrefix ()=0 |
The optional data to be prefixed in the read operations. | |
virtual Message::MsgCodes | writeMsgCode ()=0 |
The message code used for write operations. | |
virtual ByteVector * | writeMsgDataPrefix ()=0 |
The optional data to be prefixed in the write operations. | |
BaseMonitorStruct::DeviceItem::PtrVector & | deviceItems () |
Get the list of items to read, i.e. the list of BCC message sent to the device. | |
BaseMonitorStruct::UserMonitorItem::PtrVector & | items () |
Get the original user defined monitor items' list
| |
bool | dirty () const |
Get the dirty flag: when set, the internal data structures needs to be updated/recreated. | |
void | setDirty (bool value) |
Set the dirty flag: when set, the internal data structures needs to be updated/recreated. | |
bool | releasing () const |
Get the releasing flag: when set the monitor is about to be released from connection. | |
void | setReleasing (bool value) |
Set the releasing flag: when set the monitor is about to be released from connection. | |
Static Protected Attributes | |
static const int | MaxItemsPerMonitor = 25 |
The number of maximun variable definition for each device monitor. | |
Friends | |
class | Connection |
Abstract base class for monitors handling.
This class is not intended to be used directly from your code.
For internal use only.
This class provides the common functionality for monitors.
You cannot derive from this class.
BaseMonitor | ( | ) |
Class constructor.
|
virtual |
Class desstructor.
|
virtual |
Adds a variable to the monitor definition.
var | The variable to add |
Reimplemented in Monitor.
|
protected |
Adds the item to the BaseMonitorStruct::DeviceItem list.
item | The BaseMonitorStruct::DeviceItem to add |
|
protected |
Adds the item to the BaseMonitorStruct::UserMonitorItem list.
item | The BaseMonitorStruct::UserMonitorItem to add |
|
virtual |
Clears the monitor, i.e. removes all the defined variables etc.
Reimplemented in Monitor.
|
protected |
Clear the BaseMonitorStruct::DeviceItem
|
protected |
Clears the BaseMonitorStruct::UserMonitorItem
|
virtual |
Get the flag setted to use coherent operations , i.e. don't split the command into multiple requests.
|
virtual |
Get the flag to indicate if the monitor is connected to the device.
|
virtual |
Get the Connection object.
|
virtual |
Get the number of registered variables.
|
protectedpure virtual |
The message code used for read operations.
Implemented in Monitor.
|
protectedpure virtual |
The optional data to be prefixed in the read operations.
Implemented in Monitor.
|
protected |
Get the list of items to read, i.e. the list of BCC message sent to the device.
|
protected |
Get the dirty flag: when set, the internal data structures needs to be updated/recreated.
|
protected |
Parses the rawData raw data buffer read from the devices and stores values into the deviceItem proper list (BaseMonitorStruct::DeviceMonitorItem::readSrcValues())
deviceItem | The device item into which store the read data |
rawData | The raw data buffer read from the device |
dataOff | The starting offset related to rawData |
|
protected |
Parses the rawData raw data buffer read from the devices and stores values into the deviceItem proper list (BaseMonitorStruct::DeviceMonitorItem::readSrcValues())
deviceItem | The device item into which store the read data |
rawData | The raw data buffer read from the device |
rawDataSize | The raw data buffer size read from the device |
dataOff | The starting offset related to rawData |
|
protected |
Parses the deviceItem proper list (BaseMonitorStruct::DeviceMonitorItem::readSrcValues()) and stores the data into the rawData raw data buffer to be written to the device.
data | The raw data buffer to be written to the device |
dataOff | The starting offset related to data |
deviceItem | The device item from which retrive the data to be written |
|
protected |
Parses the deviceItem proper list (BaseMonitorStruct::DeviceMonitorItem::readSrcValues()) and stores the data into the rawData raw data buffer to be written to the device.
rawData | The raw data buffer to be written to the device |
rawDataSize | The raw data buffer size to be written to the device |
dataOff | The starting offset related to data |
deviceItem | The device item from which retrive the data to be written |
|
protectedvirtual |
Prepare the runtime device monitor definitions, i.e. splits the original user mnonitor into chuncks to fit the maximum BCC message data size and setup other the relevant properties.
client | The Bcc.Client to be used for comunicate to the device |
coherentValues | Flag to use coeherent values |
Reimplemented in Monitor.
|
protected |
Setups the BaseMonitorStruct::DeviceMonitorItem::readSrcValues() and BaseMonitorStruct::DeviceMonitorItem::readSrcValuesOffset(); of the BaseMonitorStruct::DeviceItem to the data values storage.
data | The object to which save the values read from the device |
|
protected |
Setups the BaseMonitorStruct::DeviceMonitorItem::writeSrcValues() and BaseMonitorStruct::DeviceMonitorItem::writeSrcValuesOffset() of the BaseMonitorStruct::DeviceItem to the data values storage.
data | The object from which retrive the values to be written to the device |
|
protected |
Get the original user defined monitor items' list
|
protected |
Get the releasing flag: when set the monitor is about to be released from connection.
|
virtual |
|
virtual |
Set the flag setted to use coherent operations , i.e. don't split the command into multiple requests.
value | The value to set |
Reimplemented in Monitor.
|
virtual |
|
protected |
Set the dirty flag: when set, the internal data structures needs to be updated/recreated.
value | The value to set |
|
protected |
Set the releasing flag: when set the monitor is about to be released from connection.
value | The value to set |
|
protected |
Private handler for the Connection::synchronizeCompleted(uint64_t , Globals::Results); event.
senderId | The event sender indentifier |
re | The opration result code |
|
protectedpure virtual |
The message code used for write operations.
Implemented in Monitor.
|
protectedpure virtual |
The optional data to be prefixed in the write operations.
Implemented in Monitor.
|
friend |
|
staticprotected |
The number of maximun variable definition for each device monitor.