Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Exclusive_TMS.h
blob8ecb778cff6a034ac42a36f68d50cb76f4f669c3
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Exclusive_TMS.h
7 * @author Alexander Babu Arulanthu <alex@cs.wustl.edu>
8 */
9 //=============================================================================
12 #ifndef TAO_EXCLUSIVE_TMS_H
13 #define TAO_EXCLUSIVE_TMS_H
15 #include /**/ "ace/pre.h"
17 #include "tao/Transport_Mux_Strategy.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
25 class TAO_Pluggable_Reply_Params;
26 class TAO_Reply_Dispatcher;
28 /**
29 * @class TAO_Exclusive_TMS
31 * Using this strategy only one request can be pending at a time
32 * in a connection. This improves performance because the client
33 * does not have to demux the reply, and there is less need for
34 * synchronization.
35 * On the other hand, it does not scale well when you have
36 * multiple client threads or asynchronous messaging.
38 class TAO_Export TAO_Exclusive_TMS : public TAO_Transport_Mux_Strategy
40 public:
41 /// Constructor.
42 TAO_Exclusive_TMS (TAO_Transport *transport);
44 /// Destructor.
45 virtual ~TAO_Exclusive_TMS ();
47 /**
48 * @name The TAO_Transport_Mux_Strategy overrided methods
50 * Please read the documentation in the TAO_Transport_Mux_Strategy class
51 * for details.
53 //@{
54 virtual CORBA::ULong request_id ();
55 virtual int bind_dispatcher (CORBA::ULong request_id,
56 ACE_Intrusive_Auto_Ptr<TAO_Reply_Dispatcher> rd);
57 virtual int unbind_dispatcher (CORBA::ULong request_id);
59 virtual int dispatch_reply (TAO_Pluggable_Reply_Params &params);
60 virtual int reply_timed_out (CORBA::ULong request_id);
62 virtual bool idle_after_send ();
63 virtual bool idle_after_reply ();
64 virtual void connection_closed ();
65 virtual bool has_request ();
66 //@}
68 protected:
69 /// Used to generate a different request_id on each call to
70 /// request_id().
71 CORBA::ULong request_id_generator_;
73 /// Request id for the current request.
74 CORBA::ULong request_id_;
76 /// Reply Dispatcher corresponding to the request. If this is zero we don't
77 /// have a reply, if it not zero we have one
78 ACE_Intrusive_Auto_Ptr<TAO_Reply_Dispatcher> rd_;
81 TAO_END_VERSIONED_NAMESPACE_DECL
83 #include /**/ "ace/post.h"
84 #endif /* EXCLUSIVE_TMS_H */