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

Implements the Persistent Configuration Repository adapter that uses the CII configuration service as the backend. More...

#include <rtctk/componentFramework/persistentRepoAdapter.hpp>

Inheritance diagram for rtctk::componentFramework::PersistentRepoAdapter:
rtctk::componentFramework::PersistentRepoIf rtctk::componentFramework::RepositoryIf

Classes

class  InvalidDocumentException
 Exception indicating that validation checks of a CII configuration document failed. More...
 
class  PathMissingException
 Exception indicating a datapoint path does not exist. More...
 
class  ServiceFailureException
 Exception indicating a general CII configuration service error. More...
 

Public Member Functions

 PersistentRepoAdapter ()=delete
 Do not allow construction with no arguments.
 
 PersistentRepoAdapter (const PersistentRepoAdapter &)=delete
 This class cannot be copy constructed.
 
PersistentRepoAdapteroperator= (const PersistentRepoAdapter &)=delete
 This class cannot be copy assigned.
 
 PersistentRepoAdapter (PersistentRepoAdapter &&)=default
 Objects of this class can be moved.
 
PersistentRepoAdapteroperator= (PersistentRepoAdapter &&)=default
 Objects of this class can be moved with the move assignment operator.
 
 PersistentRepoAdapter (const elt::mal::Uri &baseuri, bool simple_layout=false)
 Constructs a Persistent Configuration Repository adapter backed by the CII configuration service.
 
elt::mal::Uri GetBaseUri () const
 Get the base URI used when creating this adapter object.
 
virtual ~PersistentRepoAdapter ()=default
 
uint64_t GetFitsWriteThreshold () const
 Return the number of elements above which matrices and vectors are written to FITS files.
 
void SetFitsWriteThreshold (uint64_t value)
 Set the number of elements above which matrices and vectors are written to FITS files.
 
template<typename T >
Lut::TableEntries BindTypeHandlers ()
 
- Public Member Functions inherited from rtctk::componentFramework::PersistentRepoIf
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 Attributes

static const std::string SUPPORTED_URI_SCHEME = "cii.config"
 

Additional Inherited Members

- Public Types inherited from rtctk::componentFramework::PersistentRepoIf
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.
 
- Static Public Member Functions inherited from rtctk::componentFramework::PersistentRepoIf
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.
 
- Protected Types inherited from rtctk::componentFramework::RepositoryIf
using RequestList = std::vector<std::any>
 
- Protected Member Functions inherited from rtctk::componentFramework::RepositoryIf
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

Implements the Persistent Configuration Repository adapter that uses the CII configuration service as the backend.

This class provides support for the cii.config:// URI scheme.

Note
This adapter implementation currently only supports local as the hostname part of the URI, e.g. cii.config://local.
Warning
Multiple threads in the same process can access the same instance of this object without race conditions. However, the underlying CII configuration service itself does not implement any locking mechanism itself. Therefore, there is no protection for concurrent access to the Persistent Configuration Repository from different processes.
Thread Safety
thread-safe

Constructor & Destructor Documentation

◆ PersistentRepoAdapter() [1/4]

rtctk::componentFramework::PersistentRepoAdapter::PersistentRepoAdapter ( )
delete

Do not allow construction with no arguments.

◆ PersistentRepoAdapter() [2/4]

rtctk::componentFramework::PersistentRepoAdapter::PersistentRepoAdapter ( const PersistentRepoAdapter & )
delete

This class cannot be copy constructed.

◆ PersistentRepoAdapter() [3/4]

rtctk::componentFramework::PersistentRepoAdapter::PersistentRepoAdapter ( PersistentRepoAdapter && )
default

Objects of this class can be moved.

◆ PersistentRepoAdapter() [4/4]

rtctk::componentFramework::PersistentRepoAdapter::PersistentRepoAdapter ( const elt::mal::Uri & baseuri,
bool simple_layout = false )
explicit

Constructs a Persistent Configuration Repository adapter backed by the CII configuration service.

Parameters
[in]baseuriThe CII configuration service URI containing a base path where the datapoints are stored. The URI must use the cii.config scheme.
[in]simple_layoutFlag indicating if a simple layout should be used, i.e. having all datapoints placed into YAML files in one directory. By default the value is false, meaning the directory structure takes deployment sets into account.

◆ ~PersistentRepoAdapter()

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

Member Function Documentation

◆ BindTypeHandlers()

template<typename T >
Lut::TableEntries rtctk::componentFramework::PersistentRepoAdapter::BindTypeHandlers ( )

◆ GetBaseUri()

elt::mal::Uri rtctk::componentFramework::PersistentRepoAdapter::GetBaseUri ( ) const
inline

Get the base URI used when creating this adapter object.

Returns
elt::mal::Uri object indicating the base URI.
Thread Safety
thread-safe
Exception Safety
strong

◆ GetFitsWriteThreshold()

uint64_t rtctk::componentFramework::PersistentRepoAdapter::GetFitsWriteThreshold ( ) const
inline

Return the number of elements above which matrices and vectors are written to FITS files.

Returns
The current threshold value.

◆ operator=() [1/2]

PersistentRepoAdapter & rtctk::componentFramework::PersistentRepoAdapter::operator= ( const PersistentRepoAdapter & )
delete

This class cannot be copy assigned.

◆ operator=() [2/2]

PersistentRepoAdapter & rtctk::componentFramework::PersistentRepoAdapter::operator= ( PersistentRepoAdapter && )
default

Objects of this class can be moved with the move assignment operator.

◆ SetFitsWriteThreshold()

void rtctk::componentFramework::PersistentRepoAdapter::SetFitsWriteThreshold ( uint64_t value)
inline

Set the number of elements above which matrices and vectors are written to FITS files.

Parameters
valueThe new threshold value.

Member Data Documentation

◆ SUPPORTED_URI_SCHEME

const std::string rtctk::componentFramework::PersistentRepoAdapter::SUPPORTED_URI_SCHEME = "cii.config"
inlinestatic

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