RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
rtctk::componentFramework::RepositoryIf::BatchRequest Class Reference

An object representing one or more asynchronous I/O requests to a repository. More...

#include <rtctk/componentFramework/repositoryIf.hpp>

Inheritance diagram for rtctk::componentFramework::RepositoryIf::BatchRequest:
rtctk::componentFramework::RepositorySubscriberIf::BatchRequest

Public Member Functions

virtual ~BatchRequest ()=default
 
template<typename T >
void CreateDataPoint (const DataPointPath &path, const T &initial_value, std::optional< std::reference_wrapper< const MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr)
 Add a request to create a new datapoint.
 
template<typename T >
void CreateDataPoint (const DataPointPath &path, const T &&initial_value, std::optional< std::reference_wrapper< const MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr)=delete
 Creation of datapoints from an rvalue reference is not allowed.
 
void DeleteDataPoint (const DataPointPath &path, const CallbackType &callback=nullptr)
 
void DataPointExists (const DataPointPath &path, bool &result, const CallbackType &callback=nullptr) const
 
void GetChildren (const DataPointPath &path, std::pair< PathList, PathList > &result, bool recurse=false, const CallbackType &callback=nullptr) const
 Add request to query the child datapoints and paths for a given parent path.
 
void GetChildren (const DataPointPath &path, std::pair< PathList, PathList > &&result, bool recurse=false, const CallbackType &callback=nullptr) const =delete
 Querying children with an rvalue reference for the result is not allowed.
 
template<typename T >
void ReadDataPoint (const DataPointPath &path, T &buffer, std::optional< std::reference_wrapper< MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr) const
 
template<typename T >
void ReadDataPoint (const DataPointPath &path, T &&buffer, std::optional< std::reference_wrapper< MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr) const =delete
 Reading from a datapoint into an rvalue reference is not allowed.
 
template<typename T >
void WriteDataPoint (const DataPointPath &path, const T &buffer, std::optional< std::reference_wrapper< const MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr)
 
template<typename T >
void WriteDataPoint (const DataPointPath &path, const T &&buffer, std::optional< std::reference_wrapper< const MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr)=delete
 Writing to a datapoint from an rvalue reference is not allowed.
 
template<typename T >
void PartialReadDataPoint (const DataPointPath &path, T &buffer, size_t first, size_t last, size_t d_first, std::optional< std::reference_wrapper< MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr) const
 Add request to partially read a datapoint.
 
template<typename T >
void PartialReadDataPoint (const DataPointPath &path, T &&buffer, size_t first, size_t last, size_t d_first, std::optional< std::reference_wrapper< MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr) const =delete
 Reading from a datapoint into an rvalue reference is not allowed.
 
template<typename T >
void PartialWriteDataPoint (const DataPointPath &path, const T &buffer, size_t first, size_t last, size_t d_first, std::optional< std::reference_wrapper< const MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr)
 
template<typename T >
void PartialWriteDataPoint (const DataPointPath &path, const T &&buffer, size_t first, size_t last, size_t d_first, std::optional< std::reference_wrapper< const MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr)=delete
 Writing to a datapoint from an rvalue reference is not allowed.
 
void ReadMetaData (const DataPointPath &path, MetaData &metadata, const CallbackType &callback=nullptr) const
 
void ReadMetaData (const DataPointPath &path, MetaData &&metadata, const CallbackType &callback=nullptr) const =delete
 Reading metadata into an rvalue reference is not allowed.
 
void WriteMetaData (const DataPointPath &path, const MetaData &metadata, const CallbackType &callback=nullptr)
 
void CreateSymlink (const DataPointPath &dp, const DataPointPath &link, const CallbackType &callback=nullptr)
 
void UpdateSymlink (const DataPointPath &dp, const DataPointPath &link, const CallbackType &callback=nullptr)
 

Protected Attributes

friend RepositoryIf
 
RequestList m_requests
 

Detailed Description

An object representing one or more asynchronous I/O requests to a repository.

Thread Safety
thread-compatible

Constructor & Destructor Documentation

◆ ~BatchRequest()

virtual rtctk::componentFramework::RepositoryIf::BatchRequest::~BatchRequest ( )
virtualdefault

Member Function Documentation

◆ CreateDataPoint() [1/2]

template<typename T >
void rtctk::componentFramework::RepositoryIf::BatchRequest::CreateDataPoint ( const DataPointPath & path,
const T && initial_value,
std::optional< std::reference_wrapper< const MetaData > > metadata = std::nullopt,
const CallbackType & callback = nullptr )
delete

Creation of datapoints from an rvalue reference is not allowed.

◆ CreateDataPoint() [2/2]

template<typename T >
void rtctk::componentFramework::RepositoryIf::BatchRequest::CreateDataPoint ( const DataPointPath & path,
const T & initial_value,
std::optional< std::reference_wrapper< const MetaData > > metadata = std::nullopt,
const CallbackType & callback = nullptr )

Add a request to create a new datapoint.

This method will add an asynchronous request to the batch request to create a new datapoint in the repository with the given path and initial value. Actual creation of the datapoint will happen once the batch request is submitted to the repository adapter with SendRequest.

Parameters
[in]pathThe path of the new datapoint.
[in]initial_valueInitial value of the new datapoint.
[in]metadataOptional additional metadata to set for the new datapoint.
[in]callbackOptional callback that will be invoked on completion of the request.
Asynchronous Exceptions
The following exceptions are not immediately thrown by this method. They are possibly thrown later by: when completing the repository request.
DataPointAlreadyExistsIf the datapoint with the given path already exists in the repository.
ServiceFailureWhen the underlying back-end system indicates an unexpected failure.
Thread Safety
thread-compatible
Exception Safety
strong

◆ CreateSymlink()

void rtctk::componentFramework::RepositoryIf::BatchRequest::CreateSymlink ( const DataPointPath & dp,
const DataPointPath & link,
const CallbackType & callback = nullptr )

◆ DataPointExists()

void rtctk::componentFramework::RepositoryIf::BatchRequest::DataPointExists ( const DataPointPath & path,
bool & result,
const CallbackType & callback = nullptr ) const

◆ DeleteDataPoint()

void rtctk::componentFramework::RepositoryIf::BatchRequest::DeleteDataPoint ( const DataPointPath & path,
const CallbackType & callback = nullptr )

◆ GetChildren() [1/2]

void rtctk::componentFramework::RepositoryIf::BatchRequest::GetChildren ( const DataPointPath & path,
std::pair< PathList, PathList > && result,
bool recurse = false,
const CallbackType & callback = nullptr ) const
delete

Querying children with an rvalue reference for the result is not allowed.

◆ GetChildren() [2/2]

void rtctk::componentFramework::RepositoryIf::BatchRequest::GetChildren ( const DataPointPath & path,
std::pair< PathList, PathList > & result,
bool recurse = false,
const CallbackType & callback = nullptr ) const

Add request to query the child datapoints and paths for a given parent path.

This method will add an asynchronous request to the batch request to query all the available datapoints that are leaf nodes immediately below the given path and also the non-leaf child paths, i.e. sub-folders when interpreting the repository as a hierarchical folder like structure.

The set of datapoint and child paths is returned by filling the path lists in result. If recurse is false then only the immediate children are returned. Otherwise all datapoint and child sub-folder paths are returned recursively in result.

Parameters
[in]pathThe path in which to search for datapoints and child paths.
[out]resultA std::pair of path lists. The first list in the pair will be filled with the datapoints found and the second list will be filled with the child paths found. If no datapoints are found then the list for datapoints will be empty. Similarly if not child paths are found then the child path list will be empty.
[in]recurseOptional flag indicating if paths should be queried recursively.
[in]callbackOptional callback that will be invoked on completion of the request.
Asynchronous Exceptions
The following exceptions are not immediately thrown by this method. They are possibly thrown later by: when completing the repository request.
DataPointDoesNotExistIf the path does not exist in the repository.
ServiceFailureWhen the underlying back-end system indicates an unexpected failure.
Thread Safety
thread-compatible
Exception Safety
strong

◆ PartialReadDataPoint() [1/2]

template<typename T >
void rtctk::componentFramework::RepositoryIf::BatchRequest::PartialReadDataPoint ( const DataPointPath & path,
T && buffer,
size_t first,
size_t last,
size_t d_first,
std::optional< std::reference_wrapper< MetaData > > metadata = std::nullopt,
const CallbackType & callback = nullptr ) const
delete

Reading from a datapoint into an rvalue reference is not allowed.

◆ PartialReadDataPoint() [2/2]

template<typename T >
void rtctk::componentFramework::RepositoryIf::BatchRequest::PartialReadDataPoint ( const DataPointPath & path,
T & buffer,
size_t first,
size_t last,
size_t d_first,
std::optional< std::reference_wrapper< MetaData > > metadata = std::nullopt,
const CallbackType & callback = nullptr ) const

Add request to partially read a datapoint.

This method will add an asynchronous request to the batch request to partially read out the contents of a datapoint with the given path. The data will be read from the index first, i.e. the index of the first element, up to index last of the datapoint's data. For this purpose the datapoint's data is interpreted as a continuous array of elements, and it is the user's responsibility to correctly calculate these indices. The data is written to the indicated output buffer, starting from the index d_first. The output buffer is similarly interpreted as a continuous array for this purpose.

Warning
The user is responsible for sizing/resizing the output buffer that receives the data read from the datapoint. If the output buffer is too small a BufferTooSmall exception is thrown.
Parameters
[in]pathThe path of the datapoint to read.
[out]bufferThe output buffer object that will be filled with the data read.
[in]firstThe index of the first element to read from the datapoint.
[in]lastThe index of the last element to read from the datapoint.
[in]d_firstThe index into the output buffer where the first data element should be written.
[out]metadataOptional metadata that will be filled with the datapoint's metadata.
[in]callbackOptional callback that will be invoked on completion of the request.
Asynchronous Exceptions
The following exceptions are not immediately thrown by this method. They are possibly thrown later by: when completing the repository request.
DataPointDoesNotExistIf the path does not exist in the repository.
BufferTooSmallIf the output buffer is not big enough.
AccessOutOfBoundsIf the output buffer is not big enough.
ServiceFailureWhen the underlying back-end system indicates an unexpected failure.
Thread Safety
thread-compatible
Exception Safety
strong

◆ PartialWriteDataPoint() [1/2]

template<typename T >
void rtctk::componentFramework::RepositoryIf::BatchRequest::PartialWriteDataPoint ( const DataPointPath & path,
const T && buffer,
size_t first,
size_t last,
size_t d_first,
std::optional< std::reference_wrapper< const MetaData > > metadata = std::nullopt,
const CallbackType & callback = nullptr )
delete

Writing to a datapoint from an rvalue reference is not allowed.

◆ PartialWriteDataPoint() [2/2]

template<typename T >
void rtctk::componentFramework::RepositoryIf::BatchRequest::PartialWriteDataPoint ( const DataPointPath & path,
const T & buffer,
size_t first,
size_t last,
size_t d_first,
std::optional< std::reference_wrapper< const MetaData > > metadata = std::nullopt,
const CallbackType & callback = nullptr )

◆ ReadDataPoint() [1/2]

template<typename T >
void rtctk::componentFramework::RepositoryIf::BatchRequest::ReadDataPoint ( const DataPointPath & path,
T && buffer,
std::optional< std::reference_wrapper< MetaData > > metadata = std::nullopt,
const CallbackType & callback = nullptr ) const
delete

Reading from a datapoint into an rvalue reference is not allowed.

◆ ReadDataPoint() [2/2]

template<typename T >
void rtctk::componentFramework::RepositoryIf::BatchRequest::ReadDataPoint ( const DataPointPath & path,
T & buffer,
std::optional< std::reference_wrapper< MetaData > > metadata = std::nullopt,
const CallbackType & callback = nullptr ) const

◆ ReadMetaData() [1/2]

void rtctk::componentFramework::RepositoryIf::BatchRequest::ReadMetaData ( const DataPointPath & path,
MetaData && metadata,
const CallbackType & callback = nullptr ) const
delete

Reading metadata into an rvalue reference is not allowed.

◆ ReadMetaData() [2/2]

void rtctk::componentFramework::RepositoryIf::BatchRequest::ReadMetaData ( const DataPointPath & path,
MetaData & metadata,
const CallbackType & callback = nullptr ) const

◆ UpdateSymlink()

void rtctk::componentFramework::RepositoryIf::BatchRequest::UpdateSymlink ( const DataPointPath & dp,
const DataPointPath & link,
const CallbackType & callback = nullptr )

◆ WriteDataPoint() [1/2]

template<typename T >
void rtctk::componentFramework::RepositoryIf::BatchRequest::WriteDataPoint ( const DataPointPath & path,
const T && buffer,
std::optional< std::reference_wrapper< const MetaData > > metadata = std::nullopt,
const CallbackType & callback = nullptr )
delete

Writing to a datapoint from an rvalue reference is not allowed.

◆ WriteDataPoint() [2/2]

template<typename T >
void rtctk::componentFramework::RepositoryIf::BatchRequest::WriteDataPoint ( const DataPointPath & path,
const T & buffer,
std::optional< std::reference_wrapper< const MetaData > > metadata = std::nullopt,
const CallbackType & callback = nullptr )

◆ WriteMetaData()

void rtctk::componentFramework::RepositoryIf::BatchRequest::WriteMetaData ( const DataPointPath & path,
const MetaData & metadata,
const CallbackType & callback = nullptr )

Member Data Documentation

◆ m_requests

RequestList rtctk::componentFramework::RepositoryIf::BatchRequest::m_requests
mutableprotected

◆ RepositoryIf

friend rtctk::componentFramework::RepositoryIf::BatchRequest::RepositoryIf
protected

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