RT_ORBInitializer.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file RT_ORBInitializer.h
00006  *
00007  *  RT_ORBInitializer.h,v 1.20 2006/03/10 07:19:16 jtc Exp
00008  *
00009  *  @author Ossama Othman <ossama@uci.edu>
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef TAO_RT_ORB_INITIALIZER_H
00015 #define TAO_RT_ORB_INITIALIZER_H
00016 
00017 #include /**/ "ace/pre.h"
00018 
00019 #include "tao/orbconf.h"
00020 
00021 #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
00022 
00023 #include "tao/RTCORBA/rtcorba_export.h"
00024 
00025 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00026 # pragma once
00027 #endif /* ACE_LACKS_PRAGMA_ONCE */
00028 
00029 
00030 #include "tao/PI/PI.h"
00031 #include "tao/LocalObject.h"
00032 
00033 // This is to remove "inherits via dominance" warnings from MSVC.
00034 // MSVC is being a little too paranoid.
00035 #if defined(_MSC_VER)
00036 #pragma warning(push)
00037 #pragma warning(disable:4250)
00038 #endif /* _MSC_VER */
00039 
00040 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00041 
00042 /// RTCORBA ORB initializer.
00043 class TAO_RT_ORBInitializer
00044   : public virtual PortableInterceptor::ORBInitializer
00045   , public virtual TAO_Local_RefCounted_Object
00046 {
00047 public:
00048   /// Priority mapping types
00049   enum
00050     {
00051       TAO_PRIORITY_MAPPING_CONTINUOUS,
00052       TAO_PRIORITY_MAPPING_LINEAR,
00053       TAO_PRIORITY_MAPPING_DIRECT
00054     };
00055 
00056   enum
00057     {
00058       TAO_NETWORK_PRIORITY_MAPPING_LINEAR
00059     };
00060 
00061   TAO_RT_ORBInitializer (int priority_mapping_type,
00062                          int network_priority_mapping_type,
00063                          int ace_sched_policy,
00064                          long sched_policy,
00065                          long scope_policy,
00066                          ACE_Time_Value const &dynamic_thread_idle_timeout);
00067 
00068   virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info
00069                          ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00070     ACE_THROW_SPEC ((CORBA::SystemException));
00071 
00072   virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info
00073                           ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00074     ACE_THROW_SPEC ((CORBA::SystemException));
00075 
00076 private:
00077 
00078   /// Register RTCORBA policy factories.
00079   void register_policy_factories (
00080                                   PortableInterceptor::ORBInitInfo_ptr info
00081                                   ACE_ENV_ARG_DECL);
00082 
00083 private:
00084   /// Instance of the RTCorba policy factory.
00085   /**
00086    * The RTCorba policy factory is stateless and reentrant, so share
00087    * a single instance between all ORBs.
00088    */
00089   PortableInterceptor::PolicyFactory_var policy_factory_;
00090 
00091   /// Priority mapping type.
00092   int const priority_mapping_type_;
00093 
00094   /// Network Priority mapping type.
00095   int const network_priority_mapping_type_;
00096 
00097   /// Scheduling policy.
00098   /**
00099    * Scheduling policy specified by the user through the
00100    * -ORBSchedPolicy option.  This value is typically used by
00101    * functions like ACE_OS::thr_setprio() and
00102    * ACE_Sched_Params::priority_min(). Legal values are ACE_SCHED_RR,
00103    * ACE_SCHED_FIFO, and ACE_SCHED_OTHER.
00104    */
00105   int const ace_sched_policy_;
00106 
00107   /// Scheduling policy flag.
00108   /**
00109    * Scheduling policy specified by the user through the
00110    * -ORBSchedPolicy option.  This value is typically used by ACE
00111    * thread creation functions. Legal values are THR_SCHED_RR,
00112    * THR_SCHED_FIFO, and THR_SCHED_DEFAULT.
00113    */
00114   long const sched_policy_;
00115 
00116   /// Scheduling scope flag.
00117   /**
00118    * Scheduling policy specified by the user through the
00119    * -ORBScopePolicy option.  This value is typically used by ACE
00120    * thread creation functions. Legal values are THR_SCOPE_SYSTEM and
00121    * THR_SCOPE_PROCESS.
00122    */
00123   long const scope_policy_;
00124 
00125   /// Dynamic thread idle timeout
00126   /**
00127    * When using thread pool a certain number of dynamic threads can be created.
00128    * By default these threads are created when needed but never end, when this
00129    * timeout is specified the threads end themselves at the moment they
00130    * have not been serving any requests for the specified amount of time
00131    */
00132   ACE_Time_Value const dynamic_thread_idle_timeout_;
00133 };
00134 
00135 TAO_END_VERSIONED_NAMESPACE_DECL
00136 
00137 #if defined(_MSC_VER)
00138 #pragma warning(pop)
00139 #endif /* _MSC_VER */
00140 
00141 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */
00142 
00143 #include /**/ "ace/post.h"
00144 
00145 #endif /* TAO_RT_ORB_INITIALIZER_H */

Generated on Thu Nov 9 12:58:01 2006 for TAO_RTCORBA by doxygen 1.3.6