RTC Toolkit
1.0.0
|
Implements the Persistent Configuration Repository adapter that uses the CII configuration service as the backend. More...
#include <persistentRepoAdapter.hpp>
Public Member Functions | |
PersistentRepoAdapter ()=delete | |
Do not allow construction with no arguments. More... | |
PersistentRepoAdapter (const PersistentRepoAdapter &)=delete | |
This class cannot be copy constructed. More... | |
PersistentRepoAdapter & | operator= (const PersistentRepoAdapter &)=delete |
This class cannot be copy assigned. More... | |
PersistentRepoAdapter (PersistentRepoAdapter &&)=default | |
Objects of this class can be moved. More... | |
PersistentRepoAdapter & | operator= (PersistentRepoAdapter &&)=default |
Objects of this class can be moved with the move assignment operator. More... | |
PersistentRepoAdapter (const elt::mal::Uri &datauri) | |
Constructs a Persistent Configuration Repository adapter backed by the CII configuration service. More... | |
virtual | ~PersistentRepoAdapter ()=default |
void | CreateDataPoint (const DataPointPath &path, const std::type_info &type) override |
Creates a new datapoint in the repository with a specified type. More... | |
void | DeleteDataPoint (const DataPointPath &path) override |
Deletes a datapoint. More... | |
const std::type_info & | GetDataPointType (const DataPointPath &path) const override |
Fetches the type of the datapoint. More... | |
std::size_t | GetDataPointSize (const DataPointPath &path) const override |
Fetches the size of the datapoint's data. More... | |
bool | DataPointExists (const DataPointPath &path) const override |
Checks for the existence of a datapoint in the repository. More... | |
std::pair< StringList, StringList > | GetChildren (const DataPointPath &path) const override |
Queries the datapoints and child paths for a given path. More... | |
Response | SendReadRequest (const Request &request) const override |
Sends a request to read data from the repository. More... | |
Response | SendWriteRequest (const Request &request) override |
Sends a request to write data to the repository. More... | |
virtual void | CreateDataPoint (const DataPointPath &path, const std::type_info &type)=0 |
Creates a new datapoint in the repository with a specified type. More... | |
template<typename T > | |
void | CreateDataPoint (const DataPointPath &path) |
Creates a new datapoint in the repository. More... | |
template<typename T > | |
void | CreateDataPoint (const DataPointPath &path, const T default_value) |
Creates a new datapoint in the repository and sets a default value. More... | |
template<> | |
void | CreateDataPoint (const DataPointPath &path, const char *default_value) |
![]() | |
virtual | ~PersistentRepoIf ()=default |
![]() | |
virtual | ~RepositoryIf () |
template<typename T > | |
void | CreateDataPoint (const DataPointPath &path) |
Creates a new datapoint in the repository. More... | |
template<typename T > | |
void | CreateDataPoint (const DataPointPath &path, const T default_value) |
Creates a new datapoint in the repository and sets a default value. More... | |
template<typename T > | |
T | GetDataPoint (const DataPointPath &path) const |
Fetches a datapoint from the repository. More... | |
template<typename T > | |
void | SetDataPoint (const DataPointPath &path, const T value) |
Sets a datapoint in the repository. More... | |
template<typename T > | |
void | ReadDataPoint (const DataPointPath &path, T &buffer) const |
Reads a datapoint from the repository. More... | |
template<typename T > | |
void | WriteDataPoint (const DataPointPath &path, const T &buffer) |
Writes a datapoint to the repository. More... | |
void | WriteDataPoint (const DataPointPath &path, const char *buffer) |
template<> | |
void | CreateDataPoint (const DataPointPath &path, const char *default_value) |
template<> | |
void | SetDataPoint (const DataPointPath &path, const char *value) |
Additional Inherited Members | |
![]() | |
using | StringList = std::vector< std::string > |
![]() | |
static std::unique_ptr< PersistentRepoIf > | CreateAdapter (const elt::mal::Uri &uri) |
Factory method used to create the appropriate Persistent Configuration Repository adapter depending on the URI scheme. More... | |
Implements the Persistent Configuration Repository adapter that uses the CII configuration service as the backend.
NotImplementedException
.
|
delete |
Do not allow construction with no arguments.
|
delete |
This class cannot be copy constructed.
|
default |
Objects of this class can be moved.
|
explicit |
Constructs a Persistent Configuration Repository adapter backed by the CII configuration service.
[in] | baseuri | The CII configuration service URI containing a base path where the datapoints are stored. The URI must use the cii.config scheme. |
|
virtualdefault |
void rtctk::componentFramework::RepositoryIf::CreateDataPoint | ( | typename T | ) |
Creates a new datapoint in the repository.
The type of the datapoint is derived from the template argument type.
[in] | path | The datapoint path that should be created. |
void rtctk::componentFramework::RepositoryIf::CreateDataPoint | ( | ) |
|
overridevirtual |
Creates a new datapoint in the repository with a specified type.
[in] | path | The datapoint path that should be created. |
[in] | type | A type identifier object returned by typeid indicating the type of the new datapoint. Supported values are indicated below. |
The following are the supported values for the type
argument:
Implements rtctk::componentFramework::RepositoryIf.
virtual void rtctk::componentFramework::RepositoryIf::CreateDataPoint |
Creates a new datapoint in the repository with a specified type.
[in] | path | The datapoint path that should be created. |
[in] | type | A type identifier object returned by typeid indicating the type of the new datapoint. Supported values are indicated below. |
The following are the supported values for the type
argument:
void rtctk::componentFramework::RepositoryIf::CreateDataPoint | ( | typename T | ) |
Creates a new datapoint in the repository and sets a default value.
The type of the datapoint is derived from the template argument type.
[in] | path | The datapoint path that should be created. |
[in] | default_value | The default value that should be set for the new datapoint. |
|
overridevirtual |
Checks for the existence of a datapoint in the repository.
[in] | path | The datapoint path to check. |
true
if the datapoint path exists in the repository and false
otherwise.Implements rtctk::componentFramework::RepositoryIf.
|
overridevirtual |
Deletes a datapoint.
[in] | path | The path of the datapoint to delete in the repository. |
Implements rtctk::componentFramework::RepositoryIf.
|
overridevirtual |
Queries the datapoints and child paths for a given path.
This method will query all the available datapoints that are leaf nodes immediately below the given path
and also the child paths, i.e. sub-folders when interpreting the repository as a hierarchical folder like structure. The set of immediate datapoint and child paths is returned as two separate lists.
If an error occurs when querying the the repository a rtctk::componentFramework::RtctkException
is thrown.
[in] | path | The path in which to search for datapoints and child paths. |
std::pair
of string lists, i.e. std::vector<std::string>
, with the first list in the pair containing the datapoints found and the second list containing the child paths found. If no datapoints are found then the list for datapoints is empty. Similarly if not child paths are found then the child path list is empty.Implements rtctk::componentFramework::RepositoryIf.
|
overridevirtual |
Fetches the size of the datapoint's data.
This method will return one of the following values depending on the category of the datapoint's type:
1
for scalars such as RtcBool
, RtcInt32
, RtcInt64
, RtcFloat
, and RtcDouble
. Implements rtctk::componentFramework::RepositoryIf.
|
overridevirtual |
Fetches the type of the datapoint.
This will return the type used when the datapoint was created with the CreateDataPoint method.
type_info
object corresponding to the type of the datapoint.Implements rtctk::componentFramework::RepositoryIf.
|
delete |
This class cannot be copy assigned.
|
default |
Objects of this class can be moved with the move assignment operator.
|
overridevirtual |
Sends a request to read data from the repository.
This method allows non-blocking and asynchronous reading of datapoints form the repository. The method returns immediately, allowing other work to be done in the calling thread while the read request is completed in the background. If any callback handlers were registered in request
, they will be called as soon as the data is available for the respective datapoint.
request
must not be accessed until the Wait
method of the response object returns successfully, i.e. without a timeout.If an error occurs then a rtctk::componentFramework::RtctkException
is thrown.
[in] | request | The request object that contains all the datapoints to read. |
Implements rtctk::componentFramework::RepositoryIf.
|
overridevirtual |
Sends a request to write data to the repository.
This method allows non-blocking writing of datapoints to the repository. The method returns immediately, allowing other work to be done in the calling thread while the write request is completed in the background. If any callback handlers were registered in request
, they will be called as soon as the respective datapoint's data has been sent and the buffer will no longer be accessed by the API, i.e. the caller can modify or release the buffer from that point on.
request
must not be modified or released until the Wait
method of the response object returns successfully, i.e. without a timeout.If an error occurs then a rtctk::componentFramework::RtctkException
is thrown.
[in] | request | The request object that contains all the datapoints to write. |
Implements rtctk::componentFramework::RepositoryIf.