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 namespace OpenDDS { 00014 namespace DCPS { 00015 00016 template <typename T> 00017 class BasicQueueVisitor { 00018 public: 00019 00020 BasicQueueVisitor() { 00021 } 00022 00023 virtual ~BasicQueueVisitor() { 00024 } 00025 00026 /// This is the visit_element() method that will be called when the 00027 /// visitation method used is BasicQueue<T>::accept_visitor(). 00028 /// 00029 /// Return 0 if visiting should stop, return 1 to continue visiting. 00030 virtual int visit_element(T* element) { 00031 ACE_UNUSED_ARG(element); 00032 return 0; 00033 } 00034 00035 /// This is the visit_element_remove() method that will be called when the 00036 /// visitation method used is BasicQueue<T>::accept_remove_visitor(). 00037 /// 00038 /// Return 0 if visiting should stop, return 1 to continue visiting. 00039 /// The remove is an "inout" argument that is always passed-in with 00040 /// a false (0) value, indicating that the link should not be 00041 /// removed from the queue as a result of this visit. If the 00042 /// visit_remove() implementation decides that the link should be 00043 /// removed, then it must set the remove argument to true (1). 00044 /// By default, this method is implemented to just return 0 to 00045 /// stop the "remove visitation" immediately. It doesn't modify 00046 /// the value of the remove argument. 00047 virtual int visit_element_remove(T* element, int& remove) { 00048 ACE_UNUSED_ARG(element); 00049 ACE_UNUSED_ARG(remove); 00050 return 0; 00051 } 00052 00053 /// This is the visit_element_ref() method that will be called when the 00054 /// visitation method used is BasicQueue<T>::accept_replace_visitor(). 00055 /// 00056 /// Return 0 if visiting should stop, return 1 to continue visiting. 00057 virtual int visit_element_ref(T*& element) { 00058 ACE_UNUSED_ARG(element); 00059 return 0; 00060 } 00061 }; 00062 00063 } // namespace DCPS 00064 } // namespace OpenDDS 00065 00066 #endif /* OPENDDS_DCPS_BASICQUEUEVISITOR_T_H */