Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / RTCORBA / RT_ORBInitializer.h
blob6f1e3d9208eef8797fe04b1ec7d3065006cc2bd4
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file RT_ORBInitializer.h
7 * @author Ossama Othman <ossama@uci.edu>
8 */
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)
24 # 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.
32 #if defined(_MSC_VER)
33 #pragma warning(push)
34 #pragma warning(disable:4250)
35 #endif /* _MSC_VER */
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
44 public:
45 /// Priority mapping types
46 enum
48 TAO_PRIORITY_MAPPING_CONTINUOUS,
49 TAO_PRIORITY_MAPPING_LINEAR,
50 TAO_PRIORITY_MAPPING_DIRECT
53 enum
55 TAO_NETWORK_PRIORITY_MAPPING_LINEAR
58 /**
59 * Lifespan of the dynamic threads
60 * TAO_RTCORBA_DT_INFINITIVE When the Dynamic Thread is created it will run
61 * forever
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,
70 TAO_RTCORBA_DT_IDLE,
71 TAO_RTCORBA_DT_FIXED
74 TAO_RT_ORBInitializer (int priority_mapping_type,
75 int network_priority_mapping_type,
76 int ace_sched_policy,
77 long sched_policy,
78 long scope_policy,
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);
86 private:
87 /// Register RTCORBA policy factories.
88 void register_policy_factories (PortableInterceptor::ORBInitInfo_ptr info);
90 private:
91 /// Instance of the RTCorba policy factory.
92 /**
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
128 * THR_SCOPE_PROCESS.
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)
147 #pragma warning(pop)
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 */