3 //=============================================================================
5 * @file CSD_TP_Queue_Visitor.h
7 * @author Tim Bradley <bradley_t@ociweb.com>
9 //=============================================================================
11 #ifndef TAO_CSD_TP_QUEUE_VISITOR_H
12 #define TAO_CSD_TP_QUEUE_VISITOR_H
14 #include /**/ "ace/pre.h"
16 #include "tao/CSD_ThreadPool/CSD_TP_Export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "tao/Versioned_Namespace.h"
24 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
34 * @class TP_Queue_Visitor
36 * @brief Base class for vistors of the elements in the TP_Queue.
38 * Provides a way to perform thread-safe iteration over the
39 * TP_Request objects contained within a TP_Queue object.
41 * This also provides a means to encapsulate each distinct algorithm
42 * within a distinct subclass of TP_Queue_Visitor.
45 class TAO_CSD_TP_Export TP_Queue_Visitor
48 /// Virtual Destructor.
49 virtual ~TP_Queue_Visitor();
51 /// Returns true to continue visitation. Return false to stop
52 /// visitation. Sets the remove_flag to true if the request should
53 /// be removed from the queue as a result of the visit. Leaves the
54 /// remove_flag alone otherwise.
55 virtual bool visit_request(TP_Request
* request
, bool& remove_flag
) = 0;
58 /// Default Constructor.
64 TAO_END_VERSIONED_NAMESPACE_DECL
66 #if defined (__ACE_INLINE__)
67 # include "tao/CSD_ThreadPool/CSD_TP_Queue_Visitor.inl"
68 #endif /* __ACE_INLINE__ */
70 #include /**/ "ace/post.h"
72 #endif /* TAO_CSD_TP_QUEUE_VISITOR_H */