00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file POA_Current.h 00006 * 00007 * POA_Current.h,v 1.8 2006/03/10 07:19:13 jtc Exp 00008 * 00009 * @author Irfan Pyarali 00010 */ 00011 //============================================================================= 00012 00013 #ifndef TAO_POA_CURRENT_H 00014 #define TAO_POA_CURRENT_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #include "tao/PortableServer/portableserver_export.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 # pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 #include "tao/PortableServer/PS_CurrentC.h" 00025 #include "tao/LocalObject.h" 00026 00027 #if defined(_MSC_VER) 00028 #pragma warning(push) 00029 #pragma warning(disable:4250) 00030 #endif /* _MSC_VER */ 00031 00032 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00033 00034 namespace TAO 00035 { 00036 namespace Portable_Server 00037 { 00038 class POA_Current_Impl; 00039 00040 class TAO_PortableServer_Export POA_Current 00041 : public PortableServer::Current 00042 , public TAO_Local_RefCounted_Object 00043 { 00044 public: 00045 00046 /** 00047 * Returns the POA on which the current request is being invoked. 00048 * Can raise the @c NoContext exception if this function is 00049 * not invoked in the context of an upcall. 00050 */ 00051 PortableServer::POA_ptr get_POA (ACE_ENV_SINGLE_ARG_DECL) 00052 ACE_THROW_SPEC ((CORBA::SystemException, 00053 PortableServer::Current::NoContext)); 00054 00055 /** 00056 * Returns the object id of the current request being invoked. Can 00057 * raise the @c NoContext exception if this function is not 00058 * invoked in the context of an upcall. 00059 */ 00060 PortableServer::ObjectId *get_object_id (ACE_ENV_SINGLE_ARG_DECL) 00061 ACE_THROW_SPEC ((CORBA::SystemException, 00062 PortableServer::Current::NoContext)); 00063 00064 /** 00065 * This operation returns a locally manufactured reference to the object 00066 * in the context of which it is called. If called outside the context 00067 * of a POA dispatched operation, a NoContext exception is raised. 00068 * @note This reference is not guaranteed to be identical to the original 00069 * reference the client used to make the invocation, and calling the 00070 * Object::is_equivalent operation to compare the two references may not 00071 * necessarily return true. 00072 */ 00073 CORBA::Object_ptr get_reference (ACE_ENV_SINGLE_ARG_DECL) 00074 ACE_THROW_SPEC ((CORBA::SystemException, 00075 PortableServer::Current::NoContext)); 00076 00077 /** 00078 * Returns a reference to the servant that hosts the object in whose 00079 * context it is called. If called outside the context of the POA 00080 * dispatched operation, a NoContext exception is raised 00081 */ 00082 PortableServer::Servant get_servant (ACE_ENV_SINGLE_ARG_DECL) 00083 ACE_THROW_SPEC ((CORBA::SystemException, 00084 PortableServer::Current::NoContext)); 00085 00086 /// Returns the class that implements this interface. 00087 POA_Current_Impl *implementation (void); 00088 00089 /// Sets the thread-specific pointer to the new POA Current state, 00090 /// returning a pointer to the existing POA Current state. 00091 POA_Current_Impl *implementation (POA_Current_Impl *new_current); 00092 }; 00093 } 00094 } 00095 00096 TAO_END_VERSIONED_NAMESPACE_DECL 00097 00098 #if defined(_MSC_VER) 00099 #pragma warning(pop) 00100 #endif /* _MSC_VER */ 00101 00102 #include /**/ "ace/post.h" 00103 00104 #endif /* TAO_POA_CURRENT_H */