RTI Connext Traditional C++ API
Version 6.1.1
|
A data sample and related information received from the middleware. More...
Public Member Functions | |
SampleRef () | |
Creates an object with no data. More... | |
SampleRef (T *data, Info *info) | |
Creates an object with a reference to a data object. More... | |
SampleRef (T &data, Info &info) | |
Creates an object with a reference to a data object. More... | |
SampleRef (Sample< T > &sample) | |
Copies the references to data and info. More... | |
SampleRef & | operator= (Sample< T > &sample) |
Copies the references to data and info. More... | |
T & | data () const |
Gets the data this sample contains. More... | |
Info & | info () const |
Gets the SampleInfo. More... | |
operator T& () const | |
Gets the data this sample contains. More... | |
void | set_data (T &data) |
Sets a reference to a data object. More... | |
void | set_info (DDS_SampleInfo &info) |
Sets the info object. More... | |
bool | is_nil_data () const |
Indicates if this SampleRef contains a reference to data or not. More... | |
bool | is_nil_info () const |
Indicates if this SampleRef contains a reference to data or not. More... | |
SampleIdentity_t | identity () const |
Gets the identity of this sample. More... | |
SampleIdentity_t | related_identity () const |
Gets the identity of a sample that is related to this one. More... | |
A data sample and related information received from the middleware.
A SampleRef can be used much like a connext::Sample, but it's different in that it holds references to data and DDS_SampleInfo, whereas a Sample is a value type and owns its data and info.
When calling an operation that copies data from the middleware into a Sample (e.g. connext::Requester::take_reply(Sample<TRep>&)), the references to its data and information must have been set explicitly (see connext::SampleRef::set_data(T&) and connext::SampleRef::set_info(DDS_SampleInfo&))
When a SampleRef is copied, the destination SampleRef references the same data and info objects as the source. Copying and passing by value are inexpensive operations.
SampleRef is also the type of the elements in a connext::LoanedSamples container and they hold references to data from the middleware.
T | The data type that this sample contains |
T | The data type that this sample can contain |
|
inline |
Creates an object with no data.
|
inline |
Creates an object with a reference to a data object.
|
inline |
Creates an object with a reference to a data object.
|
inline |
Copies the references to data and info.
After this operation, this object contains a reference to the same data and info instances as the source.
|
inline |
Copies the references to data and info.
After this operation, this object contains a reference to the same data and info instances as the source.
|
inline |
Gets the data this sample contains.
Referenced by connext::move(), and connext::SampleRef< T >::related_identity().
|
inline |
Gets the SampleInfo.
Referenced by connext::move(), and connext::SampleRef< T >::related_identity().
|
inline |
Gets the data this sample contains.
|
inline |
Sets a reference to a data object.
data | The data object this sample will reference |
|
inline |
Sets the info object.
|
inline |
Indicates if this SampleRef contains a reference to data or not.
|
inline |
Indicates if this SampleRef contains a reference to data or not.
|
inline |
Gets the identity of this sample.
|
inline |
Gets the identity of a sample that is related to this one.
References connext::SampleRef< T >::data(), and connext::SampleRef< T >::info().
Referenced by connext::IsReplyRelatedPredicate< T >::operator()().