Exclusive_TMS.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Exclusive_TMS.h
00006  *
00007  *  $Id: Exclusive_TMS.h 78996 2007-07-23 12:12:55Z johnnyw $
00008  *
00009  *  @author  Alexander Babu Arulanthu <alex@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef TAO_EXCLUSIVE_TMS_H
00015 #define TAO_EXCLUSIVE_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 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00026 
00027 class TAO_Pluggable_Reply_Params;
00028 
00029 /**
00030  * @class TAO_Exclusive_TMS
00031  *
00032  * Using this strategy only one request can be pending at a time
00033  * in a connection.  This improves performance because the client
00034  * does not have to demux the reply, and there is less need for
00035  * synchronization.
00036  * On the other hand, it does not scale well when you have
00037  * multiple client threads or asynchronous messaging.
00038  */
00039 class TAO_Export TAO_Exclusive_TMS : public TAO_Transport_Mux_Strategy
00040 {
00041 
00042 public:
00043   /// Constructor.
00044   TAO_Exclusive_TMS (TAO_Transport *transport);
00045 
00046   /// Destructor.
00047   virtual ~TAO_Exclusive_TMS (void);
00048 
00049   /**
00050    * @name The TAO_Transport_Mux_Strategy overrided methods
00051    *
00052    * Please read the documentation in the TAO_Transport_Mux_Strategy class
00053    * for details.
00054    */
00055   //@{
00056   virtual CORBA::ULong request_id (void);
00057   virtual int bind_dispatcher (CORBA::ULong request_id,
00058                                TAO_Reply_Dispatcher *rh);
00059   virtual int unbind_dispatcher (CORBA::ULong request_id);
00060 
00061   virtual int dispatch_reply (TAO_Pluggable_Reply_Params &params);
00062 
00063   virtual bool idle_after_send (void);
00064   virtual bool idle_after_reply (void);
00065   virtual void connection_closed (void);
00066   //@}
00067 
00068 protected:
00069   /// Used to generate a different request_id on each call to
00070   /// request_id().
00071   CORBA::ULong request_id_generator_;
00072 
00073   /// If false then the request id and reply dispatcher below are
00074   /// meaningless
00075   bool has_request_;
00076 
00077   /// Request id for the current request.
00078   CORBA::ULong request_id_;
00079 
00080   /// Reply Dispatcher corresponding to the request.
00081   TAO_Reply_Dispatcher *rd_;
00082 };
00083 
00084 TAO_END_VERSIONED_NAMESPACE_DECL
00085 
00086 #include /**/ "ace/post.h"
00087 #endif /* EXCLUSIVE_TMS_H */

Generated on Tue Feb 2 17:37:51 2010 for TAO by  doxygen 1.4.7