Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Adapter_Registry.h
blobbdca283d9a2f97215b54bebbf7ea6089e8f77936
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Adapter_Registry.h
7 * @author Carlos O'Ryan (coryan@uci.edu)
8 */
9 //=============================================================================
11 #ifndef TAO_ADAPTER_REGISTRY_H
12 #define TAO_ADAPTER_REGISTRY_H
14 #include /**/ "ace/pre.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
17 # pragma once
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
20 #include "tao/CORBA_methods.h"
22 #if defined(_MSC_VER)
23 #pragma warning(push)
24 #pragma warning(disable:4250)
25 #endif /* _MSC_VER */
27 #include "tao/Pseudo_VarOut_T.h"
29 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
31 namespace CORBA
33 typedef TAO_Pseudo_Var_T<Object> Object_var;
34 typedef TAO_Pseudo_Out_T<Object> Object_out;
37 namespace TAO
39 class ObjectKey;
42 class TAO_ORB_Core;
43 class TAO_Stub;
44 class TAO_MProfile;
45 class TAO_ServerRequest;
46 class TAO_Adapter;
48 class TAO_Export TAO_Adapter_Registry
50 public:
51 explicit TAO_Adapter_Registry (TAO_ORB_Core *);
53 /// Close the
54 ~TAO_Adapter_Registry ();
56 /**
57 * Close each of of the Adapters and then cleanup the Registry.
58 * It is possible that an Adapter will reject a close() call if it
59 * is invoked in an inappropriate context (think shutting down the
60 * POA while performing an upcall).
62 void close (int wait_for_completion);
64 /**
65 * Verify if the close() call can be invoked in the current
66 * context for *all* adapters.
67 * Raise the right exception if not.
69 void check_close (int wait_for_completion);
71 /// Insert a new adapter into the registry.
72 void insert (TAO_Adapter *adapter);
74 /**
75 * Dispatch the request to all the adapters.
76 * It tries the adapters ordered by priority, stopping when the
77 * adapter returns a status different from DS_MISMATCHED_KEY
79 void dispatch (TAO::ObjectKey &key,
80 TAO_ServerRequest &request,
81 CORBA::Object_out forward_to);
83 /// Create a collocated object using the given profile and stub.
84 CORBA::Object_ptr create_collocated_object (TAO_Stub *, const TAO_MProfile &);
86 /// Initialize a collocated object using the given stub and object
87 /// pointer for lazily evaluated object references.
88 CORBA::Long initialize_collocated_object (TAO_Stub *);
90 /// Fetch the adapter named @a name
91 TAO_Adapter *find_adapter (const char *name) const;
93 private:
94 TAO_Adapter_Registry (const TAO_Adapter_Registry &) = delete;
95 TAO_Adapter_Registry &operator= (const TAO_Adapter_Registry &) = delete;
97 /**
98 * @name A simple array of adapters.
100 //@{
101 size_t adapters_capacity_;
102 size_t adapters_count_;
103 TAO_Adapter **adapters_;
104 //@}
107 TAO_END_VERSIONED_NAMESPACE_DECL
109 #if defined(_MSC_VER)
110 #pragma warning(pop)
111 #endif /* _MSC_VER */
113 #include /**/ "ace/post.h"
115 #endif /* TAO_ADAPTER_REGISTRY_H */