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 "TransportCustomizedElement.h" 10 : #include "TransportSendListener.h" 11 : #include "TransportSendElement.h" 12 : 13 : #if !defined (__ACE_INLINE__) 14 : #include "TransportCustomizedElement.inl" 15 : #endif /* __ACE_INLINE__ */ 16 : 17 : OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 18 : 19 : namespace OpenDDS { 20 : namespace DCPS { 21 : 22 0 : TransportCustomizedElement::~TransportCustomizedElement() 23 : { 24 : DBG_ENTRY_LVL("TransportCustomizedElement", "~TransportCustomizedElement", 6); 25 0 : } 26 : 27 : void 28 0 : TransportCustomizedElement::release_element(bool dropped_by_transport) 29 : { 30 : DBG_ENTRY_LVL("TransportCustomizedElement", "release_element", 6); 31 0 : TransportQueueElement* decided = 0; 32 0 : if (orig_) { 33 0 : decided = orig_; 34 : } 35 : 36 0 : delete this; 37 : 38 0 : if (decided) { 39 0 : decided->decision_made(dropped_by_transport); 40 : } 41 0 : } 42 : 43 : ACE_Message_Block* 44 0 : TransportCustomizedElement::duplicate_msg() const 45 : { 46 : DBG_ENTRY_LVL("TransportCustomizedElement", "duplicate_msg", 6); 47 0 : return msg_->duplicate(); 48 : } 49 : 50 : const ACE_Message_Block* 51 0 : TransportCustomizedElement::msg() const 52 : { 53 : DBG_ENTRY_LVL("TransportCustomizedElement", "msg", 6); 54 0 : return msg_.get(); 55 : } 56 : 57 : void 58 0 : TransportCustomizedElement::set_msg(Message_Block_Ptr m) 59 : { 60 : DBG_ENTRY_LVL("TransportCustomizedElement", "set_msg", 6); 61 0 : msg_.reset(m.release()); 62 0 : } 63 : 64 : const ACE_Message_Block* 65 0 : TransportCustomizedElement::msg_payload() const 66 : { 67 : DBG_ENTRY_LVL("TransportCustomizedElement", "msg_payload", 6); 68 0 : return orig_ ? orig_->msg_payload() : 0; 69 : } 70 : 71 : const TransportSendElement* 72 0 : TransportCustomizedElement::find_original_send_element(TransportQueueElement* orig) 73 : { 74 : const TransportSendElement* ose = 75 0 : dynamic_cast<const TransportSendElement*>(orig); 76 0 : if (!ose) { 77 : const TransportCustomizedElement* tce = 78 0 : dynamic_cast<const TransportCustomizedElement*>(orig); 79 0 : return tce ? tce->original_send_element() : 0; 80 : } 81 0 : return ose; 82 : } 83 : 84 : const TransportSendElement* 85 0 : TransportCustomizedElement::original_send_element() const 86 : { 87 0 : return original_send_element_; 88 : } 89 : 90 : bool 91 0 : TransportCustomizedElement::is_last_fragment() const 92 : { 93 0 : return original_send_element_ ? original_send_element_->is_last_fragment() : false; 94 : } 95 : 96 : 97 : } // namespace DCPS 98 : } // namespace OpenDDS 99 : 100 : OPENDDS_END_VERSIONED_NAMESPACE_DECL