CoreDX DDS C++ Reference Manual
Public Member Functions | Friends | List of all members
DDS::Sample< T > Class Template Reference

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.
 
Sampleoperator= (Sample< T > sample)
 Assignment operator.
 
Sampleoperator= (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
 

Detailed Description

template<typename T>
class DDS::Sample< T >

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.


© 2009-2017 Twin Oaks Computing, Inc
Castle Rock, CO 80108
All rights reserved.