OpenDDS::DCPS::BuildChainVisitor Class Reference

#include <BuildChainVisitor.h>

Inheritance diagram for OpenDDS::DCPS::BuildChainVisitor:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BuildChainVisitor ()
virtual ~BuildChainVisitor ()
virtual int visit_element (TransportQueueElement *element)
ACE_Message_Block * chain ()

Private Attributes

ACE_Message_Block * head_
ACE_Message_Block * tail_

Detailed Description

Definition at line 23 of file BuildChainVisitor.h.


Constructor & Destructor Documentation

ACE_INLINE OpenDDS::DCPS::BuildChainVisitor::BuildChainVisitor (  ) 

Definition at line 11 of file BuildChainVisitor.inl.

References DBG_ENTRY_LVL.

00012   : head_(0),
00013     tail_(0)
00014 {
00015   DBG_ENTRY_LVL("BuildChainVisitor","BuildChainVisitor",6);
00016 }

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

Definition at line 16 of file BuildChainVisitor.cpp.

References DBG_ENTRY_LVL.

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


Member Function Documentation

ACE_INLINE ACE_Message_Block * OpenDDS::DCPS::BuildChainVisitor::chain (  ) 

Accessor to extract the chain, leaving the head_ and tail_ set to 0 as a result.

Definition at line 20 of file BuildChainVisitor.inl.

References DBG_ENTRY_LVL, head_, and tail_.

Referenced by OpenDDS::DCPS::TransportSendStrategy::prepare_packet().

00021 {
00022   DBG_ENTRY_LVL("BuildChainVisitor","chain",6);
00023 
00024   ACE_Message_Block* head = this->head_;
00025   this->head_ = this->tail_ = 0;
00026   return head;
00027 }

int OpenDDS::DCPS::BuildChainVisitor::visit_element ( TransportQueueElement element  )  [virtual]

Definition at line 22 of file BuildChainVisitor.cpp.

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

00023 {
00024   DBG_ENTRY_LVL("BuildChainVisitor","visit_element",6);
00025 
00026   if (this->head_ == 0) {
00027     // This is the first element that we have visited.
00028     this->head_ = element->msg()->duplicate();
00029     this->tail_ = this->head_;
00030 
00031     while (this->tail_->cont() != 0) {
00032       this->tail_ = this->tail_->cont();
00033     }
00034 
00035   } else {
00036     // This is not the first element that we have visited.
00037     this->tail_->cont(element->msg()->duplicate());
00038 
00039     while (this->tail_->cont() != 0) {
00040       this->tail_ = this->tail_->cont();
00041     }
00042   }
00043 
00044   // Visit entire queue.
00045   return 1;
00046 }


Member Data Documentation

ACE_Message_Block* OpenDDS::DCPS::BuildChainVisitor::head_ [private]

Definition at line 37 of file BuildChainVisitor.h.

Referenced by chain(), and visit_element().

ACE_Message_Block* OpenDDS::DCPS::BuildChainVisitor::tail_ [private]

Definition at line 38 of file BuildChainVisitor.h.

Referenced by chain(), and visit_element().


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