RT_ORBInitializer.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file RT_ORBInitializer.h
00006  *
00007  *  $Id: RT_ORBInitializer.h 81429 2008-04-24 18:49:54Z johnnyw $
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 #include "tao/PI/PI.h"
00030 #include "tao/LocalObject.h"
00031 
00032 // This is to remove "inherits via dominance" warnings from MSVC.
00033 // MSVC is being a little too paranoid.
00034 #if defined(_MSC_VER)
00035 #pragma warning(push)
00036 #pragma warning(disable:4250)
00037 #endif /* _MSC_VER */
00038 
00039 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00040 
00041 /// RTCORBA ORB initializer.
00042 class TAO_RT_ORBInitializer
00043   : public virtual PortableInterceptor::ORBInitializer
00044   , public virtual ::CORBA::LocalObject
00045 {
00046 public:
00047   /// Priority mapping types
00048   enum
00049     {
00050       TAO_PRIORITY_MAPPING_CONTINUOUS,
00051       TAO_PRIORITY_MAPPING_LINEAR,
00052       TAO_PRIORITY_MAPPING_DIRECT
00053     };
00054 
00055   enum
00056     {
00057       TAO_NETWORK_PRIORITY_MAPPING_LINEAR
00058     };
00059 
00060   /*
00061    * Lifespan of the dynamic threads
00062    * TAO_RTCORBA_DT_INFINITIVE When the Dynamic Thread is created it will run
00063    * forever
00064    * TAO_RTCORBA_DT_IDLE When the Dynamic Thread is created it will run until
00065    * it has been idle for the specified amount of time
00066    * TAO_RTCORBA_DT_FIXED When the Dynamic Thread is created it will run for
00067    * the specified fix amount of time
00068    */
00069   enum TAO_RTCORBA_DT_LifeSpan
00070   {
00071     TAO_RTCORBA_DT_INFINITIVE,
00072     TAO_RTCORBA_DT_IDLE,
00073     TAO_RTCORBA_DT_FIXED
00074   };
00075 
00076   TAO_RT_ORBInitializer (int priority_mapping_type,
00077                          int network_priority_mapping_type,
00078                          int ace_sched_policy,
00079                          long sched_policy,
00080                          long scope_policy,
00081                          TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan,
00082                          ACE_Time_Value const &dynamic_thread_time);
00083 
00084   virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info);
00085 
00086   virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info);
00087 
00088 private:
00089 
00090   /// Register RTCORBA policy factories.
00091   void register_policy_factories (PortableInterceptor::ORBInitInfo_ptr info);
00092 
00093 private:
00094   /// Instance of the RTCorba policy factory.
00095   /**
00096    * The RTCorba policy factory is stateless and reentrant, so share
00097    * a single instance between all ORBs.
00098    */
00099   PortableInterceptor::PolicyFactory_var policy_factory_;
00100 
00101   /// Priority mapping type.
00102   int const priority_mapping_type_;
00103 
00104   /// Network Priority mapping type.
00105   int const network_priority_mapping_type_;
00106 
00107   /// Scheduling policy.
00108   /**
00109    * Scheduling policy specified by the user through the
00110    * -ORBSchedPolicy option.  This value is typically used by
00111    * functions like ACE_OS::thr_setprio() and
00112    * ACE_Sched_Params::priority_min(). Legal values are ACE_SCHED_RR,
00113    * ACE_SCHED_FIFO, and ACE_SCHED_OTHER.
00114    */
00115   int const ace_sched_policy_;
00116 
00117   /// Scheduling policy flag.
00118   /**
00119    * Scheduling policy specified by the user through the
00120    * -ORBSchedPolicy option.  This value is typically used by ACE
00121    * thread creation functions. Legal values are THR_SCHED_RR,
00122    * THR_SCHED_FIFO, and THR_SCHED_DEFAULT.
00123    */
00124   long const sched_policy_;
00125 
00126   /// Scheduling scope flag.
00127   /**
00128    * Scheduling policy specified by the user through the
00129    * -ORBScopePolicy option.  This value is typically used by ACE
00130    * thread creation functions. Legal values are THR_SCOPE_SYSTEM and
00131    * THR_SCOPE_PROCESS.
00132    */
00133   long const scope_policy_;
00134 
00135   /// Dynamic thread lifespan policy
00136   TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan_;
00137 
00138   /// Dynamic thread time
00139   /**
00140    * When using thread pool a certain number of dynamic threads can be created.
00141    * By default these threads are created when needed but never end. Optionally
00142    * a time can be specified
00143    */
00144   ACE_Time_Value const dynamic_thread_time_;
00145 };
00146 
00147 TAO_END_VERSIONED_NAMESPACE_DECL
00148 
00149 #if defined(_MSC_VER)
00150 #pragma warning(pop)
00151 #endif /* _MSC_VER */
00152 
00153 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */
00154 
00155 #include /**/ "ace/post.h"
00156 
00157 #endif /* TAO_RT_ORB_INITIALIZER_H */

Generated on Tue Feb 2 17:42:49 2010 for TAO_RTCORBA by  doxygen 1.4.7