OpenDDS::DCPS::TransportReplacedElement Class Reference

#include <TransportReplacedElement.h>

Inheritance diagram for OpenDDS::DCPS::TransportReplacedElement:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TransportReplacedElement (TransportQueueElement *orig_elem, TransportReplacedElementAllocator *allocator=0, MessageBlockAllocator *mb_allocator=0, DataBlockAllocator *db_allocator=0)
virtual ~TransportReplacedElement ()
virtual RepoId publication_id () const
 Accessor for the publisher id.
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 bool owned_by_transport ()
 Is the sample created by the transport?

Protected Member Functions

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

Private Attributes

TransportReplacedElementAllocatorallocator_
 Reference to TransportReplacedElement allocator.
MessageBlockAllocatormb_allocator_
 Cached allocator for DataSampleHeader message block.
DataBlockAllocatordb_allocator_
 Cached allocator for DataSampleHeader data block.
RepoId publisher_id_
 The publication_id() from the original TransportQueueElement.
ACE_Message_Block * msg_
 A deep-copy of the msg() from the original TransportQueueElement.

Detailed Description

Definition at line 24 of file TransportReplacedElement.h.


Constructor & Destructor Documentation

ACE_INLINE OpenDDS::DCPS::TransportReplacedElement::TransportReplacedElement ( TransportQueueElement orig_elem,
TransportReplacedElementAllocator allocator = 0,
MessageBlockAllocator mb_allocator = 0,
DataBlockAllocator db_allocator = 0 
)

Definition at line 12 of file TransportReplacedElement.inl.

References DBG_ENTRY_LVL, OpenDDS::DCPS::TransportQueueElement::msg(), and OpenDDS::DCPS::TransportQueueElement::publication_id().

00016   : TransportQueueElement(1),
00017     allocator_(allocator),
00018     mb_allocator_ (mb_allocator),
00019     db_allocator_ (db_allocator),
00020     msg_(0)
00021 {
00022   DBG_ENTRY_LVL("TransportReplacedElement","TransportReplacedElement",6);
00023 
00024   // Obtain the publisher id.
00025   this->publisher_id_ = orig_elem->publication_id();
00026 
00027   this->msg_ = TransportQueueElement::clone_mb(orig_elem->msg(),
00028                                                this->mb_allocator_,
00029                                                this->db_allocator_);
00030 }

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

Definition at line 15 of file TransportReplacedElement.cpp.

References DBG_ENTRY_LVL.

00016 {
00017   DBG_ENTRY_LVL("TransportReplacedElement","~TransportReplacedElement",6);
00018 }


Member Function Documentation

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

Accessor for the ACE_Message_Block.

Implements OpenDDS::DCPS::TransportQueueElement.

Definition at line 42 of file TransportReplacedElement.inl.

References DBG_ENTRY_LVL, and msg_.

00043 {
00044   DBG_ENTRY_LVL("TransportReplacedElement","msg",6);
00045   return this->msg_;
00046 }

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

The marshalled payload only (sample data).

Implements OpenDDS::DCPS::TransportQueueElement.

Definition at line 50 of file TransportReplacedElement.inl.

References DBG_ENTRY_LVL, and msg_.

00051 {
00052   DBG_ENTRY_LVL("TransportReplacedElement", "msg_payload", 6);
00053   return this->msg_->cont();
00054 }

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

Is the sample created by the transport?

Implements OpenDDS::DCPS::TransportQueueElement.

Definition at line 58 of file TransportReplacedElement.inl.

00059 {
00060   return true;
00061 }

ACE_INLINE OpenDDS::DCPS::RepoId OpenDDS::DCPS::TransportReplacedElement::publication_id (  )  const [virtual]

Accessor for the publisher id.

Implements OpenDDS::DCPS::TransportQueueElement.

Definition at line 34 of file TransportReplacedElement.inl.

References DBG_ENTRY_LVL, and publisher_id_.

00035 {
00036   DBG_ENTRY_LVL("TransportReplacedElement","publication_id",6);
00037   return this->publisher_id_;
00038 }

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

Invoked when the counter reaches 0.

Implements OpenDDS::DCPS::TransportQueueElement.

Definition at line 21 of file TransportReplacedElement.cpp.

References allocator_, DBG_ENTRY_LVL, OpenDDS::DCPS::Cached_Allocator_With_Overflow< T, ACE_LOCK >::free(), and msg_.

00022 {
00023   ACE_UNUSED_ARG(dropped_by_transport);
00024   DBG_ENTRY_LVL("TransportReplacedElement","release_element",6);
00025 
00026   if (this->msg_ != 0) {
00027     this->msg_->release();
00028     this->msg_ = 0;
00029   }
00030 
00031   if (allocator_) {
00032     allocator_->free(this);
00033   }
00034 }


Member Data Documentation

TransportReplacedElementAllocator* OpenDDS::DCPS::TransportReplacedElement::allocator_ [private]

Reference to TransportReplacedElement allocator.

Definition at line 51 of file TransportReplacedElement.h.

Referenced by release_element().

DataBlockAllocator* OpenDDS::DCPS::TransportReplacedElement::db_allocator_ [private]

Cached allocator for DataSampleHeader data block.

Definition at line 55 of file TransportReplacedElement.h.

MessageBlockAllocator* OpenDDS::DCPS::TransportReplacedElement::mb_allocator_ [private]

Cached allocator for DataSampleHeader message block.

Definition at line 53 of file TransportReplacedElement.h.

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

A deep-copy of the msg() from the original TransportQueueElement.

Definition at line 61 of file TransportReplacedElement.h.

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

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

The publication_id() from the original TransportQueueElement.

Definition at line 58 of file TransportReplacedElement.h.

Referenced by publication_id().


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