RTC Toolkit 6.0.0-pre2
Loading...
Searching...
No Matches
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)
 
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
 
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< MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr)
 
template<typename T>
void WriteDataPoint (const DataPointPath &path, const T &&buffer, std::optional< std::reference_wrapper< 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
 
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< 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< 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)
 
template<>
void CreateDataPoint (const DataPointPath &path, const std::any &initial_value, std::optional< std::reference_wrapper< const MetaData > > metadata, const CallbackType &callback)
 
template<>
void ReadDataPointImpl (const DataPointPath &path, std::any &buffer, std::optional< std::reference_wrapper< MetaData > > metadata, const CallbackType &callback) const
 
template<>
void WriteDataPoint (const DataPointPath &path, const std::any &buffer, std::optional< std::reference_wrapper< MetaData > > metadata, const CallbackType &callback)
 
template<>
void PartialReadDataPointImpl (const DataPointPath &path, std::any &buffer, size_t first, size_t last, size_t d_first, std::optional< std::reference_wrapper< MetaData > > metadata, const CallbackType &callback) const
 
template<>
void PartialWriteDataPoint (const DataPointPath &path, const std::any &buffer, size_t first, size_t last, size_t d_first, std::optional< std::reference_wrapper< MetaData > > metadata, const CallbackType &callback)
 

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/3]

void rtctk::componentFramework::RepositoryIf::BatchRequest::CreateDataPoint ( const DataPointPath & path,
const std::any & initial_value,
std::optional< std::reference_wrapper< const MetaData > > metadata,
const CallbackType & callback )

◆ CreateDataPoint() [2/3]

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() [3/3]

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 )
      @brief 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 @p path and initial value.
      Actual creation of the datapoint will happen once the batch request is submitted to the
      repository adapter with SendRequest.

      @param[in] path The path of the new datapoint.
      @param[in] initial_value Initial value of the new datapoint.
      @param[in] metadata Optional additional metadata to set for the new datapoint.
      @param[in] callback Optional callback that will be invoked on completion of the request.

      \par Asynchronous Exceptions
 \parblock  The following exceptions are <b>not</b> immediately thrown by this method. They are possibly thrown later by:<ul><li>BatchResponse::Wait</li><li> BatchResponse::WaitFor</li></ul>
 when completing the repository request.
 <table class="exception">

DataPointAlreadyExists

If the datapoint with the given path already exists in the repository.

ServiceFailure

When the underlying back-end system indicates an unexpected failure.

      \par Thread Safety
 \parblock \ref thread-safety "thread-compatible" \endparblock
      \par Exception Safety
 \parblock \ref exception-safety "strong" \endparblock

◆ 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
      @brief 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 @p 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 @p result.
      If @p recurse is @c false then only the immediate children are returned.
      Otherwise all datapoint and child sub-folder paths are returned recursively in @p result.

      @param[in] path The path in which to search for datapoints and child paths.
      @param[out] result A @c 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.
      @param[in] recurse Optional flag indicating if paths should be queried recursively.
      @param[in] callback Optional callback that will be invoked on completion of the request.

      \par Asynchronous Exceptions
 \parblock  The following exceptions are <b>not</b> immediately thrown by this method. They are possibly thrown later by:<ul><li>BatchResponse::Wait</li><li> BatchResponse::WaitFor</li></ul>
 when completing the repository request.
 <table class="exception">

DataPointDoesNotExist

If the path does not exist in the repository.

ServiceFailure

When the underlying back-end system indicates an unexpected failure.

      \par Thread Safety
 \parblock \ref thread-safety "thread-compatible" \endparblock
      \par Exception Safety
 \parblock \ref exception-safety "strong" \endparblock

◆ 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
      @brief 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 @p path. The data will be read from the index
      @p first, i.e. the index of the first element, up to index @p 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 @p 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.

      @param[in] path The path of the datapoint to read.
      @param[out] buffer The output buffer object that will be filled with the data read.
      @param[in] first The index of the first element to read from the datapoint.
      @param[in] last The index of the last element to read from the datapoint.
      @param[in] d_first The index into the output buffer where the first data element should
           be written.
      @param[out] metadata Optional metadata that will be filled with the datapoint's metadata.
      @param[in] callback Optional callback that will be invoked on completion of the request.

      \par Asynchronous Exceptions
 \parblock  The following exceptions are <b>not</b> immediately thrown by this method. They are possibly thrown later by:<ul><li>BatchResponse::Wait</li><li> BatchResponse::WaitFor</li></ul>
 when completing the repository request.
 <table class="exception">

DataPointDoesNotExist

If the path does not exist in the repository.

BufferTooSmall

If the output buffer is not big enough.

AccessOutOfBounds

If the output buffer is not big enough.

ServiceFailure

When the underlying back-end system indicates an unexpected failure.

      \par Thread Safety
 \parblock \ref thread-safety "thread-compatible" \endparblock
      \par Exception Safety
 \parblock \ref exception-safety "strong" \endparblock

◆ PartialReadDataPointImpl()

void rtctk::componentFramework::RepositoryIf::BatchRequest::PartialReadDataPointImpl ( const DataPointPath & path,
std::any & buffer,
size_t first,
size_t last,
size_t d_first,
std::optional< std::reference_wrapper< MetaData > > metadata,
const CallbackType & callback ) const

◆ PartialWriteDataPoint() [1/3]

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

◆ PartialWriteDataPoint() [2/3]

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< MetaData > > metadata = std::nullopt,
const CallbackType & callback = nullptr )
delete

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

◆ PartialWriteDataPoint() [3/3]

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< MetaData > > metadata = std::nullopt,
const CallbackType & callback = nullptr )
      @brief Add request to partially write a datapoint.

      This method will add an asynchronous request to the batch request to partially write
      a datapoint with the given @p path. The data will be written from the index
      @p first, i.e. the index of the first element, up to index @p 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 @p d_first.
      The output buffer is similarly interpreted as a continuous array for this purpose.

      @param[in] path The path of the datapoint to write.
      @param[in] buffer The input buffer object that will be filled with the data.
      @param[in] first The index of the first element to write to the datapoint.
      @param[in] last The index of the last element to write to the datapoint.
      @param[in] d_first The index in the datapoint where the first data element should
           be written.
      @param[inout] metadata An optional reference to a metadata object that can be used
                    for writing metadata together with the value or for retrieving specific
                    metadata after the request has finished.
      @param[in] callback Optional callback that will be invoked on completion of the request.

      \par Asynchronous Exceptions
 \parblock  The following exceptions are <b>not</b> immediately thrown by this method. They are possibly thrown later by:<ul><li>BatchResponse::Wait</li><li> BatchResponse::WaitFor</li></ul>
 when completing the repository request.
 <table class="exception">

DataPointDoesNotExist

If the path does not exist in the repository.

AccessOutOfBounds

If the output buffer is not big enough.

ServiceFailure

When the underlying back-end system indicates an unexpected failure.

      \par Thread Safety
 \parblock \ref thread-safety "thread-compatible" \endparblock
      \par Exception Safety
 \parblock \ref exception-safety "strong" \endparblock

◆ 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

◆ ReadDataPointImpl()

void rtctk::componentFramework::RepositoryIf::BatchRequest::ReadDataPointImpl ( const DataPointPath & path,
std::any & buffer,
std::optional< std::reference_wrapper< MetaData > > metadata,
const CallbackType & callback ) 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/3]

void rtctk::componentFramework::RepositoryIf::BatchRequest::WriteDataPoint ( const DataPointPath & path,
const std::any & buffer,
std::optional< std::reference_wrapper< MetaData > > metadata,
const CallbackType & callback )

◆ WriteDataPoint() [2/3]

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

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

◆ WriteDataPoint() [3/3]

template<typename T>
void rtctk::componentFramework::RepositoryIf::BatchRequest::WriteDataPoint ( const DataPointPath & path,
const T & buffer,
std::optional< std::reference_wrapper< MetaData > > metadata = std::nullopt,
const CallbackType & callback = nullptr )
      @brief Add request to write a datapoint.

      This method will add an asynchronous request to the batch request to write a specific
      datapoint.

      @param[in] path The path of the datapoint.
      @param[in] buffer The value to be written.
      @param[inout] metadata An optional reference to a metadata object that can be used
                    for writing metadata together with the value or for retrieving specific
                    metadata after the request has finished.
      @param[in] callback Optional callback that will be invoked on completion of the request.

      \par Asynchronous Exceptions
 \parblock  The following exceptions are <b>not</b> immediately thrown by this method. They are possibly thrown later by:<ul><li>BatchResponse::Wait</li><li> BatchResponse::WaitFor</li></ul>
 when completing the repository request.
 <table class="exception">

DataPointDoesNotExist

If the path does not exist in the repository.

ServiceFailure

When the underlying back-end system indicates an unexpected failure.

      \par Thread Safety
 \parblock \ref thread-safety "thread-compatible" \endparblock
      \par Exception Safety
 \parblock \ref exception-safety "strong" \endparblock

◆ 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: