#include <CopyChainVisitor.h>
Public Member Functions | |
CopyChainVisitor (BasicQueue< TransportQueueElement > &target, MessageBlockAllocator *mb_allocator, DataBlockAllocator *db_allocator) | |
virtual | ~CopyChainVisitor () |
virtual int | visit_element (TransportQueueElement *element) |
int | status () const |
Access the status. | |
Private Attributes | |
BasicQueue < TransportQueueElement > & | target_ |
Target queue to fill with copied elements. | |
MessageBlockAllocator * | mb_allocator_ |
Allocator to create copied elements. | |
DataBlockAllocator * | db_allocator_ |
int | status_ |
Status of visitation. |
Definition at line 26 of file CopyChainVisitor.h.
ACE_INLINE OpenDDS::DCPS::CopyChainVisitor::CopyChainVisitor | ( | BasicQueue< TransportQueueElement > & | target, | |
MessageBlockAllocator * | mb_allocator, | |||
DataBlockAllocator * | db_allocator | |||
) |
Definition at line 11 of file CopyChainVisitor.inl.
References DBG_ENTRY_LVL.
00015 : target_( target) 00016 , mb_allocator_(mb_allocator) 00017 , db_allocator_(db_allocator) 00018 , status_( 0) 00019 { 00020 DBG_ENTRY_LVL("CopyChainVisitor","CopyChainVisitor",6); 00021 }
OpenDDS::DCPS::CopyChainVisitor::~CopyChainVisitor | ( | ) | [virtual] |
Definition at line 16 of file CopyChainVisitor.cpp.
References DBG_ENTRY_LVL.
00017 { 00018 DBG_ENTRY_LVL("CopyChainVisitor","~CopyChainVisitor",6); 00019 }
ACE_INLINE int OpenDDS::DCPS::CopyChainVisitor::status | ( | void | ) | const |
Access the status.
Definition at line 25 of file CopyChainVisitor.inl.
References status_.
00026 { 00027 return this->status_; 00028 }
int OpenDDS::DCPS::CopyChainVisitor::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 CopyChainVisitor.cpp.
References db_allocator_, DBG_ENTRY_LVL, mb_allocator_, OpenDDS::DCPS::TransportQueueElement::msg(), OpenDDS::DCPS::TransportQueueElement::publication_id(), OpenDDS::DCPS::BasicQueue< T >::put(), and target_.
00023 { 00024 DBG_ENTRY_LVL("CopyChainVisitor","visit_element",6); 00025 00026 // Create a new copy of the current element. 00027 // fails. 00028 TransportRetainedElement* copiedElement = new 00029 TransportRetainedElement( 00030 element->msg(), 00031 element->publication_id(), 00032 this->mb_allocator_, 00033 this->db_allocator_ 00034 ); 00035 00036 00037 // Add the copy to the target. 00038 this->target_.put( copiedElement); 00039 00040 // Visit entire queue. 00041 return 1; 00042 00043 00044 }
Definition at line 48 of file CopyChainVisitor.h.
Referenced by visit_element().
Allocator to create copied elements.
Definition at line 47 of file CopyChainVisitor.h.
Referenced by visit_element().
int OpenDDS::DCPS::CopyChainVisitor::status_ [private] |
Target queue to fill with copied elements.
Definition at line 44 of file CopyChainVisitor.h.
Referenced by visit_element().