00001
00002
00003
00004
00005
00006
00007
00008 #include "DCPS/DdsDcps_pch.h"
00009 #include "TransportSendElement.h"
00010 #include "TransportSendListener.h"
00011
00012 #if !defined (__ACE_INLINE__)
00013 #include "TransportSendElement.inl"
00014 #endif
00015
00016 OpenDDS::DCPS::TransportSendElement::~TransportSendElement()
00017 {
00018 DBG_ENTRY_LVL("TransportSendElement","~TransportSendElement",6);
00019 }
00020
00021 void
00022 OpenDDS::DCPS::TransportSendElement::release_element(bool dropped_by_transport)
00023 {
00024 DBG_ENTRY_LVL("TransportSendElement","release_element",6);
00025
00026 if (this->was_dropped()) {
00027 this->element_->get_send_listener()->data_dropped(this->element_,
00028 dropped_by_transport);
00029
00030 } else {
00031 this->element_->get_send_listener()->data_delivered(this->element_);
00032 }
00033
00034 if (allocator_) {
00035 ACE_DES_FREE(this, allocator_->free, TransportSendElement);
00036 }
00037 }
00038
00039 OpenDDS::DCPS::RepoId
00040 OpenDDS::DCPS::TransportSendElement::publication_id() const
00041 {
00042 DBG_ENTRY_LVL("TransportSendElement","publication_id",6);
00043 return this->element_->get_pub_id();
00044 }
00045
00046 OpenDDS::DCPS::RepoId
00047 OpenDDS::DCPS::TransportSendElement::subscription_id() const
00048 {
00049 if (this->element_->get_num_subs() == 1) {
00050 return this->element_->get_sub_id(0);
00051 }
00052 return GUID_UNKNOWN;
00053 }
00054
00055 const ACE_Message_Block*
00056 OpenDDS::DCPS::TransportSendElement::msg() const
00057 {
00058 DBG_ENTRY_LVL("TransportSendElement","msg",6);
00059 return this->element_->get_sample();
00060 }
00061
00062 const ACE_Message_Block*
00063 OpenDDS::DCPS::TransportSendElement::msg_payload() const
00064 {
00065 DBG_ENTRY_LVL("TransportSendElement", "msg_payload", 6);
00066 return this->element_->get_sample() ? this->element_->get_sample()->cont() : 0;
00067 }