OpenDDS::DCPS::TransportSendControlElement Class Reference

#include <TransportSendControlElement.h>

Inheritance diagram for OpenDDS::DCPS::TransportSendControlElement:

Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::TransportSendControlElement:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TransportSendControlElement (int initial_count, const RepoId &publisher_id, TransportSendListener *listener, const DataSampleHeader &header, ACE_Message_Block *msg_block, TransportSendControlElementAllocator *allocator=0)
 TransportSendControlElement (int initial_count, const DataSampleElement *dcps_elem, TransportSendControlElementAllocator *allocator)
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 DataSampleHeaderheader () const
const TransportSendListenerlistener () 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?

Static Public Member Functions

static TransportSendControlElementalloc (int initial_count, const RepoId &publisher_id, TransportSendListener *listener, const DataSampleHeader &header, ACE_Message_Block *message, TransportSendControlElementAllocator *allocator)
static TransportSendControlElementalloc (int initial_count, const DataSampleElement *dcps_elem, TransportSendControlElementAllocator *allocator)

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.
TransportSendListenerlistener_
 The TransportSendListener object to call back upon.
DataSampleHeader header_
 The OpenDDS DCPS header for this control message.
ACE_Message_Block * msg_
 The control message.
const DataSampleElement *const dcps_elem_
 If constructed from a DataSampleElement, keep it around for release.
TransportSendControlElementAllocatorallocator_

Detailed Description

Definition at line 31 of file TransportSendControlElement.h.


Constructor & Destructor Documentation

ACE_INLINE OpenDDS::DCPS::TransportSendControlElement::TransportSendControlElement ( int  initial_count,
const RepoId publisher_id,
TransportSendListener listener,
const DataSampleHeader header,
ACE_Message_Block *  msg_block,
TransportSendControlElementAllocator allocator = 0 
)

Definition at line 15 of file TransportSendControlElement.inl.

References DBG_ENTRY_LVL.

Referenced by alloc().

00021   : TransportQueueElement(initial_count),
00022     publisher_id_(publisher_id),
00023     listener_(listener),
00024     header_(header),
00025     msg_(msg_block),
00026     dcps_elem_(0),
00027     allocator_(allocator)
00028 {
00029   DBG_ENTRY_LVL("TransportSendControlElement","TransportSendControlElement",6);
00030 }

ACE_INLINE OpenDDS::DCPS::TransportSendControlElement::TransportSendControlElement ( int  initial_count,
const DataSampleElement dcps_elem,
TransportSendControlElementAllocator allocator 
)

Definition at line 33 of file TransportSendControlElement.inl.

References DBG_ENTRY_LVL.

00036   : TransportQueueElement(initial_count)
00037   , publisher_id_(dcps_elem->get_pub_id())
00038   , listener_(dcps_elem->get_send_listener())
00039   , header_(dcps_elem->get_header())
00040   , msg_(dcps_elem->get_sample())
00041   , dcps_elem_(dcps_elem)
00042   , allocator_(allocator)
00043 {
00044   DBG_ENTRY_LVL("TransportSendControlElement", "TransportSendControlElement", 6);
00045 }

OpenDDS::DCPS::TransportSendControlElement::~TransportSendControlElement (  )  [virtual]

Definition at line 20 of file TransportSendControlElement.cpp.

References DBG_ENTRY_LVL.

00021 {
00022   DBG_ENTRY_LVL("TransportSendControlElement","~TransportSendControlElement",6);
00023 }


Member Function Documentation

ACE_INLINE TransportSendControlElement * OpenDDS::DCPS::TransportSendControlElement::alloc ( int  initial_count,
const DataSampleElement dcps_elem,
TransportSendControlElementAllocator allocator 
) [static]

Definition at line 67 of file TransportSendControlElement.inl.

References OpenDDS::DCPS::Cached_Allocator_With_Overflow< T, ACE_LOCK >::malloc(), and TransportSendControlElement().

00070 {
00071   TransportSendControlElement* ret;
00072   ACE_NEW_MALLOC_RETURN(ret,
00073     static_cast<TransportSendControlElement*>(allocator->malloc()),
00074     TransportSendControlElement(initial_count, dcps_elem, allocator),
00075     0);
00076   return ret;
00077 }

ACE_INLINE TransportSendControlElement * OpenDDS::DCPS::TransportSendControlElement::alloc ( int  initial_count,
const RepoId publisher_id,
TransportSendListener listener,
const DataSampleHeader header,
ACE_Message_Block *  message,
TransportSendControlElementAllocator allocator 
) [static]

Definition at line 49 of file TransportSendControlElement.inl.

References header(), listener(), OpenDDS::DCPS::Cached_Allocator_With_Overflow< T, ACE_LOCK >::malloc(), and TransportSendControlElement().

Referenced by OpenDDS::DCPS::DataLinkSet::send_control(), OpenDDS::DCPS::DataLink::send_control(), and OpenDDS::DCPS::DataLinkSet::send_response().

00055 {
00056   TransportSendControlElement* ret;
00057   ACE_NEW_MALLOC_RETURN(ret,
00058     static_cast<TransportSendControlElement*>(allocator->malloc()),
00059     TransportSendControlElement(initial_count, publisher_id, listener, header,
00060                                 message, allocator),
00061     0);
00062   return ret;
00063 }

const DataSampleHeader& OpenDDS::DCPS::TransportSendControlElement::header (  )  const [inline]

Definition at line 67 of file TransportSendControlElement.h.

Referenced by alloc(), and OpenDDS::DCPS::RtpsSampleHeader::populate_data_control_submessages().

00067 { 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 106 of file TransportSendControlElement.cpp.

00107 {
00108   return (pub_id == this->publisher_id_);
00109 }

const TransportSendListener* OpenDDS::DCPS::TransportSendControlElement::listener (  )  const [inline]

Definition at line 72 of file TransportSendControlElement.h.

References listener_.

Referenced by alloc(), OpenDDS::DCPS::RtpsSampleHeader::populate_data_control_submessages(), and release_element().

00072 { return listener_; }

const ACE_Message_Block * OpenDDS::DCPS::TransportSendControlElement::msg (  )  const [virtual]

Accessor for the ACE_Message_Block.

Implements OpenDDS::DCPS::TransportQueueElement.

Definition at line 92 of file TransportSendControlElement.cpp.

References DBG_ENTRY_LVL, and msg_.

Referenced by release_element().

00093 {
00094   DBG_ENTRY_LVL("TransportSendControlElement","msg",6);
00095   return this->msg_;
00096 }

const ACE_Message_Block * OpenDDS::DCPS::TransportSendControlElement::msg_payload (  )  const [virtual]

The marshalled payload only (sample data).

Implements OpenDDS::DCPS::TransportQueueElement.

Definition at line 99 of file TransportSendControlElement.cpp.

References DBG_ENTRY_LVL, and msg_.

Referenced by OpenDDS::DCPS::RtpsSampleHeader::populate_data_control_submessages().

00100 {
00101   DBG_ENTRY_LVL("TransportSendControlElement", "msg_payload", 6);
00102   return this->msg_->cont();
00103 }

ACE_INLINE bool OpenDDS::DCPS::TransportSendControlElement::owned_by_transport (  )  [virtual]

Is the sample created by the transport?

Implements OpenDDS::DCPS::TransportQueueElement.

Definition at line 81 of file TransportSendControlElement.inl.

00082 {
00083   return false;
00084 }

RepoId OpenDDS::DCPS::TransportSendControlElement::publication_id (  )  const [virtual]

Accessor for the publisher id.

Implements OpenDDS::DCPS::TransportQueueElement.

Definition at line 85 of file TransportSendControlElement.cpp.

References DBG_ENTRY_LVL, and publisher_id_.

Referenced by OpenDDS::DCPS::RtpsUdpDataLink::send_heartbeats_manual().

00086 {
00087   DBG_ENTRY_LVL("TransportSendControlElement","publication_id",6);
00088   return this->publisher_id_;
00089 }

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 60 of file TransportSendControlElement.cpp.

References allocator_, DBG_ENTRY_LVL, dcps_elem_, OpenDDS::DCPS::Cached_Allocator_With_Overflow< T, ACE_LOCK >::free(), OpenDDS::DCPS::handle_message(), listener(), listener_, msg(), msg_, and OpenDDS::DCPS::TransportQueueElement::was_dropped().

00061 {
00062   ACE_UNUSED_ARG(dropped_by_transport);
00063 
00064   DBG_ENTRY_LVL("TransportSendControlElement","release_element",6);
00065 
00066   // store off local copies to use after "this" pointer deleted
00067   const bool dropped = this->was_dropped();
00068   ACE_Message_Block* const msg = this->msg_;
00069   TransportSendListener* const listener = this->listener_;
00070   const DataSampleElement* const dcps_elem = dcps_elem_;
00071 
00072   if (allocator_) {
00073     ACE_DES_FREE(this, allocator_->free, TransportSendControlElement);
00074   }
00075 
00076   // reporting the message w/o using "this" pointer
00077   if (dcps_elem) {
00078     handle_message(dropped, dcps_elem, dropped_by_transport);
00079   } else {
00080     handle_message(dropped, msg, listener, dropped_by_transport);
00081   }
00082 }

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 26 of file TransportSendControlElement.cpp.

References DBG_ENTRY_LVL.

00027 {
00028   DBG_ENTRY_LVL("TransportSendControlElement","requires_exclusive_packet",6);
00029   return true;
00030 }

ACE_INLINE SequenceNumber OpenDDS::DCPS::TransportSendControlElement::sequence (  )  const [virtual]

Reimplemented from OpenDDS::DCPS::TransportQueueElement.

Definition at line 88 of file TransportSendControlElement.inl.

References header_, and OpenDDS::DCPS::DataSampleHeader::sequence_.

Referenced by OpenDDS::DCPS::RtpsUdpDataLink::send_heartbeats_manual().

00089 {
00090   return this->header_.sequence_;
00091 }


Member Data Documentation

TransportSendControlElementAllocator* OpenDDS::DCPS::TransportSendControlElement::allocator_ [private]

Reference to the TransportSendControlElement allocator.

Definition at line 105 of file TransportSendControlElement.h.

Referenced by release_element().

const DataSampleElement* const OpenDDS::DCPS::TransportSendControlElement::dcps_elem_ [private]

If constructed from a DataSampleElement, keep it around for release.

Definition at line 101 of file TransportSendControlElement.h.

Referenced by release_element().

DataSampleHeader OpenDDS::DCPS::TransportSendControlElement::header_ [private]

The OpenDDS DCPS header for this control message.

Definition at line 95 of file TransportSendControlElement.h.

Referenced by sequence().

TransportSendListener* OpenDDS::DCPS::TransportSendControlElement::listener_ [private]

The TransportSendListener object to call back upon.

Definition at line 92 of file TransportSendControlElement.h.

Referenced by release_element().

ACE_Message_Block* OpenDDS::DCPS::TransportSendControlElement::msg_ [private]

The control message.

Definition at line 98 of file TransportSendControlElement.h.

Referenced by msg(), msg_payload(), and release_element().

RepoId OpenDDS::DCPS::TransportSendControlElement::publisher_id_ [private]

The publisher of the control message.

Definition at line 89 of file TransportSendControlElement.h.

Referenced by publication_id().


The documentation for this class was generated from the following files:
Generated on Fri Feb 12 20:06:33 2016 for OpenDDS by  doxygen 1.4.7