SampleRef holds a reference to data and related meta information. More...
Public Member Functions | |
SampleRef () | |
Default constructor. Null data. | |
SampleRef (T *data, DDS::SampleInfo *info) | |
Construct with provided data and info pointers. | |
SampleRef (T &data, DDS::SampleInfo &info) | |
Construct with provided data and info references. | |
SampleRef (Sample< T > &sample) | |
Construct with data and info references to the provided Sample<T>. | |
SampleRef & | operator= (Sample< T > &sample) |
Assignment operator, data and info refer to the data and info in the provided Sample<T>. | |
T & | data () const |
Access the data. | |
DDS::SampleInfo & | info () const |
Access the sample info. | |
operator T & () const | |
Cast to a T reference. | |
void | set_data (T *data) |
Assign the data reference. | |
void | set_data (T &data) |
Assign the data reference. | |
void | set_info (DDS::SampleInfo *info) |
Assign the sample info reference. | |
void | set_info (DDS::SampleInfo &info) |
Assign the sample info reference. | |
bool | is_nil_data () const |
Test if the data is NULL. | |
bool | is_nil_info () const |
Test if the sample info is NULL. | |
void | swap (SampleRef &other) throw () |
Swap the data and info references from this to other. | |
DDS::SampleIdentity_t | identity () const |
Access the sample identity. Currently, the 'identity' is populated only by some RPC 'request' methods. | |
DDS::SampleIdentity_t | related_identity () const |
Access the sample's relatedIdentity. Currently, the 'relatedIdentity' is populated only if the sample originates from an RPC entity. | |
Friends | |
class | DDS::DataReader |
class | DDS::DataWriter |
template<typename TReq , typename TRep > | |
class | DDS::rpc::Requester |
template<typename TReq , typename TRep > | |
class | DDS::rpc::Replier |
SampleRef holds a reference to data and related meta information.
SampleRef will hold a pointer to sample data. SampleRef does not clear or destroy the sample data. Further the sample data must remain valid during the lifetime of the SampleRef.
The SampleRef also includes SampleInfo which will be populated if the SampleRef instance is provided by a read() or similar operation of a DDS or RPC entity.