Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / PortableServer / POAManager.h
bloba589b63c4d0109ca091574252c2c17e9f308481b
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file POAManager.h
7 * POAManager
9 * @author Irfan Pyarali
11 //=============================================================================
13 #ifndef TAO_POAMANAGER_H
14 #define TAO_POAMANAGER_H
15 #include /**/ "ace/pre.h"
17 #include "tao/PortableServer/portableserver_export.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "tao/PortableServer/poa_macros.h"
24 #include "tao/PortableServer/POAManagerC.h"
26 // Local Object
27 #include "tao/LocalObject.h"
28 #include "tao/PI_ForwardC.h"
29 #include "ace/Unbounded_Set.h"
31 // This is to remove "inherits via dominance" warnings from MSVC.
32 // MSVC is being a little too paranoid.
33 #if defined(_MSC_VER)
34 #pragma warning(push)
35 #pragma warning(disable:4250)
36 #endif /* _MSC_VER */
38 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
40 // Forward decl.
41 class TAO_Root_POA;
42 class TAO_Object_Adapter;
44 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
45 class TAO_POAManager_Factory;
47 namespace PortableServer
49 class POAManagerFactory;
50 typedef POAManagerFactory *POAManagerFactory_ptr;
52 #endif
54 class TAO_PortableServer_Export TAO_POA_Manager :
55 public PortableServer::POAManager,
56 public ::CORBA::LocalObject
58 friend class TAO_Root_POA;
59 friend class TAO_Object_Adapter;
61 public:
62 void activate ();
64 #if (TAO_HAS_MINIMUM_POA == 0)
66 void hold_requests (CORBA::Boolean wait_for_completion);
68 void discard_requests (CORBA::Boolean wait_for_completion);
70 void deactivate (CORBA::Boolean etherealize_objects,
71 CORBA::Boolean wait_for_completion);
73 #endif /* TAO_HAS_MINIMUM_POA == 0 */
75 PortableServer::POAManager::State get_state ();
77 char *get_id ();
79 TAO_POA_Manager (TAO_Object_Adapter &object_adapter,
80 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
81 const char * id,
82 const ::CORBA::PolicyList & policies,
83 PortableServer::POAManagerFactory_ptr poa_manager_factory);
84 #else
85 const char * id);
86 #endif
88 ~TAO_POA_Manager ();
90 /// Check the state of this POA manager
91 void check_state ();
93 PortableServer::POAManager::State get_state_i ();
95 virtual CORBA::ORB_ptr _get_orb ();
97 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
98 CORBA::PolicyList& get_policies ();
99 #endif
101 protected:
102 void activate_i ();
104 void deactivate_i (CORBA::Boolean etherealize_objects,
105 CORBA::Boolean wait_for_completion);
107 /// Method needed for notifying the IORInterceptors that the state
108 /// of POAManager changed.
109 void adapter_manager_state_changed (PortableServer::POAManager::State state);
111 #if (TAO_HAS_MINIMUM_POA == 0)
113 void hold_requests_i (CORBA::Boolean wait_for_completion);
115 void discard_requests_i (CORBA::Boolean wait_for_completion);
117 #endif /* TAO_HAS_MINIMUM_POA == 0 */
119 ACE_Lock &lock ();
121 int remove_poa (TAO_Root_POA *poa);
123 int register_poa (TAO_Root_POA *poa);
125 protected:
126 PortableServer::POAManager::State state_;
128 ACE_Lock &lock_;
130 typedef ACE_Unbounded_Set<TAO_Root_POA *> POA_COLLECTION;
132 POA_COLLECTION poa_collection_;
134 TAO_Object_Adapter &object_adapter_;
136 CORBA::String_var id_;
138 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
139 TAO_POAManager_Factory& poa_manager_factory_;
140 CORBA::PolicyList policies_;
141 #endif
143 private :
145 * Generate an id for this POAManager.
146 * @return A value that uniquely identifies the POAManager within a
147 * given process.
148 * @note: The id_ has the ownership of the memory allocated in this method.
150 char* generate_manager_id () const;
153 TAO_END_VERSIONED_NAMESPACE_DECL
155 #if defined(_MSC_VER)
156 #pragma warning(pop)
157 #endif /* _MSC_VER */
159 #if defined (__ACE_INLINE__)
160 # include "tao/PortableServer/POAManager.inl"
161 #endif /* __ACE_INLINE__ */
163 #include /**/ "ace/post.h"
164 #endif /* TAO_POAMANAGER_H */