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 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 00020 00021 namespace OpenDDS { 00022 namespace DCPS { 00023 00024 class TransportQueueElement; 00025 00026 class OpenDDS_Dcps_Export CopyChainVisitor : public BasicQueueVisitor<TransportQueueElement> { 00027 public: 00028 00029 CopyChainVisitor( 00030 BasicQueue<TransportQueueElement>& target, 00031 MessageBlockAllocator* mb_allocator, 00032 DataBlockAllocator* db_allocator 00033 ); 00034 00035 virtual ~CopyChainVisitor(); 00036 00037 virtual int visit_element(TransportQueueElement* element); 00038 00039 /// Access the status. 00040 int status() const; 00041 00042 private: 00043 /// Target queue to fill with copied elements. 00044 BasicQueue<TransportQueueElement>& target_; 00045 00046 /// Allocator to create copied elements. 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 OPENDDS_END_VERSIONED_NAMESPACE_DECL 00058 00059 #if defined (__ACE_INLINE__) 00060 #include "CopyChainVisitor.inl" 00061 #endif /* __ACE_INLINE__ */ 00062 00063 #endif /* OPENDDS_DCPS_COPYCHAINVISTOR_H */