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