00001 /* 00002 * 00003 * 00004 * Distributed under the OpenDDS License. 00005 * See: http://www.opendds.org/license.html 00006 */ 00007 00008 #ifndef OPENDDS_DCPS_RECEIVEDDATASAMPLE_H 00009 #define OPENDDS_DCPS_RECEIVEDDATASAMPLE_H 00010 00011 #include "dds/DCPS/DataSampleHeader.h" 00012 00013 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00014 class ACE_Message_Block; 00015 ACE_END_VERSIONED_NAMESPACE_DECL 00016 00017 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 00018 00019 namespace OpenDDS { 00020 namespace DCPS { 00021 00022 /** 00023 * @class ReceivedDataSample 00024 * 00025 * @brief Holds a data sample received by the transport. 00026 * 00027 * This is the type of object that is delivered to the 00028 * TransportReceiveListener objects by the transport. 00029 * Note that the data sample header has already been 00030 * demarshalled by the transport, and the ACE_Message_Block (chain) 00031 * represents the "data" portion of the sample. 00032 */ 00033 class OpenDDS_Dcps_Export ReceivedDataSample { 00034 public: 00035 explicit ReceivedDataSample(ACE_Message_Block* payload); 00036 00037 ReceivedDataSample(const ReceivedDataSample&); 00038 00039 ReceivedDataSample& operator=(const ReceivedDataSample&); 00040 00041 ~ReceivedDataSample(); 00042 00043 /// The demarshalled sample header. 00044 DataSampleHeader header_; 00045 00046 /// The "data" part (ie, no "header" part) of the sample. 00047 Message_Block_Ptr sample_; 00048 }; 00049 00050 void swap(ReceivedDataSample&, ReceivedDataSample&); 00051 00052 } // namespace DCPS 00053 } // namespace OpenDDS 00054 00055 OPENDDS_END_VERSIONED_NAMESPACE_DECL 00056 00057 #if defined(__ACE_INLINE__) 00058 #include "ReceivedDataSample.inl" 00059 #endif /* __ACE_INLINE__ */ 00060 00061 #endif /* OPENDDS_DCPS_RECEIVEDDATASAMPLE_H */