Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / PortableServer / POA_Current.h
blob3c014c7ece7ba71f56b7cd3d4dc7a209dad4e079
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file POA_Current.h
7 * @author Irfan Pyarali
8 */
9 //=============================================================================
11 #ifndef TAO_POA_CURRENT_H
12 #define TAO_POA_CURRENT_H
14 #include /**/ "ace/pre.h"
16 #include "tao/PortableServer/portableserver_export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "tao/PortableServer/PS_CurrentC.h"
23 #include "tao/LocalObject.h"
25 #if defined(_MSC_VER)
26 #pragma warning(push)
27 #pragma warning(disable:4250)
28 #endif /* _MSC_VER */
30 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
32 namespace TAO
34 namespace Portable_Server
36 class POA_Current_Impl;
38 class TAO_PortableServer_Export POA_Current
39 : public PortableServer::Current
40 , public ::CORBA::LocalObject
42 public:
43 /**
44 * Returns the POA on which the current request is being invoked.
45 * Can raise the @c NoContext exception if this function is
46 * not invoked in the context of an upcall.
48 PortableServer::POA_ptr get_POA ();
50 /**
51 * Returns the object id of the current request being invoked. Can
52 * raise the @c NoContext exception if this function is not
53 * invoked in the context of an upcall.
55 PortableServer::ObjectId *get_object_id ();
57 /**
58 * This operation returns a locally manufactured reference to the object
59 * in the context of which it is called. If called outside the context
60 * of a POA dispatched operation, a NoContext exception is raised.
61 * @note This reference is not guaranteed to be identical to the original
62 * reference the client used to make the invocation, and calling the
63 * Object::is_equivalent operation to compare the two references may not
64 * necessarily return true.
66 CORBA::Object_ptr get_reference ();
68 /**
69 * Returns a reference to the servant that hosts the object in whose
70 * context it is called. If called outside the context of the POA
71 * dispatched operation, a NoContext exception is raised
73 PortableServer::Servant get_servant ();
75 /// Returns the class that implements this interface.
76 POA_Current_Impl *implementation ();
78 /// Sets the thread-specific pointer to the new POA Current state,
79 /// returning a pointer to the existing POA Current state.
80 POA_Current_Impl *implementation (POA_Current_Impl *new_current);
85 TAO_END_VERSIONED_NAMESPACE_DECL
87 #if defined(_MSC_VER)
88 #pragma warning(pop)
89 #endif /* _MSC_VER */
91 #include /**/ "ace/post.h"
93 #endif /* TAO_POA_CURRENT_H */