BAOS SDK  18.2.0
Public Member Functions | Static Public Member Functions | List of all members
kdrive::baos::DatapointDescriptionHolder Class Reference

Cache for Baos Datapoint Descriptions Holds BaosDatapointDescriptions so we don't have to continually read them from the remote device. More...

#include <BaosDatapointDescriptions.h>

Public Member Functions

 DatapointDescriptionHolder ()
 Creates a default DatapointDescriptionHolder. More...
 
 ~DatapointDescriptionHolder ()
 Destroys the DatapointDescriptionHolder. More...
 
BaosDatapointDescription get (std::shared_ptr< BaosConnector > connector, unsigned short id)
 Gets the description associated with the datapoint id. More...
 
void clear ()
 empties the cache for all devices More...
 
void clear (const std::shared_ptr< BaosConnector > connector)
 empties the cache for a given connector More...
 
void enable (bool enabled=true)
 enable/disable the caching mechanism by default the cache is enabled More...
 
void disable ()
 disable the cache, the description will always be read from the bus More...
 

Static Public Member Functions

static DatapointDescriptionHolderinstance ()
 

Detailed Description

Cache for Baos Datapoint Descriptions Holds BaosDatapointDescriptions so we don't have to continually read them from the remote device.

If a description is available it is returned, otherwise it is read from the device. Subsequence reads will return the description without reading from the device. This is a singleton class.

Constructor & Destructor Documentation

DatapointDescriptionHolder::DatapointDescriptionHolder ( )

Creates a default DatapointDescriptionHolder.

DatapointDescriptionHolder::~DatapointDescriptionHolder ( )

Member Function Documentation

void DatapointDescriptionHolder::clear ( )

empties the cache for all devices

void DatapointDescriptionHolder::clear ( const std::shared_ptr< BaosConnector connector)

empties the cache for a given connector

void DatapointDescriptionHolder::disable ( )

disable the cache, the description will always be read from the bus

void DatapointDescriptionHolder::enable ( bool  enabled = true)

enable/disable the caching mechanism by default the cache is enabled

BaosDatapointDescription DatapointDescriptionHolder::get ( std::shared_ptr< BaosConnector connector,
unsigned short  id 
)

Gets the description associated with the datapoint id.

Either locally from the cache, or remotely from the device if not in the cache

DatapointDescriptionHolder & DatapointDescriptionHolder::instance ( )
static
Returns
the single DatapointDescriptionHolder instance

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