BuildChainVisitor.cpp

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Distributed under the OpenDDS License.
00005  * See: http://www.opendds.org/license.html
00006  */
00007 
00008 #include "DCPS/DdsDcps_pch.h" //Only the _pch include should start with DCPS/
00009 #include "BuildChainVisitor.h"
00010 #include "TransportQueueElement.h"
00011 
00012 #if !defined (__ACE_INLINE__)
00013 #include "BuildChainVisitor.inl"
00014 #endif /* __ACE_INLINE__ */
00015 
00016 OpenDDS::DCPS::BuildChainVisitor::~BuildChainVisitor()
00017 {
00018   DBG_ENTRY_LVL("BuildChainVisitor","~BuildChainVisitor",6);
00019 }
00020 
00021 int
00022 OpenDDS::DCPS::BuildChainVisitor::visit_element(TransportQueueElement* element)
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 }
00047 

Generated on Fri Feb 12 20:05:19 2016 for OpenDDS by  doxygen 1.4.7