RTI Connext C++ API  Version 5.1.0
connext::WriteSample< T > Class Template Reference

A sample for writing data. More...

Inherits connext::details::SampleBase< T, I >.

Public Member Functions

 WriteSample ()
 Creates a sample with default data and info values.
 
 WriteSample (const WriteSample< T > &other)
 Creates a sample making a deep copy of another sample.
 
 WriteSample (const T &data)
 Creates a sample making a deep copy of another sample.
 
 WriteSample (WriteSampleRef< T > wsref)
 Creates a sample deep copying the data and info the source references.
 
T & data ()
 Gets the data this sample contains.
 
WriteParams_tinfo ()
 Gets the write parameters.
 
const T & data ()
 Gets the data this sample contains.
 
const WriteParams_tinfo ()
 Gets the write parameters.
 
SampleIdentity_t identity () const
 Gets the identity of this sample.
 

Detailed Description

template<typename T>
class connext::WriteSample< T >

A sample for writing data.

WriteSamples are value types containing data that can be sent and optional parameters that configure how the data is written.

The data is automatically initialized using the corresponding TypeSupport for type T, and the memory is released in the destructor.

When the data already exists and allocating a new instance is not required, connext::WriteSampleRef can be used instead.

Template Parameters
TThe data type that this sample contains

Constructor & Destructor Documentation

template<typename T >
connext::WriteSample< T >::WriteSample ( )
inline

Creates a sample with default data and info values.

The data is deeply initialized using the corresponding TypeSupport

See Also
FooTypeSupport::initialize_data
template<typename T >
connext::WriteSample< T >::WriteSample ( const WriteSample< T > &  other)
inline

Creates a sample making a deep copy of another sample.

template<typename T >
connext::WriteSample< T >::WriteSample ( const T &  data)

Creates a sample making a deep copy of another sample.

template<typename T >
connext::WriteSample< T >::WriteSample ( WriteSampleRef< T >  wsref)
inline

Creates a sample deep copying the data and info the source references.

Member Function Documentation

template<typename T >
T& connext::WriteSample< T >::data ( )

Gets the data this sample contains.

template<typename T >
WriteParams_t& connext::WriteSample< T >::info ( )

Gets the write parameters.

The parameters are input and output to write operations. They can be set to configure the write operation (e.g. setting a specific publication timestamp) or they can be looked up afterward (e.g. what was the actual timestamp the sample was written with).

See Also
connext::Requester::send_request(WriteSample<UReq>&)
connext::Replier::send_reply(WriteSample<URep>&, const SampleIdentity_t&)
template<typename T >
const T& connext::WriteSample< T >::data ( )

Gets the data this sample contains.

template<typename T >
const WriteParams_t& connext::WriteSample< T >::info ( )

Gets the write parameters.

The parameters are input and output to write operations. They can be set to configure the write operation (e.g. setting a specific publication timestamp) or they can be looked up afterward (e.g. what was the actual timestamp the sample was written with).

See Also
connext::Requester::send_request(WriteSample<UReq>&)
connext::Replier::send_reply(WriteSample<URep>&, const SampleIdentity_t&)
template<typename T >
SampleIdentity_t connext::WriteSample< T >::identity ( ) const
inline

Gets the identity of this sample.

The identity is assigned by the middleware after writing.

See Also
Correlating requests and replies

RTI Connext C++ API Version 5.1.0 Copyright © Mon Feb 3 2014 Real-Time Innovations, Inc