00001 /* 00002 * 00003 * 00004 * Distributed under the OpenDDS License. 00005 * See: http://www.opendds.org/license.html 00006 */ 00007 00008 #ifndef OPENDDS_DCPS_COPYCHAINVISTOR_H 00009 #define OPENDDS_DCPS_COPYCHAINVISTOR_H 00010 00011 #include "dds/DCPS/dcps_export.h" 00012 #include "BasicQueue_T.h" 00013 #include "TransportRetainedElement.h" 00014 00015 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00016 class ACE_Message_Block; 00017 ACE_END_VERSIONED_NAMESPACE_DECL 00018 00019 namespace OpenDDS { 00020 namespace DCPS { 00021 00022 class TransportQueueElement; 00023 00024 class OpenDDS_Dcps_Export CopyChainVisitor : public BasicQueueVisitor<TransportQueueElement> { 00025 public: 00026 00027 CopyChainVisitor( 00028 BasicQueue<TransportQueueElement>& target, 00029 TransportRetainedElementAllocator* allocator, 00030 MessageBlockAllocator* mb_allocator, 00031 DataBlockAllocator* db_allocator 00032 ); 00033 00034 virtual ~CopyChainVisitor(); 00035 00036 virtual int visit_element(TransportQueueElement* element); 00037 00038 /// Access the status. 00039 int status() const; 00040 00041 private: 00042 /// Target queue to fill with copied elements. 00043 BasicQueue<TransportQueueElement>& target_; 00044 00045 /// Allocator to create copied elements. 00046 TransportRetainedElementAllocator* allocator_; 00047 MessageBlockAllocator* mb_allocator_; 00048 DataBlockAllocator* db_allocator_; 00049 00050 /// Status of visitation. 00051 int status_; 00052 }; 00053 00054 } // namespace DCPS 00055 } // namespace OpenDDS 00056 00057 #if defined (__ACE_INLINE__) 00058 #include "CopyChainVisitor.inl" 00059 #endif /* __ACE_INLINE__ */ 00060 00061 #endif /* OPENDDS_DCPS_COPYCHAINVISTOR_H */