Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / CSD_ThreadPool / CSD_TP_Custom_Request_Operation.h
blobd3a644e3c24ce583e9ab042bb02b14e17694dce8
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file CSD_TP_Custom_Request_Operation.h
7 * @author Tim Bradley <bradley_t@ociweb.com>
8 */
9 //=============================================================================
11 #ifndef TAO_CSD_TP_CUSTOM_REQUEST_OPERATION_H
12 #define TAO_CSD_TP_CUSTOM_REQUEST_OPERATION_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/Intrusive_Ref_Count_Base_T.h"
23 #include "tao/Intrusive_Ref_Count_Handle_T.h"
24 #include "tao/PortableServer/Servant_Base.h"
25 #include "ace/Synch.h"
27 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
29 namespace TAO
31 namespace CSD
33 class TP_Custom_Request_Operation;
34 typedef TAO_Intrusive_Ref_Count_Handle<TP_Custom_Request_Operation>
35 TP_Custom_Request_Operation_Handle;
38 /**
39 * @class TP_Custom_Request_Operation
41 * @brief Base class for all custom request operations.
43 * @note The caller that creates a new TP_Custom_Request_Operation
44 * object needs call _add_ref () on the servant before
45 * constructing it and the TP_Custom_Request_Operation object
46 * is responsible to decrement the reference count.
48 * TBD - Add description
50 class TAO_CSD_TP_Export TP_Custom_Request_Operation
51 : public TAO_Intrusive_Ref_Count_Base<TAO_SYNCH_MUTEX>
53 public:
54 /// Virtual Destructor.
55 virtual ~TP_Custom_Request_Operation();
57 /// Invoked by a worker thread to perform the operation.
58 void execute();
60 /// Invoked when the request has been cancelled.
61 void cancel();
63 /// Used by the TP_Strategy to obtain the target servant in order
64 /// to construct the custom request object. Returns the servant as
65 /// an "in" argument (the caller does not get a new 'copy'). This
66 /// is useful for chaining.
67 PortableServer::Servant servant();
69 protected:
70 /// Constructor.
71 TP_Custom_Request_Operation(PortableServer::Servant servant);
73 virtual void execute_i() = 0;
74 virtual void cancel_i() = 0;
76 private:
77 PortableServer::ServantBase_var servant_;
82 TAO_END_VERSIONED_NAMESPACE_DECL
84 #if defined (__ACE_INLINE__)
85 # include "tao/CSD_ThreadPool/CSD_TP_Custom_Request_Operation.inl"
86 #endif /* __ACE_INLINE__ */
88 #include /**/ "ace/post.h"
90 #endif /* TAO_CSD_TP_CUSTOM_REQUEST_OPERATION_H */