Line data Source code
1 : /* 2 : * 3 : * 4 : * Distributed under the OpenDDS License. 5 : * See: http://www.opendds.org/license.html 6 : */ 7 : 8 : #include "DCPS/DdsDcps_pch.h" //Only the _pch include should start with DCPS/ 9 : #include "TransportSendElement.h" 10 : #include "TransportSendListener.h" 11 : 12 : #if !defined (__ACE_INLINE__) 13 : #include "TransportSendElement.inl" 14 : #endif /* __ACE_INLINE__ */ 15 : 16 : OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 17 : 18 4 : OpenDDS::DCPS::TransportSendElement::~TransportSendElement() 19 : { 20 : DBG_ENTRY_LVL("TransportSendElement", "~TransportSendElement", 6); 21 4 : } 22 : 23 : void 24 2 : OpenDDS::DCPS::TransportSendElement::release_element(bool dropped_by_transport) 25 : { 26 : DBG_ENTRY_LVL("TransportSendElement", "release_element", 6); 27 : 28 2 : if (element_->get_send_listener()) { 29 0 : if (was_dropped()) { 30 0 : element_->get_send_listener()->data_dropped(element_, dropped_by_transport); 31 : } else { 32 0 : element_->get_send_listener()->data_delivered(element_); 33 : } 34 : } 35 : 36 2 : delete this; 37 2 : } 38 : 39 : OpenDDS::DCPS::GUID_t 40 2 : OpenDDS::DCPS::TransportSendElement::publication_id() const 41 : { 42 : DBG_ENTRY_LVL("TransportSendElement", "publication_id", 6); 43 2 : return element_->get_pub_id(); 44 : } 45 : 46 : OpenDDS::DCPS::GUID_t 47 0 : OpenDDS::DCPS::TransportSendElement::subscription_id() const 48 : { 49 0 : if (element_->get_num_subs() == 1) { 50 0 : return element_->get_sub_id(0); 51 : } 52 0 : return GUID_UNKNOWN; 53 : } 54 : 55 : ACE_Message_Block* 56 1 : OpenDDS::DCPS::TransportSendElement::duplicate_msg() const 57 : { 58 : DBG_ENTRY_LVL("TransportSendElement", "duplicate_msg", 6); 59 1 : return element_->get_sample()->duplicate(); 60 : } 61 : 62 : const ACE_Message_Block* 63 5 : OpenDDS::DCPS::TransportSendElement::msg() const 64 : { 65 : DBG_ENTRY_LVL("TransportSendElement", "msg", 6); 66 5 : return element_->get_sample(); 67 : } 68 : 69 : const ACE_Message_Block* 70 0 : OpenDDS::DCPS::TransportSendElement::msg_payload() const 71 : { 72 : DBG_ENTRY_LVL("TransportSendElement", "msg_payload", 6); 73 0 : return element_->get_sample() ? element_->get_sample()->cont() : 0; 74 : } 75 : 76 : OPENDDS_END_VERSIONED_NAMESPACE_DECL