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

A request object to pass information about datapoints that should be written to the repository. More...

#include <rtctk/componentFramework/repositoryIf.hpp>

Classes

class  Parameters
 A structure to hold the arguments passed with one of the Add methods. More...
 

Public Member Functions

template<typename T >
void Add (const DataPointPath &path, const T &buffer)
 Adds a datapoint to the request for writing.
 
template<typename T , typename F >
void Add (const DataPointPath &path, const T &buffer, F handler)
 Adds a datapoint to the request for writing with a callback handler.
 
const std::vector< Parameters > & GetParams () const
 
std::vector< Parameters > & GetParams ()
 

Detailed Description

A request object to pass information about datapoints that should be written to the repository.

Thread Safety
thread-compatible
Deprecated
Use BatchRequest instead.

Member Function Documentation

◆ Add() [1/2]

template<typename T >
void rtctk::componentFramework::RepositoryIf::WriteRequest::Add ( const DataPointPath & path,
const T & buffer )

Adds a datapoint to the request for writing.

Template Parameters
TThe type of the input buffer, which must match the type of the datapoint.
Parameters
[in]pathThe datapoint path where the data should be written to the repository.
[in]bufferThe input buffer of the datapoint to be written.
Thread Safety
thread-hostile – Intended to be used in one thread only.
Exception Safety
basic

◆ Add() [2/2]

template<typename T , typename F >
void rtctk::componentFramework::RepositoryIf::WriteRequest::Add ( const DataPointPath & path,
const T & buffer,
F handler )

Adds a datapoint to the request for writing with a callback handler.

This method allows to add a request to write a datapoint and register a callback function that will be invoked as soon as the data has actually been sent to the repository. This allows for an early notification mechanism. The signature for the callback function must be as follows:

void handler(T& buffer);
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:23

where T should be the same type as the type used for the buffer argument.

Note
The callback function must not modify any other datapoint buffers other than the one it receives as an argument. This is the only buffer that is guaranteed not to be accessed anymore by the repository API once the callback is invoked.
Template Parameters
TThe type of the input buffer, which must match the type of the datapoint.
FThe type of the handler callback function. It can be any callable that has a function signature compatible with:
void(const T& buffer)
Parameters
[in]pathThe datapoint path where the data should be written to the repository.
[in]bufferThe input buffer of the datapoint to be written.
[in]handlerThe callback handler function to execute as soon as the data is sent.
Thread Safety
thread-hostile – Intended to be used in one thread only.
Exception Safety
basic

◆ GetParams() [1/2]

std::vector< Parameters > & rtctk::componentFramework::RepositoryIf::WriteRequest::GetParams ( )
inline

◆ GetParams() [2/2]

const std::vector< Parameters > & rtctk::componentFramework::RepositoryIf::WriteRequest::GetParams ( ) const
inline

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