Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / PI / ORBInitializer_Registry_Impl.h
blob40156abfe85ec1c8162c2bfd2abb7ecfce30a506
1 // -*- C++ -*-
3 // ===================================================================
4 /**
5 * @file ORBInitializer_Registry_Impl.h
7 * @author Ossama Othman <ossama@uci.edu>
8 */
9 // ===================================================================
11 #ifndef TAO_PI_ORB_INITIALIZER_REGISTRY_IMPL_H
12 #define TAO_PI_ORB_INITIALIZER_REGISTRY_IMPL_H
14 #include /**/ "ace/pre.h"
16 #include "tao/PI/pi_export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "tao/PI/PI.h"
24 #include "tao/CORBA_methods.h"
25 #include "tao/Objref_VarOut_T.h"
26 #include "tao/ORBInitializer_Registry_Adapter.h"
28 #include "ace/Array_Base.h"
29 #include "ace/Service_Config.h"
30 #include "ace/Recursive_Thread_Mutex.h"
32 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
34 namespace TAO
36 /**
37 * @class ORBInitializer_Registry
39 * @brief Global list that contains all portable interceptor ORB
40 * initializers.
42 class ORBInitializer_Registry
43 : public ORBInitializer_Registry_Adapter
45 public:
46 ORBInitializer_Registry ();
48 /// Added to provide registration for the several static service
49 /// objects, brought in with this ORBInitializer_Registry
50 /// implementation. Note that this is more reliable than using
51 /// static initializers, since multiple copies of the dynamic
52 /// service object will require their own (multiple) copies of the
53 /// dependent static service objects. That is just impossible
54 /// without registering those static services in the same repo, the
55 /// dynamic SO is registered with.
56 virtual int init (int, ACE_TCHAR *[]);
58 /// Service config fini method, release all ORBInitializers at this
59 /// moment
60 virtual int fini ();
62 /// Register an ORBInitializer with the underlying ORBInitializer
63 /// array.
64 virtual void register_orb_initializer (
65 PortableInterceptor::ORBInitializer_ptr init);
67 /// Begin initialization of all registered ORBInitializers before
68 /// the ORB itself is initialized.
69 virtual size_t pre_init (TAO_ORB_Core *orb_core,
70 int argc,
71 char *argv[],
72 PortableInterceptor::SlotId &slotid);
74 /// Complete initialization of all registered ORBInitializers after
75 /// the ORB has been initialized.
76 virtual void post_init (size_t pre_init_count,
77 TAO_ORB_Core *orb_core,
78 int argc,
79 char *argv[],
80 PortableInterceptor::SlotId slotid);
82 private:
83 // Prevent copying
84 ORBInitializer_Registry (const ORBInitializer_Registry &) = delete;
85 void operator= (const ORBInitializer_Registry &) = delete;
87 private:
88 TAO_SYNCH_RECURSIVE_MUTEX lock_;
90 /// Dynamic array containing registered ORBInitializers.
91 ACE_Array_Base<PortableInterceptor::ORBInitializer_var> initializers_;
96 ACE_STATIC_SVC_DECLARE (ORBInitializer_Registry)
97 ACE_FACTORY_DECLARE (TAO_PI, ORBInitializer_Registry)
99 TAO_END_VERSIONED_NAMESPACE_DECL
101 #include /**/ "ace/post.h"
103 #endif /* TAO_PI_ORB_INITIALIZER_REGISTRY_IMPL_H */