00001 /* 00002 * 00003 * 00004 * Distributed under the OpenDDS License. 00005 * See: http://www.opendds.org/license.html 00006 */ 00007 00008 #ifndef OPENDDS_DCPS_BASICQUEUEVISITOR_T_H 00009 #define OPENDDS_DCPS_BASICQUEUEVISITOR_T_H 00010 00011 #include "ace/CORBA_macros.h" 00012 00013 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 00014 00015 namespace OpenDDS { 00016 namespace DCPS { 00017 00018 template <typename T> 00019 class BasicQueueVisitor { 00020 public: 00021 00022 BasicQueueVisitor() { 00023 } 00024 00025 virtual ~BasicQueueVisitor() { 00026 } 00027 00028 /// This is the visit_element() method that will be called when the 00029 /// visitation method used is BasicQueue<T>::accept_visitor(). 00030 /// 00031 /// Return 0 if visiting should stop, return 1 to continue visiting. 00032 virtual int visit_element(T* element) { 00033 ACE_UNUSED_ARG(element); 00034 return 0; 00035 } 00036 00037 /// This is the visit_element_remove() method that will be called when the 00038 /// visitation method used is BasicQueue<T>::accept_remove_visitor(). 00039 /// 00040 /// Return 0 if visiting should stop, return 1 to continue visiting. 00041 /// The remove is an "inout" argument that is always passed-in with 00042 /// a false (0) value, indicating that the link should not be 00043 /// removed from the queue as a result of this visit. If the 00044 /// visit_remove() implementation decides that the link should be 00045 /// removed, then it must set the remove argument to true (1). 00046 /// By default, this method is implemented to just return 0 to 00047 /// stop the "remove visitation" immediately. It doesn't modify 00048 /// the value of the remove argument. 00049 virtual int visit_element_remove(T* element, int& remove) { 00050 ACE_UNUSED_ARG(element); 00051 ACE_UNUSED_ARG(remove); 00052 return 0; 00053 } 00054 00055 /// This is the visit_element_ref() method that will be called when the 00056 /// visitation method used is BasicQueue<T>::accept_replace_visitor(). 00057 /// 00058 /// Return 0 if visiting should stop, return 1 to continue visiting. 00059 virtual int visit_element_ref(T*& element) { 00060 ACE_UNUSED_ARG(element); 00061 return 0; 00062 } 00063 }; 00064 00065 } // namespace DCPS 00066 } // namespace OpenDDS 00067 00068 OPENDDS_END_VERSIONED_NAMESPACE_DECL 00069 00070 #endif /* OPENDDS_DCPS_BASICQUEUEVISITOR_T_H */