Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / CSD_ThreadPool / CSD_TP_Queue_Visitor.h
blob81847c58d25333efba4b5575a6287270a6671a9c
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file CSD_TP_Queue_Visitor.h
7 * @author Tim Bradley <bradley_t@ociweb.com>
8 */
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)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "tao/Versioned_Namespace.h"
24 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
26 namespace TAO
28 namespace CSD
30 class TP_Request;
33 /**
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
47 public:
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;
57 protected:
58 /// Default Constructor.
59 TP_Queue_Visitor();
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 */