00001 /* 00002 * 00003 * 00004 * Distributed under the OpenDDS License. 00005 * See: http://www.opendds.org/license.html 00006 */ 00007 00008 #ifndef OPENDDS_DCPS_REMOVEALLVISITOR_H 00009 #define OPENDDS_DCPS_REMOVEALLVISITOR_H 00010 00011 #include "dds/DCPS/dcps_export.h" 00012 #include "BasicQueueVisitor_T.h" 00013 00014 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 00015 00016 namespace OpenDDS { 00017 namespace DCPS { 00018 00019 class TransportQueueElement; 00020 00021 class OpenDDS_Dcps_Export RemoveAllVisitor : public BasicQueueVisitor<TransportQueueElement> { 00022 public: 00023 00024 RemoveAllVisitor(); 00025 00026 virtual ~RemoveAllVisitor(); 00027 00028 /// The BasicQueue<T>::accept_remove_visitor() method will call 00029 /// this visit_element_remove() method for each element in the queue. 00030 virtual int visit_element_remove(TransportQueueElement* element, 00031 int& remove); 00032 00033 /// Accessor for the status. Called after this visitor object has 00034 /// been passed to BasicQueue<T>::accept_remove_visitor(). 00035 int status() const; 00036 00037 int removed_bytes() const; 00038 00039 private: 00040 00041 /// Holds the status of our visit. 00042 int status_; 00043 00044 size_t removed_bytes_; 00045 }; 00046 00047 } // namespace DCPS 00048 } // namespace OpenDDS 00049 00050 OPENDDS_END_VERSIONED_NAMESPACE_DECL 00051 00052 #if defined (__ACE_INLINE__) 00053 #include "RemoveAllVisitor.inl" 00054 #endif /* __ACE_INLINE__ */ 00055 00056 #endif /* OPENDDS_DCPS_REMOVEALLVISITOR_H */