ReceivedDataSample.inl
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #include "ace/Message_Block.h"
00009 #include "EntryExit.h"
00010
00011 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
00012
00013 namespace OpenDDS {
00014 namespace DCPS {
00015
00016 ACE_INLINE
00017 ReceivedDataSample::ReceivedDataSample(ACE_Message_Block* payload)
00018 : sample_(payload)
00019 {
00020 DBG_ENTRY_LVL("ReceivedDataSample", "ReceivedDataSample",6);
00021 }
00022
00023 ACE_INLINE
00024 ReceivedDataSample::ReceivedDataSample(const ReceivedDataSample& other)
00025 : header_(other.header_)
00026 , sample_(ACE_Message_Block::duplicate(other.sample_.get()))
00027 {
00028 DBG_ENTRY_LVL("ReceivedDataSample", "ReceivedDataSample(copy)", 6);
00029 }
00030
00031 ACE_INLINE ReceivedDataSample&
00032 ReceivedDataSample::operator=(const ReceivedDataSample& other)
00033 {
00034 DBG_ENTRY_LVL("ReceivedDataSample", "operator=", 6);
00035 ReceivedDataSample cpy(other);
00036 swap(*this, cpy);
00037 return *this;
00038 }
00039
00040 ACE_INLINE
00041 ReceivedDataSample::~ReceivedDataSample()
00042 {
00043 DBG_ENTRY_LVL("ReceivedDataSample", "~ReceivedDataSample", 6);
00044 }
00045
00046 ACE_INLINE void
00047 swap(ReceivedDataSample& a, ReceivedDataSample& b)
00048 {
00049 using std::swap;
00050 swap(a.header_, b.header_);
00051 swap(a.sample_, b.sample_);
00052 }
00053
00054 }
00055 }
00056
00057 OPENDDS_END_VERSIONED_NAMESPACE_DECL