Sample holds the data and related meta information. More...
Public Member Functions | |
Sample () | |
Default constructor. Empty data. | |
Sample (const Sample< T > &other) | |
Copy constructor. Duplicates data. | |
Sample (SampleRef< T > sample_ref) | |
Copy from Ref constructor. Duplicates data. | |
Sample (const T &data, const DDS::SampleInfo &info) | |
Constructor. Copies data. | |
~Sample () | |
Destructor. Clears data. | |
DDS::SampleIdentity_t | identity () const |
Access the sample's 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. | |
void | swap (Sample &other) |
Swap the contents of this with 'other'. | |
T & | data () |
Access the data. | |
DDS::SampleInfo & | info () |
Access the sample info. | |
const T & | data () const |
Const access to the data. | |
const DDS::SampleInfo & | info () const |
Const access to the sample info. | |
void | set_data (const T &t) |
Set the data. Makes a copy. | |
void | set_data (const T *t) |
Set the data. Makes a copy. | |
void | set_info (const DDS::SampleInfo &i) |
Set the sample info. Makes a copy. | |
void | set_info (const DDS::SampleInfo *i) |
Set the sample info. Makes a copy. | |
Sample & | operator= (Sample< T > sample) |
Assignment operator. | |
Sample & | operator= (SampleRef< T > sample_ref) |
Assignment operator. | |
operator DataReference () | |
Cast to a data reference. | |
operator ConstDataReference () const | |
Cast to a const data reference. | |
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 |
Sample holds the data and related meta information.
Sample will allocate space for the sample data, and maintain that memory. The sample also includes SampleInfo which will be populated if the Sample instance is provided by a read() or similar operation of a DDS or RPC entity.