3 //=============================================================================
5 * @file RT_ORBInitializer.h
7 * @author Ossama Othman <ossama@uci.edu>
9 //=============================================================================
12 #ifndef TAO_RT_ORB_INITIALIZER_H
13 #define TAO_RT_ORB_INITIALIZER_H
15 #include /**/ "ace/pre.h"
17 #include "tao/orbconf.h"
19 #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
21 #include "tao/RTCORBA/rtcorba_export.h"
23 #if !defined (ACE_LACKS_PRAGMA_ONCE)
25 #endif /* ACE_LACKS_PRAGMA_ONCE */
27 #include "tao/PI/PI.h"
28 #include "tao/LocalObject.h"
30 // This is to remove "inherits via dominance" warnings from MSVC.
31 // MSVC is being a little too paranoid.
34 #pragma warning(disable:4250)
37 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
39 /// RTCORBA ORB initializer.
40 class TAO_RT_ORBInitializer
41 : public virtual PortableInterceptor::ORBInitializer
42 , public virtual ::CORBA::LocalObject
45 /// Priority mapping types
48 TAO_PRIORITY_MAPPING_CONTINUOUS
,
49 TAO_PRIORITY_MAPPING_LINEAR
,
50 TAO_PRIORITY_MAPPING_DIRECT
55 TAO_NETWORK_PRIORITY_MAPPING_LINEAR
59 * Lifespan of the dynamic threads
60 * TAO_RTCORBA_DT_INFINITIVE When the Dynamic Thread is created it will run
62 * TAO_RTCORBA_DT_IDLE When the Dynamic Thread is created it will run until
63 * it has been idle for the specified amount of time
64 * TAO_RTCORBA_DT_FIXED When the Dynamic Thread is created it will run for
65 * the specified fix amount of time
67 enum TAO_RTCORBA_DT_LifeSpan
69 TAO_RTCORBA_DT_INFINITIVE
,
74 TAO_RT_ORBInitializer (int priority_mapping_type
,
75 int network_priority_mapping_type
,
79 TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan
,
80 ACE_Time_Value
const &dynamic_thread_time
);
82 virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info
);
84 virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info
);
87 /// Register RTCORBA policy factories.
88 void register_policy_factories (PortableInterceptor::ORBInitInfo_ptr info
);
91 /// Instance of the RTCorba policy factory.
93 * The RTCorba policy factory is stateless and reentrant, so share
94 * a single instance between all ORBs.
96 PortableInterceptor::PolicyFactory_var policy_factory_
;
98 /// Priority mapping type.
99 int const priority_mapping_type_
;
101 /// Network Priority mapping type.
102 int const network_priority_mapping_type_
;
104 /// Scheduling policy.
106 * Scheduling policy specified by the user through the
107 * -ORBSchedPolicy option. This value is typically used by
108 * functions like ACE_OS::thr_setprio() and
109 * ACE_Sched_Params::priority_min(). Legal values are ACE_SCHED_RR,
110 * ACE_SCHED_FIFO, and ACE_SCHED_OTHER.
112 int const ace_sched_policy_
;
114 /// Scheduling policy flag.
116 * Scheduling policy specified by the user through the
117 * -ORBSchedPolicy option. This value is typically used by ACE
118 * thread creation functions. Legal values are THR_SCHED_RR,
119 * THR_SCHED_FIFO, and THR_SCHED_DEFAULT.
121 long const sched_policy_
;
123 /// Scheduling scope flag.
125 * Scheduling policy specified by the user through the
126 * -ORBScopePolicy option. This value is typically used by ACE
127 * thread creation functions. Legal values are THR_SCOPE_SYSTEM and
130 long const scope_policy_
;
132 /// Dynamic thread lifespan policy
133 TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan_
;
135 /// Dynamic thread time
137 * When using thread pool a certain number of dynamic threads can be created.
138 * By default these threads are created when needed but never end. Optionally
139 * a time can be specified
141 ACE_Time_Value
const dynamic_thread_time_
;
144 TAO_END_VERSIONED_NAMESPACE_DECL
146 #if defined(_MSC_VER)
148 #endif /* _MSC_VER */
150 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */
152 #include /**/ "ace/post.h"
154 #endif /* TAO_RT_ORB_INITIALIZER_H */