RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
rtctk::componentFramework::PersistentRepoIf Class Reference

Base interface for all Persistent Configuration Repository adapters. More...

#include <rtctk/componentFramework/persistentRepoIf.hpp>

Inheritance diagram for rtctk::componentFramework::PersistentRepoIf:
rtctk::componentFramework::RepositoryIf rtctk::componentFramework::PersistentRepoAdapter rtctk::componentFramework::test::FakePersistentRepoIf rtctk::componentFramework::test::MockPersistentRepoIf

Public Types

using AdapterIdType = elt::mal::Uri
 The type used to distinguish between different adapters implementing RuntimeRepoIf.
 
- Public Types inherited from rtctk::componentFramework::RepositoryIf
using PathList = std::vector<DataPointPath>
 
using Clock = taiclock::TaiClock
 
using Timestamp = Clock::time_point
 
using CallbackType = std::function<void(const DataPointPath&)>
 Signature of the callback functions that can be registered with the repository requests.
 

Public Member Functions

virtual ~PersistentRepoIf ()=default
 
- Public Member Functions inherited from rtctk::componentFramework::RepositoryIf
 RepositoryIf ()=default
 
virtual ~RepositoryIf ()=default
 
BatchResponse SendRequest (const BatchRequest &request)
 
BatchResponse SendRequest (const BatchRequest &request) const
 
template<typename T >
void CreateDataPoint (const DataPointPath &path)
 Creates a new datapoint in the repository.
 
template<typename T >
void CreateDataPoint (const DataPointPath &path, const T &initial_value)
 Creates a new datapoint in the repository with an initial value.
 
void CreateDataPoint (const DataPointPath &path, const char *initial_value)
 
void DeleteDataPoint (const DataPointPath &path, bool recurse=false)
 Deletes a datapoint.
 
const std::type_info & GetDataPointType (const DataPointPath &path) const
 Fetches the type of the datapoint.
 
size_t GetDataPointSize (const DataPointPath &path) const
 Fetches the size of the datapoint's data.
 
RtcVectorUInt64 GetDataPointShape (const DataPointPath &path) const
 Fetches the shape of the datapoint's data.
 
bool DataPointExists (const DataPointPath &path) const
 Checks for the existence of a datapoint in the repository.
 
std::pair< PathList, PathListGetChildren (const DataPointPath &path, bool recurse=false) const
 Queries the child datapoints and paths for a given parent path.
 
template<typename T >
GetDataPoint (const DataPointPath &path) const
 Fetches a datapoint from the repository.
 
template<typename T >
void SetDataPoint (const DataPointPath &path, const T &value)
 Sets a datapoint in the repository.
 
void SetDataPoint (const DataPointPath &path, const char *value)
 
template<typename T >
void ReadDataPoint (const DataPointPath &path, T &buffer) const
 Reads a datapoint from the repository.
 
template<typename T >
void WriteDataPoint (const DataPointPath &path, const T &buffer)
 Writes a datapoint to the repository.
 
void WriteDataPoint (const DataPointPath &path, const char *buffer)
 
template<typename... T>
void WriteDataPoints (const T &... args)
 
template<typename... T>
void ReadDataPoints (T &... args) const
 
virtual void CreateDataPoint (const DataPointPath &path, const std::type_info &type)
 Creates a new datapoint in the repository with a specified type.
 
virtual Response SendReadRequest (const ReadRequest &request) const
 Sends a request to read data from the repository.
 
virtual Response SendWriteRequest (const WriteRequest &request)
 Sends a request to write data to the repository.
 

Static Public Member Functions

static std::unique_ptr< PersistentRepoIfCreateAdapter (const elt::mal::Uri &uri)
 Factory method used to create the appropriate Persistent Configuration Repository adapter depending on the URI scheme.
 
- Static Public Member Functions inherited from rtctk::componentFramework::RepositoryIf
static const std::type_info & StringToType (const std::string &arg)
 Converts an RTC type string to a type_info.
 
static std::string TypeToString (const std::type_info &arg)
 Converts a type_info to an RTC type string.
 

Additional Inherited Members

- Protected Types inherited from rtctk::componentFramework::RepositoryIf
using RequestList = std::vector<std::any>
 
- Protected Member Functions inherited from rtctk::componentFramework::RepositoryIf
virtual BatchResponse ProcessRequests (const RequestList &requests)=0
 
virtual void DeleteDataPointLegacy (const DataPointPath &path)
 Deletes a datapoint.
 
virtual const std::type_info & GetDataPointTypeLegacy (const DataPointPath &path) const
 Fetches the type of the datapoint.
 
virtual size_t GetDataPointSizeLegacy (const DataPointPath &path) const
 Fetches the size of the datapoint's data.
 
virtual bool DataPointExistsLegacy (const DataPointPath &path) const
 Checks for the existence of a datapoint in the repository.
 
virtual std::pair< PathList, PathListGetChildrenLegacy (const DataPointPath &path) const
 Queries the datapoints and child paths for a given path.
 

Detailed Description

Base interface for all Persistent Configuration Repository adapters.

Member Typedef Documentation

◆ AdapterIdType

The type used to distinguish between different adapters implementing RuntimeRepoIf.

This is used to specialise the FactoryRegistry to make it suitable for adapter factories discriminated using a URI to select different backend implementations of the repository service.

Constructor & Destructor Documentation

◆ ~PersistentRepoIf()

virtual rtctk::componentFramework::PersistentRepoIf::~PersistentRepoIf ( )
virtualdefault

Member Function Documentation

◆ CreateAdapter()

std::unique_ptr< PersistentRepoIf > rtctk::componentFramework::PersistentRepoIf::CreateAdapter ( const elt::mal::Uri & uri)
static

Factory method used to create the appropriate Persistent Configuration Repository adapter depending on the URI scheme.

The URI schemes supported by the factory method include the following:

  • cii.config - Will create an instance of PersistentRepoAdapter, which is backed by the CII configuration service.
Parameters
[in]uriThe URI of the repository that needs to be accessed.
Returns
A unique pointer to the newly created adapter object. The caller must clean the object up once it is no longer needed.
Exceptions
UnsupportedUriExceptionIf the URI is not supported.
AdapterCreationExceptionIf the factory failed to create a new instance. This will contain nested exceptions caught from the adapter class constructor.
Thread Safety
thread-safe
Exception Safety
basic

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