Muxed_TMS.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Muxed_TMS.h
00006  *
00007  *  Muxed_TMS.h,v 1.18 2006/04/19 09:04:17 jwillemsen Exp
00008  *
00009  *  @author  Alexander Babu Arulanthu <alex@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef TAO_MUXED_TMS_H
00015 #define TAO_MUXED_TMS_H
00016 
00017 #include /**/ "ace/pre.h"
00018 
00019 #include "tao/Transport_Mux_Strategy.h"
00020 
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif /* ACE_LACKS_PRAGMA_ONCE */
00024 
00025 #include "ace/Hash_Map_Manager_T.h"
00026 #include "ace/Null_Mutex.h"
00027 
00028 
00029 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00030 
00031 class TAO_ORB_Core;
00032 class TAO_Pluggable_Reply_Params;
00033 
00034 /**
00035  * @class TAO_Muxed_TMS
00036  *
00037  * Using this strategy a single connection can have multiple
00038  * outstanding requests.
00039  * @@ Can the performance of the demuxer be made more predictable,
00040  * for example, using the request id as an active demux key?
00041  * @note Check the OMG resolutions about bidirectional
00042  * connections, it is possible that the request ids can only
00043  * assume even or odd values.
00044  */
00045 class TAO_Export TAO_Muxed_TMS : public TAO_Transport_Mux_Strategy
00046 {
00047 
00048 public:
00049   /// Constructor.
00050   TAO_Muxed_TMS (TAO_Transport *transport);
00051 
00052   /// Destructor.
00053   virtual ~TAO_Muxed_TMS (void);
00054 
00055   /// Generate and return an unique request id for the current
00056   /// invocation.
00057   virtual CORBA::ULong request_id (void);
00058 
00059   // = Please read the documentation in the TAO_Transport_Mux_Strategy
00060   //   class.
00061   virtual int bind_dispatcher (CORBA::ULong request_id,
00062                                TAO_Reply_Dispatcher *rh);
00063   virtual int unbind_dispatcher (CORBA::ULong request_id);
00064 
00065   virtual int dispatch_reply (TAO_Pluggable_Reply_Params &params);
00066 
00067   virtual bool idle_after_send (void);
00068   virtual bool idle_after_reply (void);
00069   virtual void connection_closed (void);
00070 
00071 protected:
00072   /// Used to generate a different request_id on each call to
00073   /// request_id().
00074   CORBA::ULong request_id_generator_;
00075 
00076   /// Keep track of the orb core pointer. We need to this to create the
00077   /// Reply Dispatchers.
00078   TAO_ORB_Core * const orb_core_;
00079 
00080   typedef ACE_Hash_Map_Manager_Ex <CORBA::ULong,
00081                                    TAO_Reply_Dispatcher *,
00082                                    ACE_Hash <CORBA::ULong>,
00083                                    ACE_Equal_To <CORBA::ULong>,
00084                                    ACE_Null_Mutex>
00085     REQUEST_DISPATCHER_TABLE;
00086 
00087   /// Table of <Request ID, Reply Dispatcher> pairs.
00088   REQUEST_DISPATCHER_TABLE dispatcher_table_;
00089 
00090 protected:
00091   int clear_cache (void);
00092 };
00093 
00094 TAO_END_VERSIONED_NAMESPACE_DECL
00095 
00096 #include /**/ "ace/post.h"
00097 
00098 #endif /* MUXED_TMS_H */

Generated on Thu Nov 9 11:54:16 2006 for TAO by doxygen 1.3.6