Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / CSD_ThreadPool / CSD_TP_Custom_Synch_Request.h
bloba68cb9804d13ca6eb0376f525f4157ed724b23a7
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file CSD_TP_Custom_Synch_Request.h
7 * @author Tim Bradley <bradley_t@ociweb.com>
8 */
9 //=============================================================================
11 #ifndef TAO_CSD_TP_CUSTOM_SYNCH_REQUEST_H
12 #define TAO_CSD_TP_CUSTOM_SYNCH_REQUEST_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/CSD_ThreadPool/CSD_TP_Custom_Request.h"
23 #include "tao/CSD_ThreadPool/CSD_TP_Synch_Helper.h"
25 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
27 namespace TAO
29 namespace CSD
31 class TP_Custom_Synch_Request;
32 typedef TAO_Intrusive_Ref_Count_Handle<TP_Custom_Synch_Request>
33 TP_Custom_Synch_Request_Handle;
35 /**
36 * @class TP_Custom_Synch_Request
38 * @brief Base class for "queue-able", Custom (non-CORBA),
39 * Synchronous requests.
41 * TBD - Add description
44 class TAO_CSD_TP_Export TP_Custom_Synch_Request : public TP_Custom_Request
46 public:
47 /// Constructor.
48 TP_Custom_Synch_Request(TP_Custom_Request_Operation* op,
49 TP_Servant_State* servant_state);
51 /// Virtual Destructor.
52 virtual ~TP_Custom_Synch_Request();
54 /// Wait until the request has been executed (and completes), or
55 /// until it has been cancelled. Returns true if the request has
56 /// been executed/completed, and returns false if the request has
57 /// been cancelled.
58 bool wait();
60 protected:
61 /// Dispatch the request to the servant.
62 virtual void dispatch_i();
64 /// Cancel the request.
65 virtual void cancel_i();
67 private:
68 /// Helper used to block and unblock the thread that invokes our
69 /// wait() method.
70 TP_Synch_Helper synch_helper_;
75 TAO_END_VERSIONED_NAMESPACE_DECL
77 #if defined (__ACE_INLINE__)
78 # include "tao/CSD_ThreadPool/CSD_TP_Custom_Synch_Request.inl"
79 #endif /* __ACE_INLINE__ */
81 #include /**/ "ace/post.h"
83 #endif /* TAO_CSD_TP_CUSTOM_SYNCH_REQUEST_H */