diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-03-28 23:11:00 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-03-28 23:11:00 +0000 |
commit | 3aee82ba845b5fd3c13290a07a77b1fe65111970 (patch) | |
tree | 9ab4cfb4f8feb9021449d639513458558d9428c6 | |
parent | 44f5d40f4a68d1d50c073d30d440aa9ff1377fd7 (diff) | |
download | ATCD-3aee82ba845b5fd3c13290a07a77b1fe65111970.tar.gz |
ChangeLogTag: Fri Mar 28 17:09:30 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
26 files changed, 374 insertions, 1195 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 0e53002a32b..3d169e601ce 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,36 @@ +Fri Mar 28 17:09:30 2003 Jeff Parsons <j.parsons@vanderbilt.edu> + + * AbstractBase.cpp: + * Environment.cpp: + * LocalObject.cpp: + * NVList.cpp: + * ORB.cpp: + * ORB.h: + * ORB.i: + * Object.cpp: + * Principal.cpp: + * Pseudo_VarOut_T.h: + * TAO.dsp: + * Typecode.cpp: + * ValueBase.cpp: + * ValueFactory.cpp: + * corbafwd.h: + * DynamicInterface/Context.cpp: + * DynamicInterface/Context.h: + * DynamicInterface/Context.inl: + * DynamicInterface/ExceptionList.h: + * DynamicInterface/ExceptionList.inl: + * DynamicInterface/Request.cpp: + * DynamicInterface/Request.h: + * DynamicInterface/Request.inl: + * DynamicInterface/Server_Request.cpp: + * DynamicInterface/Server_Request.h: + + Templatized _var and _out classes in + DynamicInterface, added conditional explicit + template instantiations, and update project + settings. + Fri Mar 28 000:58:31 2003 Jeff Parsons <j.parsons@vanderbilt.edu> * tao/AbstractBase.h: diff --git a/TAO/tao/AbstractBase.cpp b/TAO/tao/AbstractBase.cpp index 91ed3acd319..963cd0df9e9 100644 --- a/TAO/tao/AbstractBase.cpp +++ b/TAO/tao/AbstractBase.cpp @@ -342,3 +342,15 @@ CORBA::AbstractBase::_tao_to_value (void) return 0; } +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + + template class TAO_Pseudo_Var_T<CORBA::AbstractBase>; + template class TAO_Pseudo_Out_T<CORBA::AbstractBase, CORBA::AbstractBase_var>; + +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +# pragma instantiate TAO_Pseudo_Var_T<CORBA::AbstractBase> +# pragma instantiate TAO_Pseudo_Out_T<CORBA::AbstractBase, CORBA::AbstractBase_var> + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + diff --git a/TAO/tao/DynamicInterface/Context.cpp b/TAO/tao/DynamicInterface/Context.cpp index d4597c1cf9f..1f881dbdce4 100644 --- a/TAO/tao/DynamicInterface/Context.cpp +++ b/TAO/tao/DynamicInterface/Context.cpp @@ -211,3 +211,20 @@ CORBA::ContextList::_decr_refcnt (void) delete this; } } + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + + template class TAO_Pseudo_Var_T<CORBA::Context>; + template class TAO_Pseudo_Out_T<CORBA::Context, CORBA::Context_var>; + template class TAO_Pseudo_Var_T<CORBA::ContextList>; + template class TAO_Pseudo_Out_T<CORBA::ContextList, CORBA::ContextList_var>; + +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +# pragma instantiate TAO_Pseudo_Var_T<CORBA::Context> +# pragma instantiate TAO_Pseudo_Out_T<CORBA::Context, CORBA::Context_var> +# pragma instantiate TAO_Pseudo_Var_T<CORBA::ContextList> +# pragma instantiate TAO_Pseudo_Out_T<CORBA::ContextList, CORBA::ContextList_var> + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + diff --git a/TAO/tao/DynamicInterface/Context.h b/TAO/tao/DynamicInterface/Context.h index 29ab3664b70..3683727bd59 100644 --- a/TAO/tao/DynamicInterface/Context.h +++ b/TAO/tao/DynamicInterface/Context.h @@ -19,17 +19,29 @@ #include "ace/pre.h" #include "dynamicinterface_export.h" -#include "tao/corbafwd.h" -#include "ace/Unbounded_Queue.h" -#include "ace/Atomic_Op.h" -#include "ace/CORBA_macros.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "tao/corbafwd.h" +#include "tao/Pseudo_VarOut_T.h" + +#include "ace/Unbounded_Queue.h" +#include "ace/Atomic_Op.h" +#include "ace/CORBA_macros.h" + namespace CORBA { + TAO_DynamicInterface_Export void release (ContextList_ptr); + TAO_DynamicInterface_Export Boolean is_nil (ContextList_ptr); + + typedef TAO_Pseudo_Var_T<Context> Context_var; + typedef TAO_Pseudo_Out_T<Context, Context_var> Context_out; + + typedef TAO_Pseudo_Var_T<ContextList> ContextList_var; + typedef TAO_Pseudo_Out_T<ContextList, ContextList_var> ContextList_out; + /** * @class Context * @@ -97,62 +109,6 @@ namespace CORBA TAO_SYNCH_MUTEX refcount_lock_; }; - /** - * @class Context_var - * - * @brief The T_var class for Context. - * - * As any other pseudo object Context must have a T_var class, the - * interface an semantics are specified in the CORBA spec. - */ - class TAO_DynamicInterface_Export Context_var - { - public: - Context_var (void); - Context_var (CORBA::Context_ptr); - Context_var (const Context_var &); - ~Context_var (void); - - Context_var &operator= (CORBA::Context_ptr); - Context_var &operator= (const Context_var &); - Context_ptr operator-> (void) const; - - operator const CORBA::Context_ptr &() const; - operator CORBA::Context_ptr &(); - // in, inout, out, _retn - Context_ptr in (void) const; - Context_ptr &inout (void); - Context_ptr &out (void); - Context_ptr _retn (void); - Context_ptr ptr (void) const; - - private: - Context_ptr ptr_; - }; - - class TAO_DynamicInterface_Export Context_out - { - // = TITLE - // The T_out class for Context - // - // = DESCRIPTION - // As any other pseudo object Context must have a T_out class, - // the interface an semantics are specified in the CORBA spec. - public: - Context_out (Context_ptr &); - Context_out (Context_var &); - Context_out (Context_out &); - Context_out &operator= (Context_out &); - Context_out &operator= (const Context_var &); - Context_out &operator= (Context_ptr); - operator Context_ptr &(); - Context_ptr &ptr (void); - Context_ptr operator-> (void); - - private: - CORBA::Context_ptr &ptr_; - }; - class TAO_DynamicInterface_Export ContextList { // = TITLE @@ -205,12 +161,9 @@ namespace CORBA void _decr_refcnt (void); // Increment and decrement ref counts. -#if !defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ >= 8 // Useful for template programming. typedef CORBA::ContextList_ptr _ptr_type; typedef CORBA::ContextList_var _var_type; -#endif /* __GNUC__ */ - private: // Not allowed. @@ -223,60 +176,6 @@ namespace CORBA ACE_Unbounded_Queue<char *> ctx_list_; // Internal list of typecodes. }; - - class TAO_DynamicInterface_Export ContextList_var - { - public: - ContextList_var (void); // default constructor - ContextList_var (ContextList_ptr); - ContextList_var (const ContextList_var &); // copy constructor - ~ContextList_var (void); // destructor - - ContextList_var &operator= (ContextList_ptr); - ContextList_var &operator= (const ContextList_var &); - ContextList_ptr operator-> (void) const; - - operator const ContextList_ptr &() const; - operator ContextList_ptr &(); - // in, inout, out, _retn - ContextList_ptr in (void) const; - ContextList_ptr &inout (void); - ContextList_ptr &out (void); - ContextList_ptr _retn (void); - ContextList_ptr ptr (void) const; - - private: - ContextList_ptr ptr_; - }; - - class TAO_DynamicInterface_Export ContextList_out - { - // = TITLE - // The T_out class for ContextList - // - // = DESCRIPTION - // As any other pseudo object ContextList must have a T_out class, - // the interface an semantics are specified in the CORBA spec. - // - // = NOTE - // We use ContextList_ptr as the _ptr type instead of - // CORBA::ContextList_ptr, this is an attempt to reduced the cyclic - // dependencies in TAO. - // - public: - ContextList_out (ContextList_ptr &); - ContextList_out (ContextList_var &); - ContextList_out (ContextList_out &); - ContextList_out &operator= (ContextList_out &); - ContextList_out &operator= (const ContextList_var &); - ContextList_out &operator= (ContextList_ptr); - operator ContextList_ptr &(); - ContextList_ptr &ptr (void); - ContextList_ptr operator-> (void); - - private: - ContextList_ptr &ptr_; - }; } // End CORBA namespace. #if defined (__ACE_INLINE__) diff --git a/TAO/tao/DynamicInterface/Context.inl b/TAO/tao/DynamicInterface/Context.inl index 9281d7c1e69..af53a6b4cfe 100644 --- a/TAO/tao/DynamicInterface/Context.inl +++ b/TAO/tao/DynamicInterface/Context.inl @@ -2,182 +2,42 @@ // // $Id$ -ACE_INLINE CORBA::Context_ptr -CORBA::Context::_duplicate (CORBA::Context_ptr x) +ACE_INLINE +void +CORBA::release (CORBA::ContextList_ptr x) { if (x != 0) { - x->_incr_refcnt (); + x->_decr_refcnt (); } - - return x; -} - -ACE_INLINE CORBA::Context_ptr -CORBA::Context::_nil (void) -{ - return (CORBA::Context_ptr)0; -} - -// ************************************************************* -// Inline operations for class CORBA::Context_var -// ************************************************************* - -ACE_INLINE -CORBA::Context_var::Context_var (void) - : ptr_ (CORBA::Context::_nil ()) -{ -} - -ACE_INLINE -CORBA::Context_var::Context_var (CORBA::Context_ptr p) - : ptr_ (p) -{} - -ACE_INLINE -CORBA::Context_var::~Context_var (void) -{ - CORBA::release (this->ptr_); -} - -ACE_INLINE CORBA::Context_ptr -CORBA::Context_var::ptr (void) const -{ - return this->ptr_; -} - -ACE_INLINE -CORBA::Context_var::Context_var (const CORBA::Context_var &p) - : ptr_ (CORBA::Context::_duplicate (p.ptr ())) -{} - -ACE_INLINE CORBA::Context_var & -CORBA::Context_var::operator= (CORBA::Context_ptr p) -{ - CORBA::release (this->ptr_); - this->ptr_ = p; - return *this; -} - -ACE_INLINE CORBA::Context_var & -CORBA::Context_var::operator= (const CORBA::Context_var &p) -{ - if (this != &p) - { - CORBA::release (this->ptr_); - this->ptr_ = CORBA::Context::_duplicate (p.ptr ()); - } - return *this; -} - -ACE_INLINE -CORBA::Context_var::operator const CORBA::Context_ptr &() const -{ - return this->ptr_; -} - -ACE_INLINE -CORBA::Context_var::operator CORBA::Context_ptr &() -{ - return this->ptr_; -} - -ACE_INLINE CORBA::Context_ptr -CORBA::Context_var::operator-> (void) const -{ - return this->ptr_; } -ACE_INLINE CORBA::Context_ptr -CORBA::Context_var::in (void) const -{ - return this->ptr_; -} - -ACE_INLINE CORBA::Context_ptr & -CORBA::Context_var::inout (void) -{ - return this->ptr_; -} - -ACE_INLINE CORBA::Context_ptr & -CORBA::Context_var::out (void) -{ - CORBA::release (this->ptr_); - this->ptr_ = CORBA::Context::_nil (); - return this->ptr_; -} - -ACE_INLINE CORBA::Context_ptr -CORBA::Context_var::_retn (void) -{ - // yield ownership - CORBA::Context_ptr val = this->ptr_; - this->ptr_ = CORBA::Context::_nil (); - return val; -} - -// ************************************************************* -// Inline operations for class CORBA::Context_out -// ************************************************************* - ACE_INLINE -CORBA::Context_out::Context_out (CORBA::Context_ptr &p) - : ptr_ (p) +CORBA::Boolean +CORBA::is_nil (CORBA::ContextList_ptr x) { - this->ptr_ = CORBA::Context::_nil (); + return (CORBA::Boolean) (x == 0); } -ACE_INLINE -CORBA::Context_out::Context_out (CORBA::Context_var &p) - : ptr_ (p.out ()) -{ - CORBA::release (this->ptr_); - this->ptr_ = CORBA::Context::_nil (); -} - -ACE_INLINE -CORBA::Context_out::Context_out (CORBA::Context_out &p) - : ptr_ (p.ptr_) -{} - -ACE_INLINE CORBA::Context_out & -CORBA::Context_out::operator= (CORBA::Context_out &p) -{ - this->ptr_ = p.ptr_; - return *this; -} - -ACE_INLINE CORBA::Context_out & -CORBA::Context_out::operator= (const CORBA::Context_var &p) -{ - this->ptr_ = CORBA::Context::_duplicate (p.ptr ()); - return *this; -} - -ACE_INLINE CORBA::Context_out & -CORBA::Context_out::operator= (CORBA::Context_ptr p) -{ - this->ptr_ = p; - return *this; -} +// =================================================================== -ACE_INLINE -CORBA::Context_out::operator CORBA::Context_ptr &() +ACE_INLINE +CORBA::Context_ptr +CORBA::Context::_duplicate (CORBA::Context_ptr x) { - return this->ptr_; -} + if (x != 0) + { + x->_incr_refcnt (); + } -ACE_INLINE CORBA::Context_ptr & -CORBA::Context_out::ptr (void) -{ - return this->ptr_; + return x; } -ACE_INLINE CORBA::Context_ptr -CORBA::Context_out::operator-> (void) +ACE_INLINE +CORBA::Context_ptr +CORBA::Context::_nil (void) { - return this->ptr_; + return (CORBA::Context_ptr)0; } // ************************************************************* @@ -189,185 +49,29 @@ CORBA::ContextList::ContextList (void) { } -ACE_INLINE CORBA::ULong +ACE_INLINE +CORBA::ULong CORBA::ContextList::count (void) { return (CORBA::ULong) this->ctx_list_.size (); } -ACE_INLINE CORBA::ContextList_ptr +ACE_INLINE +CORBA::ContextList_ptr CORBA::ContextList::_nil (void) { return (CORBA::ContextList_ptr)0; } -ACE_INLINE CORBA::ContextList * -CORBA::ContextList::_duplicate (CORBA::ContextList* x) +ACE_INLINE +CORBA::ContextList_ptr +CORBA::ContextList::_duplicate (CORBA::ContextList_ptr x) { if (x != 0) - x->_incr_refcnt (); - return x; -} - -// ************************************************************* -// Inline operations for class CORBA::ContextList_var -// ************************************************************* - -// default constructor - -ACE_INLINE -CORBA::ContextList_var::ContextList_var (void) - : ptr_ (CORBA::ContextList::_nil ()) -{} - -ACE_INLINE -CORBA::ContextList_var::ContextList_var (CORBA::ContextList_ptr p) - : ptr_ (p) -{} - -ACE_INLINE CORBA::ContextList_ptr -CORBA::ContextList_var::ptr (void) const -{ - return this->ptr_; -} - -// copy constructor -ACE_INLINE -CORBA::ContextList_var::ContextList_var (const CORBA::ContextList_var &p) - : ptr_ (p.ptr_->_duplicate ()) -{} - -ACE_INLINE -CORBA::ContextList_var::~ContextList_var (void) // destructor -{ - this->ptr_->_destroy (); -} - -ACE_INLINE CORBA::ContextList_var & -CORBA::ContextList_var::operator= (CORBA::ContextList_ptr p) -{ - this->ptr_->_destroy (); - this->ptr_ = p; - return *this; -} - -ACE_INLINE CORBA::ContextList_var & -CORBA::ContextList_var::operator= (const CORBA::ContextList_var &p) -{ - if (this != &p) { - this->ptr_->_destroy (); - this->ptr_ = p.ptr_->_duplicate (); + x->_incr_refcnt (); } - return *this; -} - -ACE_INLINE -CORBA::ContextList_var::operator const CORBA::ContextList_ptr &() const // cast -{ - return this->ptr_; -} - -ACE_INLINE -CORBA::ContextList_var::operator CORBA::ContextList_ptr &() // cast -{ - return this->ptr_; -} - -ACE_INLINE CORBA::ContextList_ptr -CORBA::ContextList_var::operator-> (void) const -{ - return this->ptr_; -} - -ACE_INLINE CORBA::ContextList_ptr -CORBA::ContextList_var::in (void) const -{ - return this->ptr_; -} - -ACE_INLINE CORBA::ContextList_ptr & -CORBA::ContextList_var::inout (void) -{ - return this->ptr_; -} - -ACE_INLINE CORBA::ContextList_ptr & -CORBA::ContextList_var::out (void) -{ - this->ptr_->_destroy (); - this->ptr_ = CORBA::ContextList::_nil (); - return this->ptr_; -} - -ACE_INLINE CORBA::ContextList_ptr -CORBA::ContextList_var::_retn (void) -{ - // yield ownership of managed obj reference - CORBA::ContextList_ptr val = this->ptr_; - this->ptr_ = CORBA::ContextList::_nil (); - return val; -} -// ************************************************************* -// Inline operations for class CORBA::ContextList_out -// ************************************************************* - -ACE_INLINE -CORBA::ContextList_out::ContextList_out (CORBA::ContextList_ptr &p) - : ptr_ (p) -{ - this->ptr_ = CORBA::ContextList::_nil (); -} - -ACE_INLINE -CORBA::ContextList_out::ContextList_out (CORBA::ContextList_var &p) - : ptr_ (p.out ()) -{ - this->ptr_->_destroy (); - this->ptr_ = CORBA::ContextList::_nil (); -} - -ACE_INLINE -CORBA::ContextList_out::ContextList_out (CORBA::ContextList_out &p) - : ptr_ (p.ptr_) -{} - -ACE_INLINE CORBA::ContextList_out & -CORBA::ContextList_out::operator= (CORBA::ContextList_out &p) -{ - this->ptr_ = p.ptr_; - return *this; -} - -ACE_INLINE CORBA::ContextList_out & -CORBA::ContextList_out::operator= (const CORBA::ContextList_var &p) -{ - this->ptr_ = p.ptr ()->_duplicate (); - return *this; -} - -ACE_INLINE CORBA::ContextList_out & -CORBA::ContextList_out::operator= (CORBA::ContextList_ptr p) -{ - this->ptr_ = p; - return *this; -} - -ACE_INLINE -CORBA::ContextList_out::operator CORBA::ContextList_ptr &() -{ - return this->ptr_; -} - -ACE_INLINE CORBA::ContextList_ptr & -CORBA::ContextList_out::ptr (void) -{ - return this->ptr_; + return x; } -ACE_INLINE CORBA::ContextList_ptr -CORBA::ContextList_out::operator-> (void) -{ - return this->ptr_; -} diff --git a/TAO/tao/DynamicInterface/ExceptionList.h b/TAO/tao/DynamicInterface/ExceptionList.h index c666e8283a5..9e63357fdec 100644 --- a/TAO/tao/DynamicInterface/ExceptionList.h +++ b/TAO/tao/DynamicInterface/ExceptionList.h @@ -25,7 +25,10 @@ #include "ace/pre.h" #include "dynamicinterface_export.h" + #include "tao/corbafwd.h" +#include "tao/Pseudo_VarOut_T.h" + #include "ace/Unbounded_Queue.h" #include "ace/Atomic_Op.h" #include "ace/CORBA_macros.h" @@ -37,8 +40,11 @@ namespace CORBA { - class ExceptionList; - typedef ExceptionList *ExceptionList_ptr; + TAO_DynamicInterface_Export void release (ExceptionList_ptr); + TAO_DynamicInterface_Export Boolean is_nil (ExceptionList_ptr); + + typedef TAO_Pseudo_Var_T<ExceptionList> ExceptionList_var; + typedef TAO_Pseudo_Out_T<ExceptionList, ExceptionList_var> ExceptionList_out; class TAO_DynamicInterface_Export ExceptionList { @@ -54,7 +60,7 @@ namespace CORBA // Constructor. ExceptionList (CORBA::ULong len, - CORBA::TypeCode_ptr *tc_list); + CORBA::TypeCode_ptr *tc_list); // Constructor - initialize given a length and an array of // TypeCodes. @@ -88,14 +94,12 @@ namespace CORBA ACE_ENV_ARG_DECL_WITH_DEFAULTS); // Remove the typecode at slot i. Raises the "Bounds" exception. - void _incr_refcnt (void); - void _decr_refcnt (void); + void _incr_refcnt (void); + void _decr_refcnt (void); // Increment and decrement ref counts. -#if !defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ >= 8 typedef CORBA::ExceptionList_ptr _ptr_type; typedef CORBA::ExceptionList_var _var_type; -#endif /* __GNUC__ */ // Useful for template programming. private: @@ -109,43 +113,6 @@ namespace CORBA ACE_Unbounded_Queue<CORBA::TypeCode_ptr> tc_list_; // Internal list of typecodes. }; - - class TAO_DynamicInterface_Export ExceptionList_var - { - // = TITLE - // ExceptionList_var - // - // = DESCRIPTION - // Lifecycle management helper class for ExceptionList objects. - public: - ExceptionList_var (void); - // Default constructor. - - ExceptionList_var (ExceptionList_ptr); - - ExceptionList_var (const ExceptionList_var &); - // Copy constructor. - - ~ExceptionList_var (void); - // Destructor. - - ExceptionList_var &operator= (ExceptionList_ptr); - ExceptionList_var &operator= (const ExceptionList_var &); - ExceptionList_ptr operator-> (void) const; - - operator const ExceptionList_ptr &() const; - operator ExceptionList_ptr &(); - - // in, inout, out, _retn. - ExceptionList_ptr in (void) const; - ExceptionList_ptr &inout (void); - ExceptionList_ptr &out (void); - ExceptionList_ptr _retn (void); - ExceptionList_ptr ptr (void) const; - - private: - ExceptionList_ptr ptr_; - }; } // End CORBA namespace #if defined (__ACE_INLINE__) diff --git a/TAO/tao/DynamicInterface/ExceptionList.inl b/TAO/tao/DynamicInterface/ExceptionList.inl index f1f2c61806d..d08578a70ec 100644 --- a/TAO/tao/DynamicInterface/ExceptionList.inl +++ b/TAO/tao/DynamicInterface/ExceptionList.inl @@ -3,139 +3,53 @@ // $Id$ ACE_INLINE -CORBA::ExceptionList::ExceptionList (void) - : ref_count_ (1) -{ -} - -ACE_INLINE CORBA::ULong -CORBA::ExceptionList::count (void) -{ - return (CORBA::ULong) this->tc_list_.size (); -} - -ACE_INLINE CORBA::ExceptionList_ptr -CORBA::ExceptionList::_nil (void) -{ - return (CORBA::ExceptionList_ptr)0; -} - -ACE_INLINE CORBA::ExceptionList * -CORBA::ExceptionList::_duplicate (CORBA::ExceptionList* x) +void +CORBA::release (CORBA::ExceptionList_ptr x) { if (x != 0) { - x->_incr_refcnt (); + x->_decr_refcnt (); } - - return x; } ACE_INLINE -CORBA::ExceptionList_var::ExceptionList_var (void) // default constructor - : ptr_ (CORBA::ExceptionList::_nil ()) -{} - -ACE_INLINE -CORBA::ExceptionList_var::ExceptionList_var (CORBA::ExceptionList_ptr p) - : ptr_ (p) -{} - -ACE_INLINE CORBA::ExceptionList_ptr -CORBA::ExceptionList_var::ptr (void) const +CORBA::Boolean +CORBA::is_nil (CORBA::ExceptionList_ptr x) { - return this->ptr_; + return (CORBA::Boolean) (x == 0); } -ACE_INLINE -CORBA::ExceptionList_var::ExceptionList_var (const CORBA::ExceptionList_var &p) // copy constructor - : ptr_ (CORBA::ExceptionList::_duplicate (p.ptr_)) -{ -} +// =================================================================== ACE_INLINE -CORBA::ExceptionList_var::~ExceptionList_var (void) // destructor -{ - if (this->ptr_ != 0) - { - this->ptr_->_destroy (); - } -} - -ACE_INLINE CORBA::ExceptionList_var & -CORBA::ExceptionList_var::operator= (CORBA::ExceptionList_ptr p) -{ - if (this->ptr_ != 0) - { - this->ptr_->_destroy (); - } - - this->ptr_ = p; - return *this; -} - -ACE_INLINE CORBA::ExceptionList_var & -CORBA::ExceptionList_var::operator= (const CORBA::ExceptionList_var &p) -{ - if (this != &p) - { - if (this->ptr_ != 0) - { - this->ptr_->_destroy (); - } - - this->ptr_ = CORBA::ExceptionList::_duplicate (p.ptr_); - } - - return *this; -} - -ACE_INLINE -CORBA::ExceptionList_var::operator const CORBA::ExceptionList_ptr &() const -{ - return this->ptr_; -} - -ACE_INLINE -CORBA::ExceptionList_var::operator CORBA::ExceptionList_ptr &() -{ - return this->ptr_; -} - -ACE_INLINE CORBA::ExceptionList_ptr -CORBA::ExceptionList_var::operator-> (void) const +CORBA::ExceptionList::ExceptionList (void) + : ref_count_ (1) { - return this->ptr_; } -ACE_INLINE CORBA::ExceptionList_ptr -CORBA::ExceptionList_var::in (void) const +ACE_INLINE +CORBA::ULong +CORBA::ExceptionList::count (void) { - return this->ptr_; + return (CORBA::ULong) this->tc_list_.size (); } -ACE_INLINE CORBA::ExceptionList_ptr & -CORBA::ExceptionList_var::inout (void) +ACE_INLINE +CORBA::ExceptionList_ptr +CORBA::ExceptionList::_nil (void) { - return this->ptr_; + return (CORBA::ExceptionList_ptr)0; } -ACE_INLINE CORBA::ExceptionList_ptr & -CORBA::ExceptionList_var::out (void) +ACE_INLINE +CORBA::ExceptionList_ptr +CORBA::ExceptionList::_duplicate (CORBA::ExceptionList_ptr x) { - if (this->ptr_ != 0) + if (x != 0) { - this->ptr_->_destroy (); + x->_incr_refcnt (); } - this->ptr_ = CORBA::ExceptionList::_nil (); - return this->ptr_; + return x; } -ACE_INLINE CORBA::ExceptionList_ptr -CORBA::ExceptionList_var::_retn (void) -{ - CORBA::ExceptionList_ptr val = this->ptr_; - this->ptr_ = CORBA::ExceptionList::_nil (); - return val; -} diff --git a/TAO/tao/DynamicInterface/Request.cpp b/TAO/tao/DynamicInterface/Request.cpp index b4c488f0231..1d9156707e8 100644 --- a/TAO/tao/DynamicInterface/Request.cpp +++ b/TAO/tao/DynamicInterface/Request.cpp @@ -462,46 +462,3 @@ CORBA::Request::handle_response (TAO_InputCDR &incoming, } } -// Constructor. -CORBA::ORB_RequestSeq::ORB_RequestSeq (CORBA::ULong max) - : TAO_Unbounded_Pseudo_Sequence <CORBA::Request,CORBA::Request_var> (max) -{ - // No-op. -} - -CORBA::ORB_RequestSeq::ORB_RequestSeq (const CORBA::ORB_RequestSeq &rhs) - : TAO_Unbounded_Pseudo_Sequence <CORBA::Request,CORBA::Request_var> (rhs) -{ - // No-op. -} - -CORBA::ORB_RequestSeq::ORB_RequestSeq (CORBA::ULong max, - CORBA::ULong length, - CORBA::Request **data, - CORBA::Boolean release) - : TAO_Unbounded_Pseudo_Sequence <CORBA::Request,CORBA::Request_var> (max, - length, - data, - release) -{ - // No-op. -} - - -CORBA::ORB_RequestSeq::ORB_RequestSeq (void) -{ - // No-op. -} - - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - -template class TAO_Unbounded_Pseudo_Sequence<CORBA::Request,CORBA::Request_var>; -template class TAO_Pseudo_Object_Manager<CORBA::Request,CORBA::Request_var>; - -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - -#pragma instantiate TAO_Unbounded_Pseudo_Sequence<CORBA::Request,CORBA::Request_var> -#pragma instantiate TAO_Pseudo_Object_Manager<CORBA::Request,CORBA::Request_var> - -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/tao/DynamicInterface/Request.h b/TAO/tao/DynamicInterface/Request.h index 2e550a39832..6c4581f22d5 100644 --- a/TAO/tao/DynamicInterface/Request.h +++ b/TAO/tao/DynamicInterface/Request.h @@ -164,11 +164,9 @@ namespace CORBA /// Accessor for the input stream containing the exception. ACE_CString &raw_user_exception (void); -#if !defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ >= 8 // Useful for template programming. typedef CORBA::Request_ptr _ptr_type; typedef CORBA::Request_var _var_type; -#endif /* __GNUC__ */ private: friend class ::TAO_Dynamic_Adapter_Impl; @@ -244,152 +242,6 @@ namespace CORBA ACE_CString raw_user_exception_; }; - - /** - * @class Request_var - * - * @brief The T_var class for Request. - * - * As any other pseudo object Request must have a T_var class, the - * interface an semantics are specified in the CORBA spec. - */ - class TAO_DynamicInterface_Export Request_var - { - public: - Request_var (void); - Request_var (Request_ptr); - Request_var (const Request_var &); - ~Request_var (void); - - Request_var &operator= (Request_ptr); - Request_var &operator= (const Request_var &); - Request_ptr operator-> (void) const; - - operator const Request_ptr &() const; - operator Request_ptr &(); - - // in, inout, out, _retn. - Request_ptr in (void) const; - Request_ptr &inout (void); - Request_ptr &out (void); - Request_ptr _retn (void); - Request_ptr ptr (void) const; - - private: - Request_ptr ptr_; - }; - - /** - * @class Request_out - * - * @brief The T_out class for Request - * - * As any other pseudo object Request must have a T_out class, the - * interface an semantics are specified in the CORBA spec. - */ - class TAO_DynamicInterface_Export Request_out - { - public: - Request_out (Request_ptr &); - Request_out (Request_var &); - Request_out (Request_out &); - Request_out &operator= (Request_out &); - Request_out &operator= (const Request_var &); - Request_out &operator= (Request_ptr); - operator Request_ptr &(); - Request_ptr &ptr (void); - Request_ptr operator-> (void); - - private: - Request_ptr &ptr_; - }; - - // Make sure you instantiate this in Request.cpp - class TAO_DynamicInterface_Export ORB_RequestSeq - : public TAO_Unbounded_Pseudo_Sequence<CORBA::Request, CORBA::Request_var> - { - public: - // Helpful with template programming. -#if !defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ >= 8 - typedef ORB_RequestSeq_var _var_type; -#endif /* __GNUC__ */ - - // Implement the same constructors provided by the template here, - // check Sequence_T.h for ideas. - // Simply delegate on the template for the implementation... - - /// Default constructor. - ORB_RequestSeq (void); - - /// Constructor with a "hint" for the maximum capacity. - ORB_RequestSeq (CORBA::ULong max); - - /// Constructor with a given buffer. - ORB_RequestSeq (CORBA::ULong maximum, - CORBA::ULong length, - CORBA::Request* * data, - CORBA::Boolean release=0); - - /// Copy ctor, deep copies. - ORB_RequestSeq (const ORB_RequestSeq &); - - }; - - class TAO_DynamicInterface_Export ORB_RequestSeq_var - { - public: - /// Default constructor. - ORB_RequestSeq_var (void); - - ORB_RequestSeq_var (ORB_RequestSeq *); - - /// Copy constructor. - ORB_RequestSeq_var (const ORB_RequestSeq_var &); - - /// Destructor. - ~ORB_RequestSeq_var (void); - - ORB_RequestSeq_var &operator= (ORB_RequestSeq *); - ORB_RequestSeq_var &operator= (const ORB_RequestSeq_var &); - ORB_RequestSeq *operator-> (void); - const ORB_RequestSeq *operator-> (void) const; - - operator const ORB_RequestSeq &() const; - operator ORB_RequestSeq &(); - operator ORB_RequestSeq &() const; - CORBA::Octet &operator[] (CORBA::ULong slot); - - // in, inout, out, _retn. - const ORB_RequestSeq &in (void) const; - ORB_RequestSeq &inout (void); - ORB_RequestSeq *&out (void); - ORB_RequestSeq *_retn (void); - ORB_RequestSeq *ptr (void) const; - - private: - ORB_RequestSeq *ptr_; - }; - - class TAO_DynamicInterface_Export ORB_RequestSeq_out - { - public: - ORB_RequestSeq_out (ORB_RequestSeq *&); - ORB_RequestSeq_out (ORB_RequestSeq_var &); - ORB_RequestSeq_out (ORB_RequestSeq_out &); - ORB_RequestSeq_out &operator= (ORB_RequestSeq_out &); - ORB_RequestSeq_out &operator= (ORB_RequestSeq *); - operator ORB_RequestSeq *&(); - ORB_RequestSeq *&ptr (void); - ORB_RequestSeq *operator-> (void); - CORBA::Octet &operator[] (CORBA::ULong slot); - - private: - ORB_RequestSeq *&ptr_; - - /// Assignment from T_var not allowed. - void operator= (const ORB_RequestSeq_var &); - }; - } // End CORBA namespace. #if defined (__ACE_INLINE__) diff --git a/TAO/tao/DynamicInterface/Request.inl b/TAO/tao/DynamicInterface/Request.inl index 730890705f3..c3e46261bf5 100644 --- a/TAO/tao/DynamicInterface/Request.inl +++ b/TAO/tao/DynamicInterface/Request.inl @@ -163,163 +163,4 @@ CORBA::Request::raw_user_exception (void) return this->raw_user_exception_; } -// ************************************************************* -// Inline operations for class CORBA::Request_var -// ************************************************************* -ACE_INLINE -CORBA::Request_var::Request_var (void) - : ptr_ (CORBA::Request::_nil ()) -{ -} - -ACE_INLINE -CORBA::Request_var::Request_var (CORBA::Request_ptr p) - : ptr_ (p) -{} - -ACE_INLINE -CORBA::Request_var::~Request_var (void) -{ - CORBA::release (this->ptr_); -} - -ACE_INLINE CORBA::Request_ptr -CORBA::Request_var::ptr (void) const -{ - return this->ptr_; -} - -ACE_INLINE -CORBA::Request_var::Request_var (const Request_var &p) - : ptr_ (CORBA::Request::_duplicate (p.ptr ())) -{} - -ACE_INLINE CORBA::Request_var & -CORBA::Request_var::operator= (CORBA::Request_ptr p) -{ - CORBA::release (this->ptr_); - this->ptr_ = p; - return *this; -} - -ACE_INLINE CORBA::Request_var & -CORBA::Request_var::operator= (const CORBA::Request_var &p) -{ - if (this != &p) - { - CORBA::release (this->ptr_); - this->ptr_ = CORBA::Request::_duplicate (p.ptr ()); - } - return *this; -} - -ACE_INLINE -CORBA::Request_var::operator const CORBA::Request_ptr &() const -{ - return this->ptr_; -} - -ACE_INLINE -CORBA::Request_var::operator CORBA::Request_ptr &() -{ - return this->ptr_; -} - -ACE_INLINE CORBA::Request_ptr -CORBA::Request_var::operator-> (void) const -{ - return this->ptr_; -} - -ACE_INLINE CORBA::Request_ptr -CORBA::Request_var::in (void) const -{ - return this->ptr_; -} - -ACE_INLINE CORBA::Request_ptr & -CORBA::Request_var::inout (void) -{ - return this->ptr_; -} - -ACE_INLINE CORBA::Request_ptr & -CORBA::Request_var::out (void) -{ - CORBA::release (this->ptr_); - this->ptr_ = CORBA::Request::_nil (); - return this->ptr_; -} - -ACE_INLINE CORBA::Request_ptr -CORBA::Request_var::_retn (void) -{ - // yield ownership - CORBA::Request_ptr val = this->ptr_; - this->ptr_ = CORBA::Request::_nil (); - return val; -} - -// ************************************************************* -// Inline operations for class CORBA::Request_out -// ************************************************************* - -ACE_INLINE -CORBA::Request_out::Request_out (CORBA::Request_ptr &p) - : ptr_ (p) -{ - this->ptr_ = CORBA::Request::_nil (); -} - -ACE_INLINE -CORBA::Request_out::Request_out (CORBA::Request_var &p) - : ptr_ (p.out ()) -{ - CORBA::release (this->ptr_); - this->ptr_ = CORBA::Request::_nil (); -} - -ACE_INLINE -CORBA::Request_out::Request_out (CORBA::Request_out &p) - : ptr_ (p.ptr_) -{} - -ACE_INLINE CORBA::Request_out & -CORBA::Request_out::operator= (CORBA::Request_out &p) -{ - this->ptr_ = p.ptr_; - return *this; -} - -ACE_INLINE CORBA::Request_out & -CORBA::Request_out::operator= (const CORBA::Request_var &p) -{ - this->ptr_ = CORBA::Request::_duplicate (p.ptr ()); - return *this; -} - -ACE_INLINE CORBA::Request_out & -CORBA::Request_out::operator= (CORBA::Request_ptr p) -{ - this->ptr_ = p; - return *this; -} - -ACE_INLINE -CORBA::Request_out::operator CORBA::Request_ptr &() -{ - return this->ptr_; -} - -ACE_INLINE CORBA::Request_ptr & -CORBA::Request_out::ptr (void) -{ - return this->ptr_; -} - -ACE_INLINE CORBA::Request_ptr -CORBA::Request_out::operator-> (void) -{ - return this->ptr_; -} diff --git a/TAO/tao/DynamicInterface/Server_Request.cpp b/TAO/tao/DynamicInterface/Server_Request.cpp index 8981cb2a7a4..f991bbe90b2 100644 --- a/TAO/tao/DynamicInterface/Server_Request.cpp +++ b/TAO/tao/DynamicInterface/Server_Request.cpp @@ -231,3 +231,16 @@ CORBA::ServerRequest::gateway_exception_reply (ACE_CString &raw_exception) this->orb_server_request_.tao_send_reply (); } + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + + template class TAO_Pseudo_Var_T<CORBA::ServerRequest>; + template class TAO_Pseudo_Out_T<CORBA::ServerRequest, CORBA::ServerRequest_var>; + +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +# pragma instantiate TAO_Pseudo_Var_T<CORBA::ServerRequest> +# pragma instantiate TAO_Pseudo_Out_T<CORBA::ServerRequest, CORBA::ServerRequest_var> + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + diff --git a/TAO/tao/DynamicInterface/Server_Request.h b/TAO/tao/DynamicInterface/Server_Request.h index 6102941101b..73dde20f07b 100644 --- a/TAO/tao/DynamicInterface/Server_Request.h +++ b/TAO/tao/DynamicInterface/Server_Request.h @@ -39,6 +39,10 @@ namespace CORBA { + class ServerRequest; + typedef TAO_Pseudo_Var_T<ServerRequest> ServerRequest_var; + typedef TAO_Pseudo_Out_T<ServerRequest, ServerRequest_var> ServerRequest_out; + class TAO_DynamicInterface_Export ServerRequest { // = TITLE @@ -123,11 +127,8 @@ namespace CORBA // Returns a user exception through a TAO gateway without // knowing its type. -#if !defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ >= 8 // Useful for template programming. - typedef CORBA::ServerRequest_ptr _ptr_type; -#endif /* __GNUC__ */ - + typedef CORBA::ServerRequest_ptr _ptr_type; private: int lazy_evaluation_; diff --git a/TAO/tao/Environment.cpp b/TAO/tao/Environment.cpp index 86a43612b17..0b5b1c6de6c 100644 --- a/TAO/tao/Environment.cpp +++ b/TAO/tao/Environment.cpp @@ -224,3 +224,16 @@ CORBA::Environment_var::operator= (const CORBA::Environment_var &r) tmp.ptr_ = tmp_ptr; return *this; } + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + + template class TAO_Pseudo_Var_T<CORBA::Environment>; + template class TAO_Pseudo_Out_T<CORBA::Environment, CORBA::Environment_var>; + +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +# pragma instantiate TAO_Pseudo_Var_T<CORBA::Environment> +# pragma instantiate TAO_Pseudo_Out_T<CORBA::Environment, CORBA::Environment_var> + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + diff --git a/TAO/tao/LocalObject.cpp b/TAO/tao/LocalObject.cpp index 28eccdf3206..f7ce24aa71f 100644 --- a/TAO/tao/LocalObject.cpp +++ b/TAO/tao/LocalObject.cpp @@ -236,3 +236,16 @@ TAO_Local_RefCounted_Object::_remove_ref (void) delete this; } + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + + template class TAO_Pseudo_Var_T<CORBA::LocalObject>; + template class TAO_Pseudo_Out_T<CORBA::LocalObject, CORBA::LocalObject_var>; + +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +# pragma instantiate TAO_Pseudo_Var_T<CORBA::LocalObject> +# pragma instantiate TAO_Pseudo_Out_T<CORBA::LocalObject, CORBA::LocalObject_var> + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + diff --git a/TAO/tao/NVList.cpp b/TAO/tao/NVList.cpp index 014f76d5eef..fa389b5b5df 100644 --- a/TAO/tao/NVList.cpp +++ b/TAO/tao/NVList.cpp @@ -481,6 +481,10 @@ CORBA::NVList::_lazy_has_arguments (void) const template class ACE_Node<CORBA::NamedValue_ptr>; template class ACE_Unbounded_Queue<CORBA::NamedValue_ptr>; template class ACE_Unbounded_Queue_Iterator<CORBA::NamedValue_ptr>; +template class TAO_Pseudo_Var_T<CORBA::NamedValue>; +template class TAO_Pseudo_Out_T<CORBA::NamedValue, CORBA::NamedValue_var>; +template class TAO_Pseudo_Var_T<CORBA::NVList>; +template class TAO_Pseudo_Out_T<CORBA::NVList, CORBA::NVList_var>; # if defined (ACE_LACKS_AUTO_PTR) \ || !(defined (ACE_HAS_STANDARD_CPP_LIBRARY) \ && (ACE_HAS_STANDARD_CPP_LIBRARY != 0)) @@ -491,6 +495,10 @@ template class auto_ptr<TAO_InputCDR>; #pragma instantiate ACE_Node<CORBA::NamedValue_ptr> #pragma instantiate ACE_Unbounded_Queue<CORBA::NamedValue_ptr> #pragma instantiate ACE_Unbounded_Queue_Iterator<CORBA::NamedValue_ptr> +#pragma instantiate TAO_Pseudo_Var_T<CORBA::NamedValue> +#pragma instantiate TAO_Pseudo_Out_T<CORBA::NamedValue, CORBA::NamedValue_var> +#pragma instantiate TAO_Pseudo_Var_T<CORBA::NVList> +#pragma instantiate TAO_Pseudo_Out_T<CORBA::NVList, CORBA::NVList_var> # if defined (ACE_LACKS_AUTO_PTR) \ || !(defined (ACE_HAS_STANDARD_CPP_LIBRARY) \ && (ACE_HAS_STANDARD_CPP_LIBRARY != 0)) diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index fc9a8bee1a6..4a5dd900757 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -2099,3 +2099,64 @@ CORBA::ORB::lookup_value_factory (const char *repository_id return 0; // %! raise exception ! } } + +#if (TAO_HAS_MINIMUM_CORBA == 0) + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + + template class TAO_Pseudo_Var_T<CORBA::Request>; + template class TAO_Pseudo_Out_T<CORBA::Request, CORBA::Request_var>; + template class + TAO_Unbounded_Pseudo_Sequence< + CORBA::Request, + CORBA::Request_var + >; + template class + TAO_VarSeq_Var_T< + CORBA::ORB::RequestSeq, + TAO_Pseudo_Object_Manager< + CORBA::Request, + CORBA::Request_var + > + >; + template class + TAO_Seq_Out_T< + CORBA::ORB::RequestSeq, + CORBA::ORB::RequestSeq_var, + TAO_Pseudo_Object_Manager< + CORBA::Request, + CORBA::Request_var + > + >; + +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +# pragma instantiate TAO_Pseudo_Var_T<CORBA::Request> +# pragma instantiate TAO_Pseudo_Out_T<CORBA::Request, CORBA::Request_var> +# pragma instantiate \ + TAO_Unbounded_Pseudo_Sequence< \ + CORBA::Request, \ + CORBA::Request_var \ + > +# pragma instantiate \ + TAO_VarSeq_Var_T< \ + CORBA::ORB::RequestSeq, \ + TAO_Pseudo_Object_Manager< \ + CORBA::Request, \ + CORBA::Request_var \ + > \ + > +# pragma instantiate \ + TAO_Seq_Out_T< \ + CORBA::ORB::RequestSeq, \ + CORBA::ORB::RequestSeq_var, \ + TAO_Pseudo_Object_Manager< \ + CORBA::Request, \ + CORBA::Request_var \ + > \ + > + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + +#endif /* TAO_HAS_MINIMUM_CORBA */ + diff --git a/TAO/tao/ORB.h b/TAO/tao/ORB.h index 7f80cd78514..93285683985 100644 --- a/TAO/tao/ORB.h +++ b/TAO/tao/ORB.h @@ -70,9 +70,13 @@ namespace CORBA class ORB_ObjectIdList_var; class ORB_ObjectIdList_out; - class ORB_RequestSeq; - class ORB_RequestSeq_var; - class ORB_RequestSeq_out; + class ORB; + typedef TAO_Pseudo_Var_T<ORB> ORB_var; + typedef TAO_Pseudo_Out_T<ORB, ORB_var> ORB_out; + + class Request; + typedef TAO_Pseudo_Var_T<Request> Request_var; + typedef TAO_Pseudo_Out_T<Request, Request_var> Request_out; /** * @class ORB @@ -170,11 +174,35 @@ namespace CORBA #if (TAO_HAS_MINIMUM_CORBA == 0) // Typedefs for CORBA::ORB::RequestSeq, which is an argument of - // send_multiple_requests_*(). See Request.{h,i,cpp} for - // definitions. - typedef CORBA::ORB_RequestSeq RequestSeq; - typedef CORBA::ORB_RequestSeq_var RequestSeq_var; - typedef CORBA::ORB_RequestSeq_out RequestSeq_out; + // send_multiple_requests_*(). + + typedef + TAO_Unbounded_Pseudo_Sequence< + CORBA::Request, + CORBA::Request_var + > + RequestSeq; + + typedef + TAO_VarSeq_Var_T< + RequestSeq, + TAO_Pseudo_Object_Manager< + CORBA::Request, + CORBA::Request_var + > + > + RequestSeq_var; + + typedef + TAO_Seq_Out_T< + RequestSeq, + RequestSeq_var, + TAO_Pseudo_Object_Manager< + CORBA::Request, + CORBA::Request_var + > + > + RequestSeq_out; void create_list (CORBA::Long count, CORBA::NVList_ptr &new_list @@ -529,11 +557,13 @@ namespace CORBA /// Resolve the Policy Manager for this ORB. CORBA::Object_ptr resolve_policy_manager ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED); + ACE_ENV_SINGLE_ARG_DECL_NOT_USED + ); /// Resolve the Policy Current for this thread. CORBA::Object_ptr resolve_policy_current ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED); + ACE_ENV_SINGLE_ARG_DECL_NOT_USED + ); private: @@ -589,62 +619,6 @@ namespace CORBA ACE_Time_Value *timeout_; }; - - /** - * @class ORB_var - * - * @brief CORBA::ORB_var implementation. - * - * CORBA::ORB_var implementation. - */ - class TAO_Export ORB_var - { - public: - ORB_var (void); // default constructor - ORB_var (CORBA::ORB_ptr); - ORB_var (const ORB_var &); // copy constructor - ~ORB_var (void); // destructor - - ORB_var &operator= (CORBA::ORB_ptr); - ORB_var &operator= (const ORB_var &); - CORBA::ORB_ptr operator-> (void) const; - - /// in, inout, out, _retn - operator const CORBA::ORB_ptr &() const; - operator CORBA::ORB_ptr &(); - CORBA::ORB_ptr in (void) const; - CORBA::ORB_ptr &inout (void); - CORBA::ORB_ptr &out (void); - CORBA::ORB_ptr _retn (void); - CORBA::ORB_ptr ptr (void) const; - - private: - CORBA::ORB_ptr ptr_; - }; - - /** - * @class ORB_out - * - * @brief CORBA::ORB_out implementation. - * - * CORBA::ORB_out implementation. - */ - class TAO_Export ORB_out - { - public: - ORB_out (CORBA::ORB_ptr &); - ORB_out (CORBA::ORB_var &); - ORB_out (const ORB_out &); - ORB_out &operator= (ORB_out &); - ORB_out &operator= (const CORBA::ORB_var &); - ORB_out &operator= (CORBA::ORB_ptr); - operator CORBA::ORB_ptr &(); - CORBA::ORB_ptr &ptr (void); - CORBA::ORB_ptr operator-> (void); - - private: - CORBA::ORB_ptr &ptr_; - }; } // End namespace CORBA #if defined (__ACE_INLINE__) diff --git a/TAO/tao/ORB.i b/TAO/tao/ORB.i index 2a219388c0a..16a9d6be7e6 100644 --- a/TAO/tao/ORB.i +++ b/TAO/tao/ORB.i @@ -10,7 +10,10 @@ ACE_INLINE CORBA::ULong CORBA::ORB::_incr_refcnt (void) { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, lock_, 0); + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, + guard, + lock_, + 0); return ++this->refcount_; } @@ -20,8 +23,11 @@ CORBA::ORB::_decr_refcnt (void) { ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_, 0); this->refcount_--; + if (this->refcount_ != 0) - return this->refcount_; + { + return this->refcount_; + } } delete this; @@ -32,7 +38,10 @@ ACE_INLINE CORBA::ORB_ptr CORBA::ORB::_duplicate (CORBA::ORB_ptr obj) { if (obj) - obj->_incr_refcnt (); + { + obj->_incr_refcnt (); + } + return obj; } @@ -79,165 +88,3 @@ CORBA::release (CORBA::ORB_ptr obj) obj->_decr_refcnt (); } -// ************************************************************* -// Inline operations for class CORBA::ORB_var -// ************************************************************* - -ACE_INLINE -CORBA::ORB_var::ORB_var (void) // default constructor - : ptr_ (CORBA::ORB::_nil ()) -{ -} - -ACE_INLINE -CORBA::ORB_var::ORB_var (CORBA::ORB_ptr p) - : ptr_ (p) -{ -} - -ACE_INLINE CORBA::ORB_ptr -CORBA::ORB_var::ptr (void) const -{ - return this->ptr_; -} - -ACE_INLINE -CORBA::ORB_var::ORB_var (const CORBA::ORB_var &p) // copy constructor - : ptr_ (CORBA::ORB::_duplicate (p.ptr ())) -{ -} - -ACE_INLINE -CORBA::ORB_var::~ORB_var (void) // destructor -{ - CORBA::release (this->ptr_); -} - -ACE_INLINE CORBA::ORB_var & -CORBA::ORB_var::operator= (CORBA::ORB_ptr p) -{ - CORBA::release (this->ptr_); - this->ptr_ = p; - return *this; -} - -ACE_INLINE CORBA::ORB_var & -CORBA::ORB_var::operator= (const CORBA::ORB_var &p) -{ - if (this != &p) - { - CORBA::release (this->ptr_); - this->ptr_ = CORBA::ORB::_duplicate (p.ptr ()); - } - return *this; -} - -ACE_INLINE -CORBA::ORB_var::operator const CORBA::ORB_ptr &() const // cast -{ - return this->ptr_; -} - -ACE_INLINE -CORBA::ORB_var::operator CORBA::ORB_ptr &() // cast -{ - return this->ptr_; -} - -ACE_INLINE CORBA::ORB_ptr -CORBA::ORB_var::operator-> (void) const -{ - return this->ptr_; -} - -ACE_INLINE CORBA::ORB_ptr -CORBA::ORB_var::in (void) const -{ - return this->ptr_; -} - -ACE_INLINE CORBA::ORB_ptr & -CORBA::ORB_var::inout (void) -{ - return this->ptr_; -} - -ACE_INLINE CORBA::ORB_ptr & -CORBA::ORB_var::out (void) -{ - CORBA::release (this->ptr_); - this->ptr_ = CORBA::ORB::_nil (); - return this->ptr_; -} - -ACE_INLINE CORBA::ORB_ptr -CORBA::ORB_var::_retn (void) -{ - // yield ownership of managed obj reference - CORBA::ORB_ptr val = this->ptr_; - this->ptr_ = CORBA::ORB::_nil (); - return val; -} - -// ************************************************************* -// Inline operations for class CORBA::ORB_out -// ************************************************************* - -ACE_INLINE -CORBA::ORB_out::ORB_out (CORBA::ORB_ptr &p) - : ptr_ (p) -{ - this->ptr_ = CORBA::ORB::_nil (); -} - -ACE_INLINE -CORBA::ORB_out::ORB_out (CORBA::ORB_var &p) // constructor from _var - : ptr_ (p.out ()) -{ - CORBA::release (this->ptr_); - this->ptr_ = CORBA::ORB::_nil (); -} - -ACE_INLINE -CORBA::ORB_out::ORB_out (const CORBA::ORB_out &p) // copy constructor - : ptr_ (p.ptr_) -{} - -ACE_INLINE CORBA::ORB_out & -CORBA::ORB_out::operator= (CORBA::ORB_out &p) -{ - this->ptr_ = p.ptr_; - return *this; -} - -ACE_INLINE CORBA::ORB_out & -CORBA::ORB_out::operator= (const CORBA::ORB_var &p) -{ - this->ptr_ = CORBA::ORB::_duplicate (p.ptr ()); - return *this; -} - -ACE_INLINE CORBA::ORB_out & -CORBA::ORB_out::operator= (CORBA::ORB_ptr p) -{ - this->ptr_ = p; - return *this; -} - -ACE_INLINE -CORBA::ORB_out::operator CORBA::ORB_ptr &() // cast -{ - return this->ptr_; -} - -ACE_INLINE CORBA::ORB_ptr & -CORBA::ORB_out::ptr (void) // ptr -{ - return this->ptr_; -} - -ACE_INLINE CORBA::ORB_ptr -CORBA::ORB_out::operator-> (void) -{ - return this->ptr_; -} diff --git a/TAO/tao/Object.cpp b/TAO/tao/Object.cpp index 304890b14df..777145f80ca 100644 --- a/TAO/tao/Object.cpp +++ b/TAO/tao/Object.cpp @@ -717,9 +717,13 @@ TAO_Object_Proxy_Broker * (*_TAO_collocation_Object_Proxy_Broker_Factory_functio #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class TAO_Object_Manager<CORBA::Object, CORBA::Object_var>; +template class TAO_Pseudo_Var_T<CORBA::Object>; +template class TAO_Pseudo_Out_T<CORBA::Object, CORBA::Object_var>; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) #pragma instantiate TAO_Object_Manager<CORBA::Object, CORBA::Object_var> +#pragma instantiate TAO_Pseudo_Var_T<CORBA::Object> +#pragma instantiate TAO_Pseudo_Out_T<CORBA::Object, CORBA::Object_var> #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/tao/Principal.cpp b/TAO/tao/Principal.cpp index 023ae74e00d..b6abcf7ee94 100644 --- a/TAO/tao/Principal.cpp +++ b/TAO/tao/Principal.cpp @@ -62,3 +62,16 @@ operator>> (TAO_InputCDR & cdr, CORBA::Principal *& x) return (CORBA::Boolean) cdr.good_bit (); } + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + + template class TAO_Pseudo_Var_T<CORBA::Principal>; + template class TAO_Pseudo_Out_T<CORBA::Principal, CORBA::Principal_var>; + +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +# pragma instantiate TAO_Pseudo_Var_T<CORBA::Principal> +# pragma instantiate TAO_Pseudo_Out_T<CORBA::Principal, CORBA::Principal_var> + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + diff --git a/TAO/tao/Pseudo_VarOut_T.h b/TAO/tao/Pseudo_VarOut_T.h index dc38bc2eab1..6027f7117d5 100644 --- a/TAO/tao/Pseudo_VarOut_T.h +++ b/TAO/tao/Pseudo_VarOut_T.h @@ -25,7 +25,8 @@ * * @brief Parametrized implementation of _var class for * TypeCode, Object, AbstractBase, NamedValue, NVList, - * Principal, Request, Context, and Environment. + * Principal, Request, Context, ORB, LocalObject, + * and Environment. * */ template <typename T> @@ -63,7 +64,8 @@ private: * * @brief Parametrized implementation of _out class for * TypeCode, Object, AbstractBase, NamedValue, NVList, - * Principal, Request, Context, and Environment. + * Principal, Request, Context, ORB, LocalObject, + * and Environment. * */ template <typename T, typename T_var> diff --git a/TAO/tao/TAO.dsp b/TAO/tao/TAO.dsp index 175834a9b2d..dedc256bfc6 100644 --- a/TAO/tao/TAO.dsp +++ b/TAO/tao/TAO.dsp @@ -1647,6 +1647,10 @@ SOURCE=.\Protocols_Hooks.h # End Source File
# Begin Source File
+SOURCE=.\Pseudo_Value_VarOut_T.h
+# End Source File
+# Begin Source File
+
SOURCE=.\Pseudo_VarOut_T.h
# End Source File
# Begin Source File
@@ -2459,6 +2463,10 @@ SOURCE=.\typecode.i # End Source File
# Begin Source File
+SOURCE=.\Value_VarOut_T.inl
+# End Source File
+# Begin Source File
+
SOURCE=.\ValueBase.i
# End Source File
# Begin Source File
@@ -2507,6 +2515,11 @@ SOURCE=.\Objref_VarOut_T.cpp # End Source File
# Begin Source File
+SOURCE=.\Pseudo_Value_VarOut_T.cpp
+# PROP Exclude_From_Build 1
+# End Source File
+# Begin Source File
+
SOURCE=.\Pseudo_VarOut_T.cpp
# PROP Exclude_From_Build 1
# End Source File
diff --git a/TAO/tao/Typecode.cpp b/TAO/tao/Typecode.cpp index da69d007592..cfdf3dfbaec 100644 --- a/TAO/tao/Typecode.cpp +++ b/TAO/tao/Typecode.cpp @@ -3712,6 +3712,9 @@ template class ACE_Hash_Map_Iterator_Ex<const char *, ACE_Equal_To<const char *>, ACE_Null_Mutex>; +template class TAO_Pseudo_Var_T<CORBA::TypeCode>; +template class TAO_Pseudo_Out_T<CORBA::TypeCode, CORBA::TypeCode_var>; + #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) #pragma instantiate TAO_Pseudo_Object_Manager<CORBA::TypeCode, CORBA::TypeCode_var> @@ -3726,4 +3729,7 @@ template class ACE_Hash_Map_Iterator_Ex<const char *, #pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<const char *, ACE_Unbounded_Queue<CORBA::Long> *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, ACE_Null_Mutex> #pragma instantiate ACE_Hash_Map_Iterator_Ex<const char *, ACE_Unbounded_Queue<CORBA::Long> *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, ACE_Null_Mutex> +#pragma instantiate TAO_Pseudo_Var_T<CORBA::TypeCode> +#pragma instantiate TAO_Pseudo_Out_T<CORBA::TypeCode, CORBA::TypeCode_var> + #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/tao/ValueBase.cpp b/TAO/tao/ValueBase.cpp index eb15f38a4a8..cebdacc77ff 100644 --- a/TAO/tao/ValueBase.cpp +++ b/TAO/tao/ValueBase.cpp @@ -350,3 +350,15 @@ operator>> (TAO_InputCDR &strm, _tao_valuetype); } +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + + template class TAO_Pseudo_Value_Var_T<CORBA::ValueBase>; + template class TAO_Pseudo_Value_Out_T<CORBA::ValueBase, CORBA::ValueBase_var>; + +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +# pragma instantiate TAO_Pseudo_Value_Var_T<CORBA::ValueBase> +# pragma instantiate TAO_Pseudo_Value_Out_T<CORBA::ValueBase, CORBA::ValueBase_var> + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + diff --git a/TAO/tao/ValueFactory.cpp b/TAO/tao/ValueFactory.cpp index 6cf497f3750..58e4a5e4b3b 100644 --- a/TAO/tao/ValueFactory.cpp +++ b/TAO/tao/ValueFactory.cpp @@ -21,3 +21,15 @@ CORBA::ValueFactoryBase::create_for_unmarshal_abstract (void) return 0; } +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + + template class TAO_Pseudo_Value_Var_T<CORBA::ValueFactoryBase>; + template class TAO_Pseudo_Value_Out_T<CORBA::ValueFactoryBase, CORBA::ValueFactoryBase_var>; + +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +# pragma instantiate TAO_Pseudo_Value_Var_T<CORBA::ValueFactoryBase> +# pragma instantiate TAO_Pseudo_Value_Out_T<CORBA::ValueFactoryBase, CORBA::ValueFactoryBase_var> + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + diff --git a/TAO/tao/corbafwd.h b/TAO/tao/corbafwd.h index 8edce9067a9..2b9952db6f8 100644 --- a/TAO/tao/corbafwd.h +++ b/TAO/tao/corbafwd.h @@ -209,8 +209,6 @@ namespace CORBA class Request; typedef Request * Request_ptr; - class Request_var; - class Request_out; class NamedValue; typedef NamedValue * NamedValue_ptr; @@ -220,13 +218,9 @@ namespace CORBA class Context; typedef Context * Context_ptr; - class Context_var; - class Context_out; class ContextList; typedef ContextList *ContextList_ptr; - class ContextList_var; - class ContextList_out; class Object; typedef Object *Object_ptr; @@ -239,14 +233,11 @@ namespace CORBA class ORB; typedef ORB *ORB_ptr; - class ORB_var; - class ORB_out; class ServerRequest; typedef ServerRequest *ServerRequest_ptr; class ExceptionList; - class ExceptionList_var; typedef ExceptionList *ExceptionList_ptr; class ImplementationDef; @@ -367,10 +358,10 @@ namespace CORBA TAO_NAMESPACE_INLINE_FUNCTION Boolean is_nil (TypeCode_ptr); TAO_NAMESPACE_INLINE_FUNCTION Boolean is_nil (ORB_ptr); TAO_NAMESPACE_INLINE_FUNCTION Boolean is_nil (Principal_ptr); - extern TAO_Export Boolean is_nil (Request_ptr); - extern TAO_Export Boolean is_nil (ServerRequest_ptr req); TAO_NAMESPACE_INLINE_FUNCTION Boolean is_nil (NamedValue_ptr); TAO_NAMESPACE_INLINE_FUNCTION Boolean is_nil (NVList_ptr); + extern TAO_Export Boolean is_nil (Request_ptr); + extern TAO_Export Boolean is_nil (ServerRequest_ptr); extern TAO_Export Boolean is_nil (Context_ptr); //@} @@ -386,10 +377,10 @@ namespace CORBA TAO_NAMESPACE_INLINE_FUNCTION void release (Principal_ptr); TAO_NAMESPACE_INLINE_FUNCTION void release (TypeCode_ptr); TAO_NAMESPACE_INLINE_FUNCTION void release (ORB_ptr); - extern TAO_Export void release (Request_ptr); - extern TAO_Export void release (ServerRequest_ptr req); TAO_NAMESPACE_INLINE_FUNCTION void release (NamedValue_ptr); TAO_NAMESPACE_INLINE_FUNCTION void release (NVList_ptr); + extern TAO_Export void release (Request_ptr); + extern TAO_Export void release (ServerRequest_ptr); extern TAO_Export void release (Context_ptr); //@} |