diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2005-08-22 10:49:31 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2005-08-22 10:49:31 +0000 |
commit | 88ae27844cbf4c2161c86a93af209a3dfb54b092 (patch) | |
tree | 50ce3b40ece04420b074dc4f3aa3a85a5db085b1 /TAO/tao/PortableServer | |
parent | 9e63d8770ba61597ef8f3694bec3e981c1b5b2f3 (diff) | |
download | ATCD-88ae27844cbf4c2161c86a93af209a3dfb54b092.tar.gz |
ChangeLogTag: Mon Aug 22 09:09:12 UTC 2005 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'TAO/tao/PortableServer')
-rw-r--r-- | TAO/tao/PortableServer/POA_Current.cpp | 83 | ||||
-rw-r--r-- | TAO/tao/PortableServer/POA_Current.h | 93 | ||||
-rw-r--r-- | TAO/tao/PortableServer/POA_Current.inl | 14 | ||||
-rw-r--r-- | TAO/tao/PortableServer/POA_Current_Factory.cpp | 32 | ||||
-rw-r--r-- | TAO/tao/PortableServer/POA_Current_Factory.h | 47 | ||||
-rw-r--r-- | TAO/tao/PortableServer/PS_Current.pidl | 51 | ||||
-rw-r--r-- | TAO/tao/PortableServer/PS_CurrentA.cpp | 224 | ||||
-rw-r--r-- | TAO/tao/PortableServer/PS_CurrentC.cpp | 275 | ||||
-rw-r--r-- | TAO/tao/PortableServer/PS_CurrentC.h | 309 | ||||
-rw-r--r-- | TAO/tao/PortableServer/PortableServer.cpp | 5 | ||||
-rw-r--r-- | TAO/tao/PortableServer/PortableServer.h | 1 |
11 files changed, 1134 insertions, 0 deletions
diff --git a/TAO/tao/PortableServer/POA_Current.cpp b/TAO/tao/PortableServer/POA_Current.cpp new file mode 100644 index 00000000000..09a8f02134c --- /dev/null +++ b/TAO/tao/PortableServer/POA_Current.cpp @@ -0,0 +1,83 @@ +// $Id$ + +// -- PortableServer Include -- +#include "POA_Current.h" +#include "POA_Current_Impl.h" + +// -- TAO Include -- +#include "tao/TSS_Resources.h" + +#if !defined (__ACE_INLINE__) +# include "POA_Current.inl" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID (PortableServer, + POA_Current, + "$Id$") + +namespace TAO +{ + namespace Portable_Server + { + PortableServer::POA_ptr + POA_Current::get_POA (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableServer::Current::NoContext)) + { + POA_Current_Impl *impl = this->implementation (); + + if (impl == 0) + ACE_THROW_RETURN (PortableServer::Current::NoContext (), + 0); + return impl->get_POA (); + } + + PortableServer::ObjectId * + POA_Current::get_object_id (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableServer::Current::NoContext)) + { + POA_Current_Impl *impl = this->implementation (); + + if (impl == 0) + ACE_THROW_RETURN (PortableServer::Current::NoContext (), + 0); + return impl->get_object_id (); + } + + PortableServer::Servant + POA_Current::get_servant (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableServer::Current::NoContext)) + { + POA_Current_Impl *impl = this->implementation (); + + if (impl == 0) + ACE_THROW_RETURN (PortableServer::Current::NoContext (), + 0); + return impl->get_servant (); + } + + + POA_Current_Impl * + POA_Current::implementation (void) + { + return static_cast <POA_Current_Impl *> + (TAO_TSS_Resources::instance ()->poa_current_impl_); + } + + POA_Current_Impl * + POA_Current::implementation (POA_Current_Impl *new_current) + { + TAO_TSS_Resources *tss = + TAO_TSS_Resources::instance (); + + POA_Current_Impl *old = + static_cast <POA_Current_Impl *> + (tss->poa_current_impl_); + tss->poa_current_impl_ = new_current; + return old; + } + } +} + diff --git a/TAO/tao/PortableServer/POA_Current.h b/TAO/tao/PortableServer/POA_Current.h new file mode 100644 index 00000000000..a8e5583a101 --- /dev/null +++ b/TAO/tao/PortableServer/POA_Current.h @@ -0,0 +1,93 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file POA_Current.h + * + * $Id$ + * + * @author Irfan Pyarali + */ +//============================================================================= + +#ifndef TAO_POA_CURRENT_H +#define TAO_POA_CURRENT_H + +#include /**/ "ace/pre.h" + +#include "portableserver_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/LocalObject.h" +#include "tao/PortableServer/PS_CurrentC.h" + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +namespace TAO +{ + namespace Portable_Server + { + class POA_Current_Impl; + + class TAO_PortableServer_Export POA_Current + : public PortableServer::Current, + public TAO_Local_RefCounted_Object + { + public: + /// Constructor + POA_Current (void); + + /** + * Returns the POA on which the current request is being invoked. + * Can raise the @c NoContext exception if this function is + * not invoked in the context of an upcall. + */ + PortableServer::POA_ptr get_POA (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableServer::Current::NoContext)); + + /** + * Returns the object id of the current request being invoked. Can + * raise the @c NoContext exception if this function is not + * invoked in the context of an upcall. + */ + PortableServer::ObjectId *get_object_id (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableServer::Current::NoContext)); + + /** + * Returns a reference to the servant that hosts the object in whose + * context it is called. If called outside the context of the POA + * dispatched operation, a NoContext exception is raised + */ + PortableServer::Servant get_servant (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableServer::Current::NoContext)); + + /// Returns the class that implements this interface. + POA_Current_Impl *implementation (void); + + /// Sets the thread-specific pointer to the new POA Current state, + /// returning a pointer to the existing POA Current state. + POA_Current_Impl *implementation (POA_Current_Impl *new_current); + }; + } +} + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__ACE_INLINE__) +# include "POA_Current.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* TAO_POA_CURRENT_H */ diff --git a/TAO/tao/PortableServer/POA_Current.inl b/TAO/tao/PortableServer/POA_Current.inl new file mode 100644 index 00000000000..4b713846977 --- /dev/null +++ b/TAO/tao/PortableServer/POA_Current.inl @@ -0,0 +1,14 @@ +// -*- C++ -*- +// +// $Id$ + +namespace TAO +{ + namespace Portable_Server + { + ACE_INLINE + POA_Current::POA_Current (void) + { + } + } +} diff --git a/TAO/tao/PortableServer/POA_Current_Factory.cpp b/TAO/tao/PortableServer/POA_Current_Factory.cpp new file mode 100644 index 00000000000..b32ba5f91b0 --- /dev/null +++ b/TAO/tao/PortableServer/POA_Current_Factory.cpp @@ -0,0 +1,32 @@ +// $Id$ + +#include "POA_Current_Factory.h" +#include "POA_Current.h" +#include "tao/ORB_Core.h" + +TAO_POA_Current_Factory::TAO_POA_Current_Factory (void) +{ +} + +CORBA::Object_ptr +TAO_POA_Current_Factory::create_object (CORBA::ORB_ptr, + int, + ACE_TCHAR * [] + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + TAO::Portable_Server::POA_Current* adapter = 0; + ACE_NEW_RETURN (adapter, + TAO::Portable_Server::POA_Current (), + 0); + return adapter; +} + +ACE_FACTORY_DEFINE (TAO_PortableServer, TAO_POA_Current_Factory) +ACE_STATIC_SVC_DEFINE (TAO_POA_Current_Factory, + ACE_TEXT ("TAO_POA_Current_Factory"), + ACE_SVC_OBJ_T, + &ACE_SVC_NAME (TAO_POA_Current_Factory), + ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, + 0) + diff --git a/TAO/tao/PortableServer/POA_Current_Factory.h b/TAO/tao/PortableServer/POA_Current_Factory.h new file mode 100644 index 00000000000..c7cbb6d2e2a --- /dev/null +++ b/TAO/tao/PortableServer/POA_Current_Factory.h @@ -0,0 +1,47 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file POA_Current_Factory.h + * + * $Id$ + * + * @author Johnny Willemsen <jwillemsen@remedy.nl> + */ +//============================================================================= + +#ifndef TAO_POA_CURRENT_FACTORY_H +#define TAO_POA_CURRENT_FACTORY_H + +#include /**/ "ace/pre.h" + +#include "portableserver_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/Object_Loader.h" +#include "ace/Service_Config.h" + +class TAO_PortableServer_Export TAO_POA_Current_Factory + : public TAO_Object_Loader +{ +public: + /// Constructor + TAO_POA_Current_Factory (void); + + /// Creates a PICurrent and returns it. + virtual CORBA::Object_ptr create_object (CORBA::ORB_ptr orb, + int argc, + ACE_TCHAR *argv [] + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); +}; + +ACE_STATIC_SVC_DECLARE (TAO_POA_Current_Factory) +ACE_FACTORY_DECLARE (TAO_PortableServer, TAO_POA_Current_Factory) + +#include /**/ "ace/post.h" + +#endif /* TAO_OBJECT_ADAPTER_FACTORY_H */ diff --git a/TAO/tao/PortableServer/PS_Current.pidl b/TAO/tao/PortableServer/PS_Current.pidl new file mode 100644 index 00000000000..a1b7ab68b61 --- /dev/null +++ b/TAO/tao/PortableServer/PS_Current.pidl @@ -0,0 +1,51 @@ +/** + * @file PS_Current.pidl + * + * $Id$ + * + * @brief Pre-compiled IDL source for the PortableServer module. + * + * This file was used to generate the code in + * PS_CurrentC.{h,inl,cpp}, using the following command: + * + * tao_idl.exe \ + * -o orig -Gp -Gd -Ge 1 -Sci -Sc -GA -I$(TAO_ROOT) + * -Wb,export_macro=TAO_PortableServer_Export \ + * -Wb,export_include="portableserver_export.h" \ + * -Wb,pre_include="ace/pre.h" \ + * -Wb,post_include="ace/post.h" \ + * PS_Current.pidl + */ + +#ifndef _PORTABLESERVER_CURRENT_IDL_ +#define _PORTABLESERVER_CURRENT_IDL_ + +///FUZZ: disable check_for_include/ +#include <tao/PortableServer/PS_Forward.pidl> +#include <Current.pidl> + +#pragma prefix "omg.org" + +module PortableServer +{ +# pragma version PortableServer 2.3 + + // Current interface. + local interface Current : CORBA::Current + { +# pragma version Current 2.3 + + exception NoContext {}; + + POA get_POA () + raises (NoContext); + + ObjectId get_object_id () + raises (NoContext); + + Servant get_servant () + raises (NoContext); + }; +}; + +#endif // _PORTABLESERVER_CURRENT_IDL_ diff --git a/TAO/tao/PortableServer/PS_CurrentA.cpp b/TAO/tao/PortableServer/PS_CurrentA.cpp new file mode 100644 index 00000000000..05de30be3a2 --- /dev/null +++ b/TAO/tao/PortableServer/PS_CurrentA.cpp @@ -0,0 +1,224 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "PS_CurrentC.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Objref_TypeCode_Static.h" +#include "tao/AnyTypeCode/Struct_TypeCode_Static.h" +#include "tao/AnyTypeCode/TypeCode_Struct_Field.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Impl_T.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + +static TAO::TypeCode::Struct_Field<char const *, CORBA::TypeCode_ptr const *> const * const _tao_fields_PortableServer_Current_NoContext = 0; +static TAO::TypeCode::Struct<char const *, + CORBA::TypeCode_ptr const *, + TAO::TypeCode::Struct_Field<char const *, CORBA::TypeCode_ptr const *> const *, + TAO::Null_RefCount_Policy> + _tao_tc_PortableServer_Current_NoContext ( + CORBA::tk_except, + "IDL:omg.org/PortableServer/Current/NoContext:2.3", + "NoContext", + _tao_fields_PortableServer_Current_NoContext, + 0); + +::CORBA::TypeCode_ptr const PortableServer::Current::_tc_NoContext = + &_tao_tc_PortableServer_Current_NoContext; + +// TAO_IDL - Generated from +// be\be_visitor_typecode/objref_typecode.cpp:76 + +static TAO::TypeCode::Objref<char const *, + TAO::Null_RefCount_Policy> + _tao_tc_PortableServer_Current ( + CORBA::tk_local_interface, + "IDL:omg.org/PortableServer/Current:2.3", + "Current"); + +namespace PortableServer +{ + ::CORBA::TypeCode_ptr const _tc_Current = + &_tao_tc_PortableServer_Current; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_interface/any_op_cs.cpp:50 + +namespace TAO +{ + template<> + CORBA::Boolean + Any_Impl_T<PortableServer::Current>::to_object ( + CORBA::Object_ptr &_tao_elem + ) const + { + _tao_elem = CORBA::Object::_duplicate (this->value_); + return true; + } +} + +namespace TAO +{ + template<> + CORBA::Boolean + Any_Impl_T<PortableServer::Current>::marshal_value (TAO_OutputCDR &) + { + return false; + } + + template<> + CORBA::Boolean + Any_Impl_T<PortableServer::Current>::demarshal_value (TAO_InputCDR &) + { + return false; + } +} + +// Copying insertion. +void +operator<<= ( + CORBA::Any &_tao_any, + PortableServer::Current_ptr _tao_elem + ) +{ + PortableServer::Current_ptr _tao_objptr = + PortableServer::Current::_duplicate (_tao_elem); + _tao_any <<= &_tao_objptr; +} + +// Non-copying insertion. +void +operator<<= ( + CORBA::Any &_tao_any, + PortableServer::Current_ptr *_tao_elem + ) +{ + TAO::Any_Impl_T<PortableServer::Current>::insert ( + _tao_any, + PortableServer::Current::_tao_any_destructor, + PortableServer::_tc_Current, + *_tao_elem + ); +} + +CORBA::Boolean +operator>>= ( + const CORBA::Any &_tao_any, + PortableServer::Current_ptr &_tao_elem + ) +{ + return + TAO::Any_Impl_T<PortableServer::Current>::extract ( + _tao_any, + PortableServer::Current::_tao_any_destructor, + PortableServer::_tc_Current, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_exception/any_op_cs.cpp:50 + +namespace TAO +{ + template<> + CORBA::Boolean + Any_Dual_Impl_T<PortableServer::Current::NoContext>::marshal_value (TAO_OutputCDR &) + { + return false; + } + + template<> + CORBA::Boolean + Any_Dual_Impl_T<PortableServer::Current::NoContext>::demarshal_value (TAO_InputCDR &) + { + return false; + } +} + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const PortableServer::Current::NoContext &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T<PortableServer::Current::NoContext>::insert_copy ( + _tao_any, + PortableServer::Current::NoContext::_tao_any_destructor, + PortableServer::Current::_tc_NoContext, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + PortableServer::Current::NoContext *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T<PortableServer::Current::NoContext>::insert ( + _tao_any, + PortableServer::Current::NoContext::_tao_any_destructor, + PortableServer::Current::_tc_NoContext, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + PortableServer::Current::NoContext *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const PortableServer::Current::NoContext *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const PortableServer::Current::NoContext *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T<PortableServer::Current::NoContext>::extract ( + _tao_any, + PortableServer::Current::NoContext::_tao_any_destructor, + PortableServer::Current::_tc_NoContext, + _tao_elem + ); +} diff --git a/TAO/tao/PortableServer/PS_CurrentC.cpp b/TAO/tao/PortableServer/PS_CurrentC.cpp new file mode 100644 index 00000000000..92de45c9df6 --- /dev/null +++ b/TAO/tao/PortableServer/PS_CurrentC.cpp @@ -0,0 +1,275 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:291 + + +#include "PS_CurrentC.h" +#include "tao/CDR.h" +#include "ace/OS_NS_string.h" + +#if defined (__BORLANDC__) +#pragma option -w-rvl -w-rch -w-ccc -w-aus -w-sig +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_arg_traits.cpp:70 + +// Arg traits specializations. +namespace TAO +{ +} + + +// TAO_IDL - Generated from +// be\be_visitor_interface/interface_cs.cpp:60 + +// Traits specializations for PortableServer::Current. + +PortableServer::Current_ptr +TAO::Objref_Traits<PortableServer::Current>::duplicate ( + PortableServer::Current_ptr p + ) +{ + return PortableServer::Current::_duplicate (p); +} + +void +TAO::Objref_Traits<PortableServer::Current>::release ( + PortableServer::Current_ptr p + ) +{ + CORBA::release (p); +} + +PortableServer::Current_ptr +TAO::Objref_Traits<PortableServer::Current>::nil (void) +{ + return PortableServer::Current::_nil (); +} + +CORBA::Boolean +TAO::Objref_Traits<PortableServer::Current>::marshal ( + PortableServer::Current_ptr p, + TAO_OutputCDR & cdr + ) +{ + return CORBA::Object::marshal (p, cdr); +} + +// TAO_IDL - Generated from +// be\be_visitor_exception/exception_cs.cpp:63 + +PortableServer::Current::NoContext::NoContext (void) + : CORBA::UserException ( + "IDL:omg.org/PortableServer/Current/NoContext:2.3", + "NoContext" + ) +{ +} + +PortableServer::Current::NoContext::~NoContext (void) +{ +} + +PortableServer::Current::NoContext::NoContext (const ::PortableServer::Current::NoContext &_tao_excp) + : CORBA::UserException ( + _tao_excp._rep_id (), + _tao_excp._name () + ) +{ +} + +PortableServer::Current::NoContext& +PortableServer::Current::NoContext::operator= (const ::PortableServer::Current::NoContext &_tao_excp) +{ + this->ACE_NESTED_CLASS (CORBA, UserException)::operator= (_tao_excp); + return *this; +} + +void PortableServer::Current::NoContext::_tao_any_destructor (void *_tao_void_pointer) +{ + NoContext *_tao_tmp_pointer = + static_cast<NoContext *> (_tao_void_pointer); + delete _tao_tmp_pointer; +} + +PortableServer::Current::NoContext * +PortableServer::Current::NoContext::_downcast (CORBA::Exception *_tao_excp) +{ + return dynamic_cast<NoContext *> (_tao_excp); +} + +const PortableServer::Current::NoContext * +PortableServer::Current::NoContext::_downcast (CORBA::Exception const *_tao_excp) +{ + return dynamic_cast<const NoContext *> (_tao_excp); +} + +CORBA::Exception *PortableServer::Current::NoContext::_alloc (void) +{ + CORBA::Exception *retval = 0; + ACE_NEW_RETURN (retval, ::PortableServer::Current::NoContext, 0); + return retval; +} + +CORBA::Exception * +PortableServer::Current::NoContext::_tao_duplicate (void) const +{ + CORBA::Exception *result = 0; + ACE_NEW_RETURN ( + result, + ::PortableServer::Current::NoContext (*this), + 0 + ); + return result; +} + +void PortableServer::Current::NoContext::_raise (void) const +{ + TAO_RAISE (*this); +} + +void PortableServer::Current::NoContext::_tao_encode ( + TAO_OutputCDR & + ACE_ENV_ARG_DECL + ) const +{ + ACE_THROW (CORBA::MARSHAL ()); +} + +void PortableServer::Current::NoContext::_tao_decode ( + TAO_InputCDR & + ACE_ENV_ARG_DECL + ) +{ + ACE_THROW (CORBA::MARSHAL ()); +} + +// TAO extension - the virtual _type method. +CORBA::TypeCode_ptr PortableServer::Current::NoContext::_tao_type (void) const +{ + return ::PortableServer::Current::_tc_NoContext; +} + +PortableServer::Current::Current (void) +{} + +PortableServer::Current::~Current (void) +{} + +void +PortableServer::Current::_tao_any_destructor (void *_tao_void_pointer) +{ + Current *_tao_tmp_pointer = + static_cast<Current *> (_tao_void_pointer); + CORBA::release (_tao_tmp_pointer); +} + +PortableServer::Current_ptr +PortableServer::Current::_narrow ( + CORBA::Object_ptr _tao_objref + ACE_ENV_ARG_DECL_NOT_USED + ) +{ + return Current::_duplicate ( + dynamic_cast<Current_ptr> (_tao_objref) + ); +} + +PortableServer::Current_ptr +PortableServer::Current::_unchecked_narrow ( + CORBA::Object_ptr _tao_objref + ACE_ENV_ARG_DECL_NOT_USED + ) +{ + return Current::_duplicate ( + dynamic_cast<Current_ptr> (_tao_objref) + ); +} + +PortableServer::Current_ptr +PortableServer::Current::_duplicate (Current_ptr obj) +{ + if (! CORBA::is_nil (obj)) + { + obj->_add_ref (); + } + + return obj; +} + +void +PortableServer::Current::_tao_release (Current_ptr obj) +{ + CORBA::release (obj); +} + +CORBA::Boolean +PortableServer::Current::_is_a ( + const char *value + ACE_ENV_ARG_DECL_NOT_USED + ) +{ + if ( + !ACE_OS::strcmp ( + value, + "IDL:omg.org/CORBA/Current:1.0" + ) || + !ACE_OS::strcmp ( + value, + "IDL:omg.org/PortableServer/Current:2.3" + ) || + !ACE_OS::strcmp ( + value, + "IDL:omg.org/CORBA/LocalObject:1.0" + ) || + !ACE_OS::strcmp ( + value, + "IDL:omg.org/CORBA/Object:1.0" + ) + ) + { + return true; // success using local knowledge + } + else + { + return false; + } +} + +const char* PortableServer::Current::_interface_repository_id (void) const +{ + return "IDL:omg.org/PortableServer/Current:2.3"; +} + +CORBA::Boolean +PortableServer::Current::marshal (TAO_OutputCDR &) +{ + return false; +} diff --git a/TAO/tao/PortableServer/PS_CurrentC.h b/TAO/tao/PortableServer/PS_CurrentC.h new file mode 100644 index 00000000000..69ac3faaf4d --- /dev/null +++ b/TAO/tao/PortableServer/PS_CurrentC.h @@ -0,0 +1,309 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_PS_CURRENTC_H_ +#define _TAO_IDL_ORIG_PS_CURRENTC_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/PortableServer/portableserver_export.h" +#include "tao/ORB.h" +#include "tao/SystemException.h" +#include "tao/Environment.h" +#include "tao/Object.h" +#include "tao/Objref_VarOut_T.h" + +#include "tao/PortableServer/PS_ForwardC.h" +#include "tao/CurrentC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_PortableServer_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace PortableServer +{ + + // TAO_IDL - Generated from + // be\be_interface.cpp:598 + +#if !defined (_PORTABLESERVER_CURRENT__VAR_OUT_CH_) +#define _PORTABLESERVER_CURRENT__VAR_OUT_CH_ + + class Current; + typedef Current *Current_ptr; + + typedef + TAO_Objref_Var_T< + Current + > + Current_var; + + typedef + TAO_Objref_Out_T< + Current + > + Current_out; + +#endif /* end #if !defined */ + + // TAO_IDL - Generated from + // be\be_visitor_interface/interface_ch.cpp:54 + +#if !defined (_PORTABLESERVER_CURRENT_CH_) +#define _PORTABLESERVER_CURRENT_CH_ + + class TAO_PortableServer_Export Current + : public virtual ::CORBA::Current + { + public: + typedef Current_ptr _ptr_type; + typedef Current_var _var_type; + + // The static operations. + static Current_ptr _duplicate (Current_ptr obj); + + static void _tao_release (Current_ptr obj); + + static Current_ptr _narrow ( + CORBA::Object_ptr obj + ACE_ENV_ARG_DECL_WITH_DEFAULTS + ); + + static Current_ptr _unchecked_narrow ( + CORBA::Object_ptr obj + ACE_ENV_ARG_DECL_WITH_DEFAULTS + ); + + static Current_ptr _nil (void) + { + return static_cast<Current_ptr> (0); + } + + static void _tao_any_destructor (void *); + + // TAO_IDL - Generated from + // be\be_visitor_exception/exception_ch.cpp:53 + +#if !defined (_PORTABLESERVER_CURRENT_NOCONTEXT_CH_) +#define _PORTABLESERVER_CURRENT_NOCONTEXT_CH_ + + class TAO_PortableServer_Export NoContext : public CORBA::UserException + { + public: + + NoContext (void); + NoContext (const NoContext &); + ~NoContext (void); + + NoContext &operator= (const NoContext &); + + static void _tao_any_destructor (void *); + + static NoContext *_downcast (CORBA::Exception *); + static const NoContext *_downcast (CORBA::Exception const *); + + static CORBA::Exception *_alloc (void); + + virtual CORBA::Exception *_tao_duplicate (void) const; + + virtual void _raise (void) const; + + virtual void _tao_encode ( + TAO_OutputCDR & + ACE_ENV_ARG_DECL + ) const; + + virtual void _tao_decode ( + TAO_InputCDR & + ACE_ENV_ARG_DECL + ); + + // TAO_IDL - Generated from + // be\be_visitor_exception/exception_ch.cpp:129 + + virtual CORBA::TypeCode_ptr _tao_type (void) const; + }; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + static ::CORBA::TypeCode_ptr const _tc_NoContext; + +#endif /* end #if !defined */ + + // TAO_IDL - Generated from + // be\be_visitor_operation/operation_ch.cpp:46 + + virtual ::PortableServer::POA_ptr get_POA ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + ::PortableServer::Current::NoContext + )) = 0; + + // TAO_IDL - Generated from + // be\be_visitor_operation/operation_ch.cpp:46 + + virtual ::PortableServer::ObjectId * get_object_id ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + ::PortableServer::Current::NoContext + )) = 0; + + // TAO_IDL - Generated from + // be\be_visitor_operation/operation_ch.cpp:46 + + virtual ::PortableServer::Servant get_servant ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + ::PortableServer::Current::NoContext + )) = 0; + + // TAO_IDL - Generated from + // be\be_visitor_interface/interface_ch.cpp:210 + + virtual CORBA::Boolean _is_a ( + const char *type_id + ACE_ENV_ARG_DECL_WITH_DEFAULTS + ); + + virtual const char* _interface_repository_id (void) const; + virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); + + protected: + // Abstract or local interface only. + Current (void); + + virtual ~Current (void); + + private: + // Private and unimplemented for concrete interfaces. + Current (const Current &); + + void operator= (const Current &); + }; + +#endif /* end #if !defined */ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_PortableServer_Export ::CORBA::TypeCode_ptr const _tc_Current; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module PortableServer + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ + +#if !defined (_PORTABLESERVER_CURRENT__TRAITS_CH_) +#define _PORTABLESERVER_CURRENT__TRAITS_CH_ + + template<> + struct TAO_PortableServer_Export Objref_Traits< ::PortableServer::Current> + { + static ::PortableServer::Current_ptr duplicate ( + ::PortableServer::Current_ptr + ); + static void release ( + ::PortableServer::Current_ptr + ); + static ::PortableServer::Current_ptr nil (void); + static CORBA::Boolean marshal ( + ::PortableServer::Current_ptr p, + TAO_OutputCDR & cdr + ); + }; + +#endif /* end #if !defined */ +} + +// TAO_IDL - Generated from +// be\be_visitor_interface/any_op_ch.cpp:52 + +TAO_PortableServer_Export void operator<<= (CORBA::Any &, PortableServer::Current_ptr); // copying +TAO_PortableServer_Export void operator<<= (CORBA::Any &, PortableServer::Current_ptr *); // non-copying +TAO_PortableServer_Export CORBA::Boolean operator>>= (const CORBA::Any &, PortableServer::Current_ptr &); + +// TAO_IDL - Generated from +// be\be_visitor_exception/any_op_ch.cpp:52 + +TAO_PortableServer_Export void operator<<= (CORBA::Any &, const PortableServer::Current::NoContext &); // copying version +TAO_PortableServer_Export void operator<<= (CORBA::Any &, PortableServer::Current::NoContext*); // noncopying version +TAO_PortableServer_Export CORBA::Boolean operator>>= (const CORBA::Any &, PortableServer::Current::NoContext *&); // deprecated +TAO_PortableServer_Export CORBA::Boolean operator>>= (const CORBA::Any &, const PortableServer::Current::NoContext *&); + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/PortableServer/PortableServer.cpp b/TAO/tao/PortableServer/PortableServer.cpp index 22d7b1879a8..2517081b640 100644 --- a/TAO/tao/PortableServer/PortableServer.cpp +++ b/TAO/tao/PortableServer/PortableServer.cpp @@ -2,6 +2,7 @@ #include "PortableServer.h" #include "Object_Adapter.h" #include "Object_Adapter_Factory.h" +#include "POA_Current_Factory.h" #include "ThreadStrategyFactoryImpl.h" #include "LifespanStrategyFactoryImpl.h" @@ -160,6 +161,10 @@ TAO_POA_Initializer::init (void) ); #endif /* TAO_HAS_MINIMUM_POA == 0 */ + ACE_Service_Config::process_directive ( + ace_svc_desc_TAO_POA_Current_Factory + ); + return ACE_Service_Config::process_directive ( ace_svc_desc_TAO_Object_Adapter_Factory diff --git a/TAO/tao/PortableServer/PortableServer.h b/TAO/tao/PortableServer/PortableServer.h index 22bbb1dece3..53681e20560 100644 --- a/TAO/tao/PortableServer/PortableServer.h +++ b/TAO/tao/PortableServer/PortableServer.h @@ -35,6 +35,7 @@ TAO_Requires_POA_Initializer = TAO_POA_Initializer::init (); #include "PortableServerC.h" #undef TAO_PORTABLESERVER_SAFE_INCLUDE #include "POAManagerC.h" +#include "PS_CurrentC.h" #include "PortableServer_Functions.h" #include "PortableServer_WFunctions.h" #include "PS_ForwardA.h" |