RTI Connext Traditional C++ API
Version 5.3.1
|
A data sample and related information received from the middleware. More...
Public Member Functions | |
SampleRef () | |
Creates an object with no data. | |
SampleRef (T *data, Info *info) | |
Creates an object with a reference to a data object. | |
SampleRef (T &data, Info &info) | |
Creates an object with a reference to a data object. | |
SampleRef (Sample< T > &sample) | |
Copies the references to data and info. | |
SampleRef & | operator= (Sample< T > &sample) |
Copies the references to data and info. | |
T & | data () const |
Gets the data this sample contains. | |
Info & | info () const |
Gets the SampleInfo. | |
operator T & () const | |
Gets the data this sample contains. | |
void | set_data (T &data) |
Sets a reference to a data object. | |
void | set_info (DDS_SampleInfo &info) |
Sets the info object. | |
bool | is_nil_data () const |
Indicates if this SampleRef contains a reference to data or not. | |
bool | is_nil_info () const |
Indicates if this SampleRef contains a reference to data or not. | |
SampleIdentity_t | identity () const |
Gets the identity of this sample. | |
SampleIdentity_t | related_identity () const |
Gets the identity of a sample that is related to this one. | |
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.
|
inline |
Gets the SampleInfo.
|
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.