#include <TransportSendControlElement.h>
Public Member Functions | |
TransportSendControlElement (int initial_count, const RepoId &publisher_id, TransportSendListener *listener, const DataSampleHeader &header, Message_Block_Ptr msg_block) | |
TransportSendControlElement (int initial_count, const DataSampleElement *dcps_elem) | |
virtual | ~TransportSendControlElement () |
virtual bool | requires_exclusive_packet () const |
Overriden to always return true for Send Control elements. | |
virtual RepoId | publication_id () const |
Accessor for the publisher id. | |
virtual const ACE_Message_Block * | msg () const |
Accessor for the ACE_Message_Block. | |
const DataSampleHeader & | header () const |
const TransportSendListener * | listener () const |
virtual const ACE_Message_Block * | msg_payload () const |
The marshalled payload only (sample data). | |
virtual SequenceNumber | sequence () const |
virtual bool | is_control (RepoId pub_id) const |
Is the element a "control" sample from the specified pub_id? | |
virtual bool | owned_by_transport () |
Is the sample created by the transport? | |
virtual bool | is_request_ack () const |
Protected Member Functions | |
virtual void | release_element (bool dropped_by_transport) |
Invoked when the counter reaches 0. | |
Private Attributes | |
RepoId | publisher_id_ |
The publisher of the control message. | |
TransportSendListener * | listener_ |
The TransportSendListener object to call back upon. | |
DataSampleHeader | header_ |
The OpenDDS DCPS header for this control message. | |
Message_Block_Ptr | msg_ |
The control message. | |
const DataSampleElement *const | dcps_elem_ |
If constructed from a DataSampleElement, keep it around for release. | |
TransportSendControlElementAllocator * | allocator_ |
Definition at line 34 of file TransportSendControlElement.h.
OpenDDS::DCPS::TransportSendControlElement::TransportSendControlElement | ( | int | initial_count, | |
const RepoId & | publisher_id, | |||
TransportSendListener * | listener, | |||
const DataSampleHeader & | header, | |||
Message_Block_Ptr | msg_block | |||
) |
Definition at line 23 of file TransportSendControlElement.cpp.
References DBG_ENTRY_LVL, and release().
00028 : TransportQueueElement(initial_count), 00029 publisher_id_(publisher_id), 00030 listener_(listener), 00031 header_(header), 00032 msg_(msg_block.release()), 00033 dcps_elem_(0) 00034 { 00035 DBG_ENTRY_LVL("TransportSendControlElement","TransportSendControlElement",6); 00036 }
OpenDDS::DCPS::TransportSendControlElement::TransportSendControlElement | ( | int | initial_count, | |
const DataSampleElement * | dcps_elem | |||
) |
Definition at line 39 of file TransportSendControlElement.cpp.
References DBG_ENTRY_LVL.
00041 : TransportQueueElement(initial_count) 00042 , publisher_id_(dcps_elem->get_pub_id()) 00043 , listener_(dcps_elem->get_send_listener()) 00044 , header_(dcps_elem->get_header()) 00045 , dcps_elem_(dcps_elem) 00046 { 00047 DBG_ENTRY_LVL("TransportSendControlElement", "TransportSendControlElement", 6); 00048 }
OpenDDS::DCPS::TransportSendControlElement::~TransportSendControlElement | ( | ) | [virtual] |
Definition at line 50 of file TransportSendControlElement.cpp.
References DBG_ENTRY_LVL.
00051 { 00052 DBG_ENTRY_LVL("TransportSendControlElement","~TransportSendControlElement",6); 00053 }
const DataSampleHeader& OpenDDS::DCPS::TransportSendControlElement::header | ( | void | ) | const [inline] |
Definition at line 57 of file TransportSendControlElement.h.
Referenced by OpenDDS::DCPS::RtpsUdpDataLink::customize_queue_element(), and OpenDDS::DCPS::RtpsSampleHeader::populate_data_control_submessages().
00057 { return this->header_; }
bool OpenDDS::DCPS::TransportSendControlElement::is_control | ( | RepoId | pub_id | ) | const [virtual] |
Is the element a "control" sample from the specified pub_id?
Reimplemented from OpenDDS::DCPS::TransportQueueElement.
Definition at line 140 of file TransportSendControlElement.cpp.
References publisher_id_.
00141 { 00142 return (pub_id == this->publisher_id_); 00143 }
virtual bool OpenDDS::DCPS::TransportSendControlElement::is_request_ack | ( | ) | const [inline, virtual] |
Reimplemented from OpenDDS::DCPS::TransportQueueElement.
Definition at line 72 of file TransportSendControlElement.h.
References OpenDDS::DCPS::REQUEST_ACK.
00072 { return header_.message_id_ == REQUEST_ACK; }
const TransportSendListener* OpenDDS::DCPS::TransportSendControlElement::listener | ( | ) | const [inline] |
Definition at line 62 of file TransportSendControlElement.h.
Referenced by OpenDDS::DCPS::RtpsSampleHeader::populate_data_control_submessages().
00062 { return listener_; }
const ACE_Message_Block * OpenDDS::DCPS::TransportSendControlElement::msg | ( | void | ) | const [virtual] |
Accessor for the ACE_Message_Block.
Implements OpenDDS::DCPS::TransportQueueElement.
Definition at line 124 of file TransportSendControlElement.cpp.
References DBG_ENTRY_LVL, dcps_elem_, OpenDDS::DCPS::unique_ptr< T, Deleter >::get(), OpenDDS::DCPS::DataSampleElement::get_sample(), and msg_.
Referenced by msg_payload(), and release_element().
00125 { 00126 DBG_ENTRY_LVL("TransportSendControlElement","msg",6); 00127 if (dcps_elem_) 00128 return dcps_elem_->get_sample(); 00129 return this->msg_.get(); 00130 }
const ACE_Message_Block * OpenDDS::DCPS::TransportSendControlElement::msg_payload | ( | ) | const [virtual] |
The marshalled payload only (sample data).
Implements OpenDDS::DCPS::TransportQueueElement.
Definition at line 133 of file TransportSendControlElement.cpp.
References ACE_Message_Block::cont(), DBG_ENTRY_LVL, and msg().
Referenced by OpenDDS::DCPS::RtpsSampleHeader::populate_data_control_submessages().
00134 { 00135 DBG_ENTRY_LVL("TransportSendControlElement", "msg_payload", 6); 00136 return this->msg()->cont(); 00137 }
ACE_INLINE bool OpenDDS::DCPS::TransportSendControlElement::owned_by_transport | ( | ) | [virtual] |
Is the sample created by the transport?
Implements OpenDDS::DCPS::TransportQueueElement.
Definition at line 18 of file TransportSendControlElement.inl.
RepoId OpenDDS::DCPS::TransportSendControlElement::publication_id | ( | ) | const [virtual] |
Accessor for the publisher id.
Implements OpenDDS::DCPS::TransportQueueElement.
Definition at line 117 of file TransportSendControlElement.cpp.
References DBG_ENTRY_LVL, and publisher_id_.
Referenced by OpenDDS::DCPS::RtpsUdpDataLink::send_heartbeats_manual().
00118 { 00119 DBG_ENTRY_LVL("TransportSendControlElement","publication_id",6); 00120 return this->publisher_id_; 00121 }
void OpenDDS::DCPS::TransportSendControlElement::release_element | ( | bool | dropped_by_transport | ) | [protected, virtual] |
Invoked when the counter reaches 0.
Implements OpenDDS::DCPS::TransportQueueElement.
Definition at line 90 of file TransportSendControlElement.cpp.
References DBG_ENTRY_LVL, dcps_elem_, listener_, msg(), msg_, OpenDDS::DCPS::unique_ptr< T, Deleter >::release(), and OpenDDS::DCPS::TransportQueueElement::was_dropped().
00091 { 00092 ACE_UNUSED_ARG(dropped_by_transport); 00093 00094 DBG_ENTRY_LVL("TransportSendControlElement","release_element",6); 00095 00096 // store off local copies to use after "this" pointer deleted 00097 const bool dropped = this->was_dropped(); 00098 00099 Message_Block_Ptr msg(this->msg_.release()); 00100 00101 TransportSendListener* const listener = this->listener_; 00102 const DataSampleElement* dcps_elem = dcps_elem_; 00103 00104 00105 delete this; 00106 00107 00108 // reporting the message w/o using "this" pointer 00109 if (dcps_elem) { 00110 handle_message(dropped, dcps_elem, dropped_by_transport); 00111 } else { 00112 handle_message(dropped, msg, listener, dropped_by_transport); 00113 } 00114 }
bool OpenDDS::DCPS::TransportSendControlElement::requires_exclusive_packet | ( | ) | const [virtual] |
Overriden to always return true for Send Control elements.
Reimplemented from OpenDDS::DCPS::TransportQueueElement.
Definition at line 56 of file TransportSendControlElement.cpp.
References DBG_ENTRY_LVL.
00057 { 00058 DBG_ENTRY_LVL("TransportSendControlElement","requires_exclusive_packet",6); 00059 return true; 00060 }
ACE_INLINE SequenceNumber OpenDDS::DCPS::TransportSendControlElement::sequence | ( | ) | const [virtual] |
Reimplemented from OpenDDS::DCPS::TransportQueueElement.
Definition at line 25 of file TransportSendControlElement.inl.
References header_, and OpenDDS::DCPS::DataSampleHeader::sequence_.
Referenced by OpenDDS::DCPS::RtpsUdpDataLink::send_heartbeats_manual().
00026 { 00027 return this->header_.sequence_; 00028 }
TransportSendControlElementAllocator* OpenDDS::DCPS::TransportSendControlElement::allocator_ [private] |
Reference to the TransportSendControlElement allocator.
Definition at line 97 of file TransportSendControlElement.h.
const DataSampleElement* const OpenDDS::DCPS::TransportSendControlElement::dcps_elem_ [private] |
If constructed from a DataSampleElement, keep it around for release.
Definition at line 93 of file TransportSendControlElement.h.
Referenced by msg(), and release_element().
The OpenDDS DCPS header for this control message.
Definition at line 87 of file TransportSendControlElement.h.
Referenced by sequence().
The TransportSendListener object to call back upon.
Definition at line 84 of file TransportSendControlElement.h.
Referenced by release_element().
The control message.
Definition at line 90 of file TransportSendControlElement.h.
Referenced by msg(), and release_element().
The publisher of the control message.
Definition at line 81 of file TransportSendControlElement.h.
Referenced by is_control(), and publication_id().