RTC Toolkit  2.0.0
Public Member Functions | List of all members
rtctk::componentFramework::FilePersistentRepoAdapter Class Reference

Implements a file based Persistent Configuration Repository adapter that can be used for testing. More...

#include <filePersistentRepoAdapter.hpp>

Inheritance diagram for rtctk::componentFramework::FilePersistentRepoAdapter:
rtctk::componentFramework::FileRepository rtctk::componentFramework::PersistentRepoIf rtctk::componentFramework::RepositoryIf rtctk::componentFramework::RepositoryIf

Public Member Functions

 FilePersistentRepoAdapter ()=delete
 
 FilePersistentRepoAdapter (const FilePersistentRepoAdapter &)=delete
 
FilePersistentRepoAdapteroperator= (const FilePersistentRepoAdapter &)=delete
 
 FilePersistentRepoAdapter (FilePersistentRepoAdapter &&)=default
 
FilePersistentRepoAdapteroperator= (FilePersistentRepoAdapter &&)=default
 
 FilePersistentRepoAdapter (const elt::mal::Uri &datauri, const int dirdepth=1)
 Constructor to create a Persistent Configuration Repository adapter for a simple file based implementation. More...
 
virtual ~FilePersistentRepoAdapter ()
 
- Public Member Functions inherited from rtctk::componentFramework::FileRepository
 FileRepository ()=delete
 
 FileRepository (const FileRepository &)=delete
 
FileRepositoryoperator= (const FileRepository &)=delete
 
 FileRepository (const elt::mal::Uri &datauri, const int dirdepth)
 
virtual ~FileRepository () noexcept=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...
 
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< PathList, PathListGetChildren (const DataPointPath &path) const override
 Queries the datapoints and child paths for a given path. More...
 
Response SendReadRequest (const ReadRequest &request) const override
 Sends a request to read data from the repository. More...
 
Response SendWriteRequest (const WriteRequest &request) override
 Sends a request to write data to the repository. More...
 
size_t GetFitsWriteThreshold () const
 
void SetFitsWriteThreshold (size_t value)
 Sets the threshold for storing numerical matrices and vectors in FITS files rather than the YAML file. 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)
 
- Public Member Functions inherited from rtctk::componentFramework::RepositoryIf
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 >
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)
 
- Public Member Functions inherited from rtctk::componentFramework::PersistentRepoIf
virtual ~PersistentRepoIf ()=default
 

Additional Inherited Members

- Public Types inherited from rtctk::componentFramework::RepositoryIf
using PathList = std::vector< DataPointPath >
 
- 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. More...
 

Detailed Description

Implements a file based Persistent Configuration Repository adapter that can be used for testing.

Thread Safety
thread-safe – File based locking is used to make all read/write methods synchronous between all processes and threads, in addition to mutex locking to protect the structures of this class.

Constructor & Destructor Documentation

◆ FilePersistentRepoAdapter() [1/4]

rtctk::componentFramework::FilePersistentRepoAdapter::FilePersistentRepoAdapter ( )
delete

◆ FilePersistentRepoAdapter() [2/4]

rtctk::componentFramework::FilePersistentRepoAdapter::FilePersistentRepoAdapter ( const FilePersistentRepoAdapter )
delete

◆ FilePersistentRepoAdapter() [3/4]

rtctk::componentFramework::FilePersistentRepoAdapter::FilePersistentRepoAdapter ( FilePersistentRepoAdapter &&  )
default

◆ FilePersistentRepoAdapter() [4/4]

rtctk::componentFramework::FilePersistentRepoAdapter::FilePersistentRepoAdapter ( const elt::mal::Uri &  datauri,
const int  dirdepth = 1 
)
explicit

Constructor to create a Persistent Configuration Repository adapter for a simple file based implementation.

Parameters
[in]datauriMust be a file scheme URI with the path indicating the location of the repository YAML files.
[in]dirdepthIndicates how deep the directory structure should be. The default value is 1, which means the first component of a datapoint path is used as the name of the YAML file.

◆ ~FilePersistentRepoAdapter()

rtctk::componentFramework::FilePersistentRepoAdapter::~FilePersistentRepoAdapter ( )
virtual

Member Function Documentation

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

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