3 //=============================================================================
7 * @author Irfan Pyarali
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)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "tao/PortableServer/PS_CurrentC.h"
23 #include "tao/LocalObject.h"
27 #pragma warning(disable:4250)
30 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
34 namespace Portable_Server
36 class POA_Current_Impl
;
38 class TAO_PortableServer_Export POA_Current
39 : public PortableServer::Current
40 , public ::CORBA::LocalObject
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 ();
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 ();
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 ();
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
91 #include /**/ "ace/post.h"
93 #endif /* TAO_POA_CURRENT_H */