OpenDDS  Snapshot(2023/04/28-20:55)
BasicQueueVisitor_T.h
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 #ifndef OPENDDS_DCPS_TRANSPORT_FRAMEWORK_BASICQUEUEVISITOR_T_H
9 #define OPENDDS_DCPS_TRANSPORT_FRAMEWORK_BASICQUEUEVISITOR_T_H
10 
11 #include "ace/CORBA_macros.h"
12 
14 
15 namespace OpenDDS {
16 namespace DCPS {
17 
18 template <typename T>
20 public:
21 
23  }
24 
25  virtual ~BasicQueueVisitor() {
26  }
27 
28  /// This is the visit_element() method that will be called when the
29  /// visitation method used is BasicQueue<T>::accept_visitor().
30  ///
31  /// Return 0 if visiting should stop, return 1 to continue visiting.
32  virtual int visit_element(T* element) {
33  ACE_UNUSED_ARG(element);
34  return 0;
35  }
36 
37  /// This is the visit_element_remove() method that will be called when the
38  /// visitation method used is BasicQueue<T>::accept_remove_visitor().
39  ///
40  /// Return 0 if visiting should stop, return 1 to continue visiting.
41  /// The remove is an "inout" argument that is always passed-in with
42  /// a false (0) value, indicating that the link should not be
43  /// removed from the queue as a result of this visit. If the
44  /// visit_remove() implementation decides that the link should be
45  /// removed, then it must set the remove argument to true (1).
46  /// By default, this method is implemented to just return 0 to
47  /// stop the "remove visitation" immediately. It doesn't modify
48  /// the value of the remove argument.
49  virtual int visit_element_remove(T* element, int& remove) {
50  ACE_UNUSED_ARG(element);
51  ACE_UNUSED_ARG(remove);
52  return 0;
53  }
54 
55  /// This is the visit_element_ref() method that will be called when the
56  /// visitation method used is BasicQueue<T>::accept_replace_visitor().
57  ///
58  /// Return 0 if visiting should stop, return 1 to continue visiting.
59  virtual int visit_element_ref(T*& element) {
60  ACE_UNUSED_ARG(element);
61  return 0;
62  }
63 };
64 
65 } // namespace DCPS
66 } // namespace OpenDDS
67 
69 
70 #endif /* OPENDDS_DCPS_BASICQUEUEVISITOR_T_H */
virtual int visit_element(T *element)
virtual int visit_element_ref(T *&element)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
virtual int visit_element_remove(T *element, int &remove)
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28