OpenDDS::DCPS::TransportSendElement Class Reference

#include <TransportSendElement.h>

Inheritance diagram for OpenDDS::DCPS::TransportSendElement:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TransportSendElement (int initial_count, const DataSampleElement *sample, TransportSendElementAllocator *allocator=0)
virtual ~TransportSendElement ()
virtual RepoId publication_id () const
 Accessor for the publisher id.
virtual RepoId subscription_id () const
 Accessor for the subscription id, if sent the sample is sent to 1 sub.
virtual const ACE_Message_Block * msg () const
 Accessor for the ACE_Message_Block.
virtual const ACE_Message_Block * msg_payload () const
 The marshalled payload only (sample data).
virtual SequenceNumber sequence () const
const DataSampleElementsample () const
 Original sample from send listener.
virtual bool owned_by_transport ()
 Is the sample created by the transport?

Static Public Member Functions

static TransportSendElementalloc (int initial_count, const DataSampleElement *sample)

Protected Member Functions

virtual void release_element (bool dropped_by_transport)
 Invoked when the counter reaches 0.

Private Attributes

const DataSampleElementelement_
TransportSendElementAllocatorallocator_
 Reference to TransportSendElement allocator.

Detailed Description

Definition at line 18 of file TransportSendElement.h.


Constructor & Destructor Documentation

ACE_INLINE OpenDDS::DCPS::TransportSendElement::TransportSendElement ( int  initial_count,
const DataSampleElement sample,
TransportSendElementAllocator allocator = 0 
)

Definition at line 11 of file TransportSendElement.inl.

References DBG_ENTRY_LVL.

Referenced by alloc().

00014   : TransportQueueElement(initial_count),
00015     element_(sample),
00016     allocator_(allocator)
00017 {
00018   DBG_ENTRY_LVL("TransportSendElement","TransportSendElement",6);
00019 }

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

Definition at line 16 of file TransportSendElement.cpp.

References DBG_ENTRY_LVL.

00017 {
00018   DBG_ENTRY_LVL("TransportSendElement","~TransportSendElement",6);
00019 }


Member Function Documentation

ACE_INLINE OpenDDS::DCPS::TransportSendElement * OpenDDS::DCPS::TransportSendElement::alloc ( int  initial_count,
const DataSampleElement sample 
) [static]

Definition at line 23 of file TransportSendElement.inl.

References OpenDDS::DCPS::DataSampleElement::get_transport_send_element_allocator(), OpenDDS::DCPS::Dynamic_Cached_Allocator_With_Overflow< ACE_LOCK >::malloc(), sample(), and TransportSendElement().

Referenced by OpenDDS::DCPS::DataLinkSet::send().

00025 {
00026   TransportSendElement* ret;
00027   TransportSendElementAllocator* al = sample->get_transport_send_element_allocator();
00028   ACE_NEW_MALLOC_RETURN(ret,
00029     static_cast<TransportSendElement*>(al->malloc()),
00030     TransportSendElement(initial_count, sample, al),
00031     0);
00032   return ret;
00033 }

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

Accessor for the ACE_Message_Block.

Implements OpenDDS::DCPS::TransportQueueElement.

Definition at line 56 of file TransportSendElement.cpp.

References DBG_ENTRY_LVL, element_, and OpenDDS::DCPS::DataSampleElement::get_sample().

00057 {
00058   DBG_ENTRY_LVL("TransportSendElement","msg",6);
00059   return this->element_->get_sample();
00060 }

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

The marshalled payload only (sample data).

Implements OpenDDS::DCPS::TransportQueueElement.

Definition at line 63 of file TransportSendElement.cpp.

References DBG_ENTRY_LVL, element_, and OpenDDS::DCPS::DataSampleElement::get_sample().

00064 {
00065   DBG_ENTRY_LVL("TransportSendElement", "msg_payload", 6);
00066   return this->element_->get_sample() ? this->element_->get_sample()->cont() : 0;
00067 }

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

Is the sample created by the transport?

Implements OpenDDS::DCPS::TransportQueueElement.

Definition at line 37 of file TransportSendElement.inl.

00038 {
00039   return false;
00040 }

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

Accessor for the publisher id.

Implements OpenDDS::DCPS::TransportQueueElement.

Definition at line 40 of file TransportSendElement.cpp.

References DBG_ENTRY_LVL, element_, and OpenDDS::DCPS::DataSampleElement::get_pub_id().

00041 {
00042   DBG_ENTRY_LVL("TransportSendElement","publication_id",6);
00043   return this->element_->get_pub_id();
00044 }

void OpenDDS::DCPS::TransportSendElement::release_element ( bool  dropped_by_transport  )  [protected, virtual]

Invoked when the counter reaches 0.

Implements OpenDDS::DCPS::TransportQueueElement.

Definition at line 22 of file TransportSendElement.cpp.

References allocator_, OpenDDS::DCPS::TransportSendListener::data_delivered(), DBG_ENTRY_LVL, element_, OpenDDS::DCPS::Dynamic_Cached_Allocator_With_Overflow< ACE_LOCK >::free(), and OpenDDS::DCPS::DataSampleElement::get_send_listener().

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 }

ACE_INLINE const OpenDDS::DCPS::DataSampleElement * OpenDDS::DCPS::TransportSendElement::sample (  )  const

Original sample from send listener.

Definition at line 51 of file TransportSendElement.inl.

References element_.

Referenced by alloc(), and OpenDDS::DCPS::RtpsUdpDataLink::customize_queue_element().

00052 {
00053   return this->element_;
00054 }

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

Reimplemented from OpenDDS::DCPS::TransportQueueElement.

Definition at line 44 of file TransportSendElement.inl.

References element_, OpenDDS::DCPS::DataSampleElement::get_header(), and OpenDDS::DCPS::DataSampleHeader::sequence_.

00045 {
00046   return this->element_->get_header().sequence_;
00047 }

OpenDDS::DCPS::RepoId OpenDDS::DCPS::TransportSendElement::subscription_id (  )  const [virtual]

Accessor for the subscription id, if sent the sample is sent to 1 sub.

Reimplemented from OpenDDS::DCPS::TransportQueueElement.

Definition at line 47 of file TransportSendElement.cpp.

References OpenDDS::DCPS::GUID_UNKNOWN.

Referenced by OpenDDS::DCPS::TransportCustomizedElement::subscription_id().

00048 {
00049   if (this->element_->get_num_subs() == 1) {
00050     return this->element_->get_sub_id(0);
00051   }
00052   return GUID_UNKNOWN;
00053 }


Member Data Documentation

TransportSendElementAllocator* OpenDDS::DCPS::TransportSendElement::allocator_ [private]

Reference to TransportSendElement allocator.

Definition at line 58 of file TransportSendElement.h.

Referenced by release_element().

const DataSampleElement* OpenDDS::DCPS::TransportSendElement::element_ [private]

This is the actual element that the transport framework was asked to send.

Definition at line 55 of file TransportSendElement.h.

Referenced by msg(), msg_payload(), publication_id(), release_element(), sample(), and sequence().


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