3 //=============================================================================
5 * @file CSD_TP_Cancel_Visitor.h
7 * @author Tim Bradley <bradley_t@ociweb.com>
9 //=============================================================================
11 #ifndef TAO_CSD_TP_CANCEL_VISITOR_H
12 #define TAO_CSD_TP_CANCEL_VISITOR_H
14 #include /**/ "ace/pre.h"
16 #include "tao/CSD_ThreadPool/CSD_TP_Export.h"
17 #include "tao/PortableServer/Servant_Base.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "tao/CSD_ThreadPool/CSD_TP_Queue_Visitor.h"
26 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
33 * @class TP_Cancel_Visitor
35 * @brief Used to extract/cancel request(s) from the queue.
37 * This visitor is used to cancel certain requests in the queue
38 * as they are visited.
40 * Note that this is currently implemented to cancel *all*
41 * requests in the queue, or requests that are targeted for a specific
42 * servant. This could be extended in the future to perhaps
43 * cancel all requests that have the same operation name, or something
47 class TAO_CSD_TP_Export TP_Cancel_Visitor
: public TP_Queue_Visitor
50 /// Default Constructor - cancel *all* requests.
53 /// Constructor with provided servant - cancel requests that
54 /// target the supplied servant.
55 TP_Cancel_Visitor(PortableServer::Servant servant
);
57 /// Virtual Destructor.
58 virtual ~TP_Cancel_Visitor();
60 /// Returns true to continue visitation. Returns false to stop
61 /// visitation. Sets the remove_flag to true if the request should
62 /// be removed from the queue as a result of the visit. Leaves the
63 /// remove_flag alone otherwise.
64 virtual bool visit_request(TP_Request
* request
, bool& remove_flag
);
67 /// Left as nil if we are to cancel all requests, or set to a specific
68 /// servant if only requests targeting that servant should be cancelled.
69 PortableServer::ServantBase_var servant_
;
74 TAO_END_VERSIONED_NAMESPACE_DECL
76 #if defined (__ACE_INLINE__)
77 # include "tao/CSD_ThreadPool/CSD_TP_Cancel_Visitor.inl"
78 #endif /* __ACE_INLINE__ */
80 #include /**/ "ace/post.h"
82 #endif /* TAO_CSD_TP_DISPATCHABLE_VISITOR_H */