3 //=============================================================================
7 * @author Alexander Babu Arulanthu <alex@cs.wustl.edu>
9 //=============================================================================
12 #ifndef TAO_MUXED_TMS_H
13 #define TAO_MUXED_TMS_H
15 #include /**/ "ace/pre.h"
17 #include "tao/Transport_Mux_Strategy.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "ace/Hash_Map_Manager_T.h"
24 #include "ace/Null_Mutex.h"
26 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
27 template <class X
> class ACE_Intrusive_Auto_Ptr
;
28 ACE_END_VERSIONED_NAMESPACE_DECL
30 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
33 class TAO_Pluggable_Reply_Params
;
34 class TAO_Reply_Dispatcher
;
37 * @class TAO_Muxed_TMS
39 * Using this strategy a single connection can have multiple
40 * outstanding requests.
41 * @@ Can the performance of the demuxer be made more predictable,
42 * for example, using the request id as an active demux key?
43 * @note Check the OMG resolutions about bidirectional
44 * connections, it is possible that the request ids can only
45 * assume even or odd values.
47 class TAO_Export TAO_Muxed_TMS
: public TAO_Transport_Mux_Strategy
51 TAO_Muxed_TMS (TAO_Transport
*transport
);
54 virtual ~TAO_Muxed_TMS ();
56 /// Generate and return an unique request id for the current
58 virtual CORBA::ULong
request_id ();
60 // = Please read the documentation in the TAO_Transport_Mux_Strategy
62 virtual int bind_dispatcher (CORBA::ULong request_id
,
63 ACE_Intrusive_Auto_Ptr
<TAO_Reply_Dispatcher
> rd
);
64 virtual int unbind_dispatcher (CORBA::ULong request_id
);
66 virtual int dispatch_reply (TAO_Pluggable_Reply_Params
¶ms
);
67 virtual int reply_timed_out (CORBA::ULong request_id
);
69 virtual bool idle_after_send ();
70 virtual bool idle_after_reply ();
71 virtual void connection_closed ();
72 virtual bool has_request ();
75 void operator= (const TAO_Muxed_TMS
&);
76 TAO_Muxed_TMS (const TAO_Muxed_TMS
&);
79 /// Lock to protect the state of the object
82 /// Used to generate a different request_id on each call to
84 CORBA::ULong request_id_generator_
;
86 /// Keep track of the orb core pointer. We need to this to create the
87 /// Reply Dispatchers.
88 TAO_ORB_Core
* const orb_core_
;
90 typedef ACE_Hash_Map_Manager_Ex
<CORBA::ULong
,
91 ACE_Intrusive_Auto_Ptr
<TAO_Reply_Dispatcher
>,
92 ACE_Hash
<CORBA::ULong
>,
93 ACE_Equal_To
<CORBA::ULong
>,
95 REQUEST_DISPATCHER_TABLE
;
97 /// Table of <Request ID, Reply Dispatcher> pairs.
98 REQUEST_DISPATCHER_TABLE dispatcher_table_
;
100 int clear_cache_i ();
103 TAO_END_VERSIONED_NAMESPACE_DECL
105 #include /**/ "ace/post.h"
107 #endif /* MUXED_TMS_H */