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_Blockchain ()

Private Attributes

ACE_Message_Blockhead_
ACE_Message_Blocktail_

Detailed Description

Definition at line 25 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 }

Here is the caller graph for this function:

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

This is the visit_element() method that will be called when the visitation method used is BasicQueue<T>::accept_visitor().

Return 0 if visiting should stop, return 1 to continue visiting.

Reimplemented from OpenDDS::DCPS::BasicQueueVisitor< TransportQueueElement >.

Definition at line 22 of file BuildChainVisitor.cpp.

References ACE_Message_Block::cont(), DBG_ENTRY_LVL, ACE_Message_Block::duplicate(), 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 }

Here is the call graph for this function:


Member Data Documentation

Definition at line 39 of file BuildChainVisitor.h.

Referenced by chain(), and visit_element().

Definition at line 40 of file BuildChainVisitor.h.

Referenced by chain(), and visit_element().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1