diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2003-08-27 21:54:06 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2003-08-27 21:54:06 +0000 |
commit | f0bc191dfcbf179e565ceff5ddb04741528ecad2 (patch) | |
tree | c79ba5a76d5fe4fccd5d6b2eeb1d2eb45ccc6b75 /TAO/tao | |
parent | dafbfcc42281974f217ee7df611d5e6197737b88 (diff) | |
download | ATCD-f0bc191dfcbf179e565ceff5ddb04741528ecad2.tar.gz |
ChangeLogTag:Wed Aug 27 14:48:17 2003 Ossama Othman <ossama@dre.vanderbilt.edu>
Diffstat (limited to 'TAO/tao')
-rw-r--r-- | TAO/tao/ClientRequestInfo_i.h | 3 | ||||
-rw-r--r-- | TAO/tao/DLL_ORB.h | 21 | ||||
-rw-r--r-- | TAO/tao/ORBInitInfo.cpp | 209 | ||||
-rw-r--r-- | TAO/tao/ORBInitInfo.h | 76 | ||||
-rw-r--r-- | TAO/tao/Objref_VarOut_T.h | 3 | ||||
-rw-r--r-- | TAO/tao/corba.h | 20 |
6 files changed, 108 insertions, 224 deletions
diff --git a/TAO/tao/ClientRequestInfo_i.h b/TAO/tao/ClientRequestInfo_i.h index a99aba6d85d..adde6372496 100644 --- a/TAO/tao/ClientRequestInfo_i.h +++ b/TAO/tao/ClientRequestInfo_i.h @@ -9,7 +9,7 @@ * This is the implementation of the * PortableInterceptor::ClientRequestInfo interface. * - * @author Ossama Othman <ossama@uci.edu> + * @author Ossama Othman <ossama@dre.vanderbilt.edu> * @author Kirthika Parameswaran <kirthika@cs.wustl.edu> */ //============================================================================= @@ -28,7 +28,6 @@ #if (TAO_HAS_INTERCEPTORS == 1) #include "tao/PortableInterceptorC.h" -#include "tao/StringSeqC.h" #include "tao/PICurrent.h" diff --git a/TAO/tao/DLL_ORB.h b/TAO/tao/DLL_ORB.h index 1b6ffc89222..e078d121e43 100644 --- a/TAO/tao/DLL_ORB.h +++ b/TAO/tao/DLL_ORB.h @@ -9,7 +9,7 @@ * Header file for the TAO_DLL_ORB helper class. * * - * @author Ossama Othman <ossama@uci.edu> + * @author Ossama Othman <ossama@dre.vanderbilt.edu> */ //============================================================================= @@ -31,19 +31,20 @@ /** * @class TAO_DLL_ORB * - * @brief Helper class that initializes an ORB when an instance of - * this class is dynamically loaded. + * @brief @e Deprecated helper class that initializes an ORB when an + * instance of this class is dynamically loaded. * - * This class is deprecated. While it does demonstrate how to - * initialize an ORB in a dynamically loaded object, the fact that it - * is located in the TAO library forces the TAO library to be linked - * to the application binary. This prevents TAO from being completely - * decoupled from an application when dynamic loading is used, hence - * defeating the purpose of dynamically loading the object! + * @deprecated This class is deprecated. While it does demonstrate + * how to initialize an ORB in a dynamically loaded object, the fact + * that it is located in the TAO library forces the TAO library to be + * linked to the application binary. This prevents TAO from being + * completely decoupled from an application when dynamic loading is + * used, hence defeating the purpose of dynamically loading the + * object! * @par * For an example of how to dynamically load an ORB (actually initialize * an ORB inside a dynamically loaded object) that is completely - * decoupled from an application binary see the TAO/tests/DLL_ORB + * decoupled from an application binary see the @c TAO/tests/DLL_ORB * test. */ class TAO_Export TAO_DLL_ORB : public ACE_Task_Base diff --git a/TAO/tao/ORBInitInfo.cpp b/TAO/tao/ORBInitInfo.cpp index 100230bbaab..f06b5ef92af 100644 --- a/TAO/tao/ORBInitInfo.cpp +++ b/TAO/tao/ORBInitInfo.cpp @@ -1,5 +1,3 @@ -// -*- C++ -*- -// // $Id$ #include "ORBInitInfo.h" @@ -12,14 +10,19 @@ #include "PICurrent.h" #endif /* TAO_HAS_INTERCEPTORS == 1 */ + ACE_RCSID (TAO, ORBInitInfo, "$Id$") + #if !defined (__ACE_INLINE__) #include "ORBInitInfo.inl" #endif /* defined INLINE */ + +int TAO_ORBInitInfo::_tao_class_id = 0; + TAO_ORBInitInfo::TAO_ORBInitInfo (TAO_ORB_Core *orb_core, int argc , char *argv[]) @@ -316,7 +319,7 @@ TAO_ORBInitInfo_ptr TAO_ORBInitInfo::_unchecked_narrow ( ACE_reinterpret_cast ( ptrdiff_t, - &TAO_ORBInitInfo::_narrow + &TAO_ORBInitInfo::_tao_class_id ) ) ); @@ -327,34 +330,40 @@ TAO_ORBInitInfo::_duplicate (TAO_ORBInitInfo_ptr obj) { if (!CORBA::is_nil (obj)) obj->_add_ref (); + return obj; } void *TAO_ORBInitInfo::_tao_QueryInterface (ptrdiff_t type) { void *retv = 0; - if (type == ACE_reinterpret_cast - (ptrdiff_t, - &TAO_ORBInitInfo::_narrow)) - retv = ACE_reinterpret_cast (void*, this); - else if (type == ACE_reinterpret_cast - (ptrdiff_t, - &::PortableInterceptor::ORBInitInfo::_narrow)) - retv = ACE_reinterpret_cast - ( - void *, - ACE_static_cast - ( - PortableInterceptor::ORBInitInfo_ptr, - this - ) - ); - else if (type == ACE_reinterpret_cast (ptrdiff_t, &CORBA::Object::_narrow)) - retv = ACE_reinterpret_cast (void *, - ACE_static_cast (CORBA::Object_ptr, this)); - - if (retv) + + if (type == ACE_reinterpret_cast (ptrdiff_t, + &TAO_ORBInitInfo::_tao_class_id)) + { + retv = ACE_reinterpret_cast (void *, this); + } + else if (type == ACE_reinterpret_cast ( + ptrdiff_t, + &ACE_NESTED_CLASS (::PortableInterceptor, ORBInitInfo)::_tao_class_id)) + { + retv = + ACE_reinterpret_cast (void*, + ACE_static_cast ( + PortableInterceptor::ORBInitInfo_ptr, + this)); + } + else if (type == ACE_reinterpret_cast (ptrdiff_t, + &CORBA::Object::_tao_class_id)) + { + retv = + ACE_reinterpret_cast (void *, + ACE_static_cast (CORBA::Object_ptr, this)); + } + + if (retv != 0) this->_add_ref (); + return retv; } @@ -364,8 +373,10 @@ const char* TAO_ORBInitInfo::_interface_repository_id (void) const } // ************************************************************* + + TAO_ORBInitInfo_ptr -tao_TAO_ORBInitInfo_duplicate ( +tao_TAO_ORBInitInfo_life::tao_duplicate ( TAO_ORBInitInfo_ptr p ) { @@ -373,7 +384,7 @@ tao_TAO_ORBInitInfo_duplicate ( } void -tao_TAO_ORBInitInfo_release ( +tao_TAO_ORBInitInfo_life::tao_release ( TAO_ORBInitInfo_ptr p ) { @@ -381,15 +392,24 @@ tao_TAO_ORBInitInfo_release ( } TAO_ORBInitInfo_ptr -tao_TAO_ORBInitInfo_nil ( +tao_TAO_ORBInitInfo_life::tao_nil ( void ) { return TAO_ORBInitInfo::_nil (); } +CORBA::Boolean +tao_TAO_ORBInitInfo_life::tao_marshal ( + TAO_ORBInitInfo_ptr p, + TAO_OutputCDR &cdr + ) +{ + return p->marshal (cdr); +} + TAO_ORBInitInfo_ptr -tao_TAO_ORBInitInfo_narrow ( +tao_TAO_ORBInitInfo_cast::tao_narrow ( CORBA::Object *p ACE_ENV_ARG_DECL ) @@ -398,7 +418,7 @@ tao_TAO_ORBInitInfo_narrow ( } CORBA::Object * -tao_TAO_ORBInitInfo_upcast ( +tao_TAO_ORBInitInfo_cast::tao_upcast ( void *src ) { @@ -407,127 +427,14 @@ tao_TAO_ORBInitInfo_upcast ( return *tmp; } -// ************************************************************* - -// ************************************************************* -// Operations for class TAO_ORBInitInfo_var -// ************************************************************* - -TAO_ORBInitInfo_var::TAO_ORBInitInfo_var (void) // default constructor - : ptr_ (TAO_ORBInitInfo::_nil ()) -{} -::TAO_ORBInitInfo_ptr -TAO_ORBInitInfo_var::ptr (void) const -{ - return this->ptr_; -} - -TAO_ORBInitInfo_var::TAO_ORBInitInfo_var (const ::TAO_ORBInitInfo_var &p) - : TAO_Base_var (), - ptr_ (TAO_ORBInitInfo::_duplicate (p.ptr ())) -{} - -TAO_ORBInitInfo_var::~TAO_ORBInitInfo_var (void) // destructor -{ - CORBA::release (this->ptr_); -} - -TAO_ORBInitInfo_var & -TAO_ORBInitInfo_var::operator= (TAO_ORBInitInfo_ptr p) -{ - CORBA::release (this->ptr_); - this->ptr_ = p; - return *this; -} - -TAO_ORBInitInfo_var & -TAO_ORBInitInfo_var::operator= (const ::TAO_ORBInitInfo_var &p) -{ - if (this != &p) - { - CORBA::release (this->ptr_); - this->ptr_ = ::TAO_ORBInitInfo::_duplicate (p.ptr ()); - } - return *this; -} - -TAO_ORBInitInfo_var::operator const ::TAO_ORBInitInfo_ptr &() const -{ - return this->ptr_; -} - -TAO_ORBInitInfo_var::operator ::TAO_ORBInitInfo_ptr &() -{ - return this->ptr_; -} - -TAO_ORBInitInfo_ptr -TAO_ORBInitInfo_var::operator-> (void) const -{ - return this->ptr_; -} +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class TAO_Objref_Var_T<TAO_ORBInitInfo, tao_TAO_ORBInitInfo_life>; +template class TAO_Objref_Out_T<TAO_ORBInitInfo, tao_TAO_ORBInitInfo_life>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +# pragma instantiate \ + TAO_Objref_Var_T<TAO_ORBInitInfo, tao_TAO_ORBInitInfo_life> +# pragma instantiate \ + TAO_Objref_Out_T<TAO_ORBInitInfo, tao_TAO_ORBInitInfo_life> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ -TAO_ORBInitInfo_ptr -TAO_ORBInitInfo_var::in (void) const -{ - return this->ptr_; -} - -TAO_ORBInitInfo_ptr & -TAO_ORBInitInfo_var::inout (void) -{ - return this->ptr_; -} - -TAO_ORBInitInfo_ptr & -TAO_ORBInitInfo_var::out (void) -{ - CORBA::release (this->ptr_); - this->ptr_ = ::TAO_ORBInitInfo::_nil (); - return this->ptr_; -} - -TAO_ORBInitInfo_ptr -TAO_ORBInitInfo_var::_retn (void) -{ - // yield ownership of managed obj reference - ::TAO_ORBInitInfo_ptr val = this->ptr_; - this->ptr_ = ::TAO_ORBInitInfo::_nil (); - return val; -} - -TAO_ORBInitInfo_ptr -TAO_ORBInitInfo_var::duplicate (TAO_ORBInitInfo_ptr p) -{ - return ::TAO_ORBInitInfo::_duplicate (p); -} - -void -TAO_ORBInitInfo_var::release (TAO_ORBInitInfo_ptr p) -{ - CORBA::release (p); -} - -TAO_ORBInitInfo_ptr -TAO_ORBInitInfo_var::nil (void) -{ - return ::TAO_ORBInitInfo::_nil (); -} - -TAO_ORBInitInfo_ptr -TAO_ORBInitInfo_var::narrow ( - CORBA::Object *p - ACE_ENV_ARG_DECL - ) -{ - return ::TAO_ORBInitInfo::_narrow (p ACE_ENV_ARG_PARAMETER); -} - -CORBA::Object * -TAO_ORBInitInfo_var::upcast (void *src) -{ - TAO_ORBInitInfo **tmp = - ACE_static_cast (TAO_ORBInitInfo **, src); - return *tmp; -} diff --git a/TAO/tao/ORBInitInfo.h b/TAO/tao/ORBInitInfo.h index 64320dbc0bb..b52d4b51219 100644 --- a/TAO/tao/ORBInitInfo.h +++ b/TAO/tao/ORBInitInfo.h @@ -6,7 +6,7 @@ * * $Id$ * - * @author Ossama Othman <ossama@uci.edu> + * @author Ossama Othman <ossama@dre.vanderbilt.edu> */ // =================================================================== @@ -23,7 +23,6 @@ #include "PortableInterceptorC.h" #include "LocalObject.h" -#include "StringSeqC.h" // This is to remove "inherits via dominance" warnings from MSVC. // MSVC is being a little too paranoid. @@ -39,9 +38,31 @@ #endif /* __BORLANDC__ */ class TAO_ORB_Core; -class TAO_ORBInitInfo_var; class TAO_ORBInitInfo; typedef TAO_ORBInitInfo *TAO_ORBInitInfo_ptr; +struct tao_TAO_ORBInitInfo_life; + +typedef TAO_Objref_Var_T<TAO_ORBInitInfo, + tao_TAO_ORBInitInfo_life> TAO_ORBInitInfo_var; + +typedef TAO_Objref_Out_T<TAO_ORBInitInfo, + tao_TAO_ORBInitInfo_life> TAO_ORBInitInfo_out; + +struct TAO_Export tao_TAO_ORBInitInfo_life +{ + static TAO_ORBInitInfo_ptr tao_duplicate (TAO_ORBInitInfo_ptr); + static void tao_release (TAO_ORBInitInfo_ptr); + static TAO_ORBInitInfo_ptr tao_nil (void); + static CORBA::Boolean tao_marshal (TAO_ORBInitInfo_ptr, + TAO_OutputCDR &); +}; + +struct TAO_Export tao_TAO_ORBInitInfo_cast +{ + static TAO_ORBInitInfo_ptr tao_narrow (CORBA::Object_ptr + ACE_ENV_ARG_DECL); + static CORBA::Object_ptr tao_upcast (void *); +}; /** * @class TAO_ORBInitInfo @@ -69,7 +90,6 @@ public: * These methods are exported by the * PortableInterceptor::ORBInitInfo interface. */ - //@{ /// Return the argument vector for the ORB currently being /// initialized as a string sequence. @@ -159,7 +179,6 @@ public: * These methods are not part of the PortableInterceptor * specification, and are TAO-specific extensions. */ - //@{ /// Allocate a slot in the ORB's TSS resources. /** @@ -230,6 +249,8 @@ public: virtual void *_tao_QueryInterface (ptrdiff_t type); virtual const char* _interface_repository_id (void) const; + + static int _tao_class_id; // Used when narrowing. //@} protected: @@ -272,51 +293,6 @@ private: }; -/** - * @class TAO_ORBInitInfo_var - */ -class TAO_Export TAO_ORBInitInfo_var : public TAO_Base_var -{ -public: - - TAO_ORBInitInfo_var (void); // default constructor - TAO_ORBInitInfo_var (TAO_ORBInitInfo_ptr p) : ptr_ (p) {} - TAO_ORBInitInfo_var (const TAO_ORBInitInfo_var &); // copy constructor - ~TAO_ORBInitInfo_var (void); // destructor - - TAO_ORBInitInfo_var &operator= (TAO_ORBInitInfo_ptr); - TAO_ORBInitInfo_var &operator= (const TAO_ORBInitInfo_var &); - TAO_ORBInitInfo_ptr operator-> (void) const; - - operator const TAO_ORBInitInfo_ptr &() const; - operator TAO_ORBInitInfo_ptr &(); - // in, inout, out, _retn - TAO_ORBInitInfo_ptr in (void) const; - TAO_ORBInitInfo_ptr &inout (void); - TAO_ORBInitInfo_ptr &out (void); - TAO_ORBInitInfo_ptr _retn (void); - TAO_ORBInitInfo_ptr ptr (void) const; - - // Hooks used by template sequence and object manager classes - // for non-defined forward declared interfaces. - static TAO_ORBInitInfo_ptr duplicate (TAO_ORBInitInfo_ptr); - static void release (TAO_ORBInitInfo_ptr); - static TAO_ORBInitInfo_ptr nil (void); - static TAO_ORBInitInfo_ptr narrow ( - CORBA::Object * - ACE_ENV_ARG_DECL_NOT_USED - ); - static CORBA::Object * upcast (void *); - -private: - - TAO_ORBInitInfo_ptr ptr_; - // Unimplemented - prevents widening assignment. - TAO_ORBInitInfo_var (const TAO_Base_var &rhs); - TAO_ORBInitInfo_var &operator= (const TAO_Base_var &rhs); - -}; - #if defined (__ACE_INLINE__) #include "ORBInitInfo.inl" diff --git a/TAO/tao/Objref_VarOut_T.h b/TAO/tao/Objref_VarOut_T.h index aca4e376da7..6b37c42991f 100644 --- a/TAO/tao/Objref_VarOut_T.h +++ b/TAO/tao/Objref_VarOut_T.h @@ -27,7 +27,8 @@ /** * @class TAO_Objref_Var_T * - * @brief Parametrized implementation of _var class for object references. + * @brief Parameterized implementation of @c _var class for object + * references. * */ diff --git a/TAO/tao/corba.h b/TAO/tao/corba.h index 92fbe0158b9..5dfea0573bd 100644 --- a/TAO/tao/corba.h +++ b/TAO/tao/corba.h @@ -6,12 +6,10 @@ * * $Id$ * - * Master Header file for the TAO CORBA ORB. Include only this - * file, to see all public ORB interfaces declared by TAO. - * @par - * This follows the OMG C++ mapping for compilers that don't - * support C++ exceptions or namespaces. + * Master header file for all TAO stubs. * + * @note This header should not be included in any core TAO library + * files. Include the necessary individual headers instead. * * @author Copyright 1994-1995 by Sun Microsystems Inc. * @author Chris Cleeland @@ -22,6 +20,7 @@ #ifndef TAO_MASTER_CORBA_H #define TAO_MASTER_CORBA_H + #include /**/ "ace/pre.h" // ACE specific includes @@ -53,7 +52,6 @@ #include "tao/LocalObject.h" #include "tao/Principal.h" #include "tao/ORB.h" -#include "tao/varbase.h" #include "tao/CurrentC.h" #include "tao/BoundsC.h" @@ -62,6 +60,11 @@ #include "tao/DomainC.h" #include "tao/WrongTransactionC.h" +#include "tao/ObjectIdListC.h" + +#include "tao/StringSeqC.h" +#include "tao/OctetSeqC.h" + // TAO specific files, avoid them as much as possible. #include "tao/CDR.h" @@ -69,7 +72,6 @@ #include "tao/Sequence.h" #include "tao/Managed_Types.h" #include "tao/Object_KeyC.h" -#include "tao/ObjectIdListC.h" // Template _var and _out classes. #include "tao/Objref_VarOut_T.h" @@ -81,12 +83,10 @@ #include "tao/Remote_Object_Proxy_Impl.h" -#include "tao/StringSeqC.h" -#include "tao/OctetSeqC.h" - #if TAO_HAS_INTERCEPTORS == 1 #include "tao/PortableInterceptorC.h" #endif /* TAO_HAS_INTERCEPTORS == 1 */ #include /**/ "ace/post.h" + #endif /* TAO_MASTER_CORBA_H */ |