diff options
Diffstat (limited to 'TAO/tao/DynamicInterface')
-rw-r--r-- | TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp | 209 | ||||
-rw-r--r-- | TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.h | 58 | ||||
-rw-r--r-- | TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.inl | 94 |
3 files changed, 282 insertions, 79 deletions
diff --git a/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp b/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp index d30dfc9eaee..093dcff9263 100644 --- a/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp +++ b/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp @@ -23,48 +23,215 @@ ACE_RCSID (DynamicInterface, AMH_DSI_Response_Handler, TAO_BEGIN_VERSIONED_NAMESPACE_DECL -TAO_AMH_DSI_Response_Handler_ptr -TAO::Objref_Traits<TAO_AMH_DSI_Response_Handler>::duplicate ( - TAO_AMH_DSI_Response_Handler_ptr p) +const char* +TAO_AMH_DSI_Exception_Holder::_tao_obv_static_repository_id () +{ + return "IDL:TAO_AMH_DSI_Exception_Holder:1.0"; +} + +TAO_AMH_DSI_Exception_Holder::TAO_AMH_DSI_Exception_Holder (CORBA::Exception *ex) + : exception_ (ex) +{ +} + +TAO_AMH_DSI_Exception_Holder::~TAO_AMH_DSI_Exception_Holder () { - return TAO_AMH_DSI_Response_Handler::_duplicate (p); } void -TAO::Objref_Traits<TAO_AMH_DSI_Response_Handler>::release ( - TAO_AMH_DSI_Response_Handler_ptr p) +tao_TAO_AMH_DSI_Exception_Holder_add_ref (TAO_AMH_DSI_Exception_Holder * p) { - ::CORBA::release (p); + CORBA::add_ref (p); } -TAO_AMH_DSI_Response_Handler_ptr -TAO::Objref_Traits<TAO_AMH_DSI_Response_Handler>::nil (void) +void +tao_TAO_AMH_DSI_Exception_Holder_remove_ref (TAO_AMH_DSI_Exception_Holder * p) { - return TAO_AMH_DSI_Response_Handler::_nil (); + CORBA::remove_ref (p); } -::CORBA::Boolean -TAO::Objref_Traits<TAO_AMH_DSI_Response_Handler>::marshal ( - const TAO_AMH_DSI_Response_Handler_ptr p, - TAO_OutputCDR & cdr) + +TAO_AMH_DSI_Exception_Holder_var::TAO_AMH_DSI_Exception_Holder_var (void) + : ptr_ (0) { - return ::CORBA::Object::marshal (p, cdr); } +TAO_AMH_DSI_Exception_Holder_var::TAO_AMH_DSI_Exception_Holder_var ( + TAO_AMH_DSI_Exception_Holder * p) + : ptr_ (p) +{ +} -const char* -TAO_AMH_DSI_Exception_Holder::_tao_obv_static_repository_id () +TAO_AMH_DSI_Exception_Holder_var::TAO_AMH_DSI_Exception_Holder_var ( + const TAO_AMH_DSI_Exception_Holder * p) + : ptr_ (const_cast<TAO_AMH_DSI_Exception_Holder *> (p)) { - return "IDL:TAO_AMH_DSI_Exception_Holder:1.0"; } -TAO_AMH_DSI_Exception_Holder::TAO_AMH_DSI_Exception_Holder (CORBA::Exception *ex) - : exception_ (ex) +TAO_AMH_DSI_Exception_Holder * +TAO_AMH_DSI_Exception_Holder_var::ptr (void) const { + return this->ptr_; } -TAO_AMH_DSI_Exception_Holder::~TAO_AMH_DSI_Exception_Holder () +TAO_AMH_DSI_Exception_Holder_var::TAO_AMH_DSI_Exception_Holder_var ( + const TAO_AMH_DSI_Exception_Holder_var & p) +{ + CORBA::add_ref (p.ptr ()); + this->ptr_ = p.ptr (); +} + +TAO_AMH_DSI_Exception_Holder_var::~TAO_AMH_DSI_Exception_Holder_var (void) +{ + CORBA::remove_ref (this->ptr_); +} + +TAO_AMH_DSI_Exception_Holder_var & +TAO_AMH_DSI_Exception_Holder_var::operator= (TAO_AMH_DSI_Exception_Holder *p) +{ + CORBA::remove_ref (this->ptr_); + this->ptr_ = p; + return *this; +} + +TAO_AMH_DSI_Exception_Holder_var & +TAO_AMH_DSI_Exception_Holder_var::operator= ( + const TAO_AMH_DSI_Exception_Holder_var & p) +{ + if (this != &p) + { + CORBA::remove_ref (this->ptr_); + TAO_AMH_DSI_Exception_Holder *tmp = p.ptr (); + CORBA::add_ref (tmp); + this->ptr_ = tmp; + } + + return *this; +} + +TAO_AMH_DSI_Exception_Holder_var::operator const TAO_AMH_DSI_Exception_Holder* ( + ) const // cast +{ + return this->ptr_; +} + +TAO_AMH_DSI_Exception_Holder_var::operator TAO_AMH_DSI_Exception_Holder*& ( + ) // cast +{ + return this->ptr_; +} + +TAO_AMH_DSI_Exception_Holder * +TAO_AMH_DSI_Exception_Holder_var::operator-> (void) const +{ + return this->ptr_; +} + +TAO_AMH_DSI_Exception_Holder * +TAO_AMH_DSI_Exception_Holder_var::in (void) const +{ + return this->ptr_; +} + +TAO_AMH_DSI_Exception_Holder *& +TAO_AMH_DSI_Exception_Holder_var::inout (void) +{ + return this->ptr_; +} + +TAO_AMH_DSI_Exception_Holder *& +TAO_AMH_DSI_Exception_Holder_var::out (void) +{ + CORBA::remove_ref (this->ptr_); + this->ptr_ = 0; + return this->ptr_; +} + +TAO_AMH_DSI_Exception_Holder * +TAO_AMH_DSI_Exception_Holder_var::_retn (void) +{ + // yield ownership of managed obj reference + TAO_AMH_DSI_Exception_Holder* tmp = this->ptr_; + this->ptr_ = 0; + return tmp; +} + +void +TAO_AMH_DSI_Exception_Holder_var::tao_add_ref ( + TAO_AMH_DSI_Exception_Holder *p + ) +{ + CORBA::add_ref (p); +} + +void +TAO_AMH_DSI_Exception_Holder_var::tao_remove_ref ( + TAO_AMH_DSI_Exception_Holder *p + ) +{ + CORBA::remove_ref (p); +} + +TAO_AMH_DSI_Exception_Holder_out::TAO_AMH_DSI_Exception_Holder_out ( + TAO_AMH_DSI_Exception_Holder * &p) + : ptr_ (p) +{ + this->ptr_ = 0; +} + +TAO_AMH_DSI_Exception_Holder_out::TAO_AMH_DSI_Exception_Holder_out ( + TAO_AMH_DSI_Exception_Holder_var & p) + : ptr_ (p.out ()) +{ + CORBA::remove_ref (this->ptr_); + this->ptr_ = 0; +} + +TAO_AMH_DSI_Exception_Holder_out::TAO_AMH_DSI_Exception_Holder_out ( + const TAO_AMH_DSI_Exception_Holder_out &p) + : ptr_ (const_cast<TAO_AMH_DSI_Exception_Holder_out&> (p).ptr_) +{} + +TAO_AMH_DSI_Exception_Holder_out & +TAO_AMH_DSI_Exception_Holder_out::operator= ( + const TAO_AMH_DSI_Exception_Holder_out &p) +{ + this->ptr_ = const_cast<TAO_AMH_DSI_Exception_Holder_out &> (p).ptr_; + return *this; +} + +TAO_AMH_DSI_Exception_Holder_out & +TAO_AMH_DSI_Exception_Holder_out::operator= ( + const TAO_AMH_DSI_Exception_Holder_var &p) +{ + TAO_AMH_DSI_Exception_Holder *tmp = p.ptr (); + CORBA::add_ref (tmp); + this->ptr_ = tmp; + return *this; +} + +TAO_AMH_DSI_Exception_Holder_out & +TAO_AMH_DSI_Exception_Holder_out::operator= (TAO_AMH_DSI_Exception_Holder *p) +{ + this->ptr_ = p; + return *this; +} + +TAO_AMH_DSI_Exception_Holder_out::operator TAO_AMH_DSI_Exception_Holder*& () +{ + return this->ptr_; +} + +TAO_AMH_DSI_Exception_Holder *& +TAO_AMH_DSI_Exception_Holder_out::ptr (void) // ptr +{ + return this->ptr_; +} + +TAO_AMH_DSI_Exception_Holder * +TAO_AMH_DSI_Exception_Holder_out::operator-> (void) { + return this->ptr_; } TAO_AMH_DSI_Exception_Holder * diff --git a/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.h b/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.h index 68297811443..8f6af4aa735 100644 --- a/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.h +++ b/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.h @@ -24,45 +24,12 @@ #include "tao/PortableServer/PortableServer.h" #include "tao/Messaging/AMH_Response_Handler.h" #include "tao/Valuetype/ValueBase.h" -#include "tao/Valuetype/Value_VarOut_T.h" -#include "tao/Objref_VarOut_T.h" -#include "tao/VarOut_T.h" - #include "dynamicinterface_export.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL class TAO_AMH_DSI_Response_Handler; typedef TAO_AMH_DSI_Response_Handler *TAO_AMH_DSI_Response_Handler_ptr; -typedef - TAO_Objref_Var_T< - TAO_AMH_DSI_Response_Handler - > - TAO_AMH_DSI_Response_Handler_var; - -typedef - TAO_Objref_Out_T< - TAO_AMH_DSI_Response_Handler - > - TAO_AMH_DSI_Response_Handler_out; - -class TAO_AMH_DSI_Exception_Holder; -typedef - TAO_Value_Var_T< - TAO_AMH_DSI_Exception_Holder - > - TAO_AMH_DSI_Exception_Holder_var; - -typedef - TAO_Value_Out_T< - TAO_AMH_DSI_Exception_Holder - > - TAO_AMH_DSI_Exception_Holder_out; - -#if 0 - -class TAO_AMH_DSI_Response_Handler; -typedef TAO_AMH_DSI_Response_Handler *TAO_AMH_DSI_Response_Handler_ptr; /** * @class TAO_AMH_DSI_Response_Handler_var @@ -173,8 +140,6 @@ private: TAO_AMH_DSI_Exception_Holder* &ptr_; }; -#endif - /** * @class TAO_AMH_DSI_Exception_Holder * @@ -186,10 +151,7 @@ class TAO_DynamicInterface_Export TAO_AMH_DSI_Exception_Holder public virtual CORBA::ValueBase { public: - typedef TAO_AMH_DSI_Exception_Holder * _ptr_type; typedef TAO_AMH_DSI_Exception_Holder_var _var_type; - typedef TAO_AMH_DSI_Exception_Holder_out _out_type; - TAO_AMH_DSI_Exception_Holder (CORBA::Exception *ex); virtual ~TAO_AMH_DSI_Exception_Holder (void); @@ -254,7 +216,6 @@ class TAO_DynamicInterface_Export TAO_AMH_DSI_Response_Handler public: typedef TAO_AMH_DSI_Response_Handler_ptr _ptr_type; typedef TAO_AMH_DSI_Response_Handler_var _var_type; - typedef TAO_AMH_DSI_Response_Handler_out _out_type; TAO_AMH_DSI_Response_Handler (TAO_ServerRequest &sr); ~TAO_AMH_DSI_Response_Handler (void); @@ -292,25 +253,6 @@ private: TAO_ORB_Core *orb_core_; }; -namespace TAO { - template<> - struct Objref_Traits<TAO_AMH_DSI_Response_Handler> - { - static TAO_AMH_DSI_Response_Handler_ptr duplicate ( - TAO_AMH_DSI_Response_Handler_ptr - ); - static void release ( - TAO_AMH_DSI_Response_Handler_ptr - ); - static TAO_AMH_DSI_Response_Handler_ptr nil (void); - static ::CORBA::Boolean marshal ( - const TAO_AMH_DSI_Response_Handler_ptr p, - TAO_OutputCDR & cdr - ); - }; - -} - TAO_END_VERSIONED_NAMESPACE_DECL #if defined (__ACE_INLINE__) diff --git a/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.inl b/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.inl index 4d5057f8dd6..d9cb5ca1adc 100644 --- a/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.inl +++ b/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.inl @@ -14,4 +14,98 @@ TAO_AMH_DSI_Response_Handler::_duplicate (TAO_AMH_DSI_Response_Handler_ptr x) return x; } + +// Inline operations for class TAO_AMH_DSI_Response_Handler_var +ACE_INLINE +TAO_AMH_DSI_Response_Handler_var::TAO_AMH_DSI_Response_Handler_var (void) + : ptr_ (TAO_AMH_DSI_Response_Handler::_nil ()) +{ +} + +ACE_INLINE +TAO_AMH_DSI_Response_Handler_var::TAO_AMH_DSI_Response_Handler_var (TAO_AMH_DSI_Response_Handler_ptr p) + : ptr_ (p) +{} + +ACE_INLINE +TAO_AMH_DSI_Response_Handler_var::~TAO_AMH_DSI_Response_Handler_var (void) +{ +} + +ACE_INLINE TAO_AMH_DSI_Response_Handler_ptr +TAO_AMH_DSI_Response_Handler_var::ptr (void) const +{ + return this->ptr_; +} + +ACE_INLINE +TAO_AMH_DSI_Response_Handler_var::TAO_AMH_DSI_Response_Handler_var (const TAO_AMH_DSI_Response_Handler_var &p) + : ptr_ (TAO_AMH_DSI_Response_Handler::_duplicate (p.ptr ())) +{} + +ACE_INLINE TAO_AMH_DSI_Response_Handler_var & +TAO_AMH_DSI_Response_Handler_var::operator= (TAO_AMH_DSI_Response_Handler_ptr p) +{ + CORBA::release (this->ptr_); + this->ptr_ = p; + return *this; +} + +ACE_INLINE TAO_AMH_DSI_Response_Handler_var & +TAO_AMH_DSI_Response_Handler_var::operator= (const TAO_AMH_DSI_Response_Handler_var &p) +{ + if (this != &p) + { + CORBA::release (this->ptr_); + this->ptr_ = TAO_AMH_DSI_Response_Handler::_duplicate (p.ptr ()); + } + return *this; +} + +ACE_INLINE +TAO_AMH_DSI_Response_Handler_var::operator const TAO_AMH_DSI_Response_Handler_ptr &() const +{ + return this->ptr_; +} + +ACE_INLINE +TAO_AMH_DSI_Response_Handler_var::operator TAO_AMH_DSI_Response_Handler_ptr &() +{ + return this->ptr_; +} + +ACE_INLINE TAO_AMH_DSI_Response_Handler_ptr +TAO_AMH_DSI_Response_Handler_var::operator-> (void) const +{ + return this->ptr_; +} + +ACE_INLINE TAO_AMH_DSI_Response_Handler_ptr +TAO_AMH_DSI_Response_Handler_var::in (void) const +{ + return this->ptr_; +} + +ACE_INLINE TAO_AMH_DSI_Response_Handler_ptr & +TAO_AMH_DSI_Response_Handler_var::inout (void) +{ + return this->ptr_; +} + +ACE_INLINE TAO_AMH_DSI_Response_Handler_ptr & +TAO_AMH_DSI_Response_Handler_var::out (void) +{ + CORBA::release (this->ptr_); + this->ptr_ = TAO_AMH_DSI_Response_Handler::_nil (); + return this->ptr_; +} + +ACE_INLINE TAO_AMH_DSI_Response_Handler_ptr +TAO_AMH_DSI_Response_Handler_var::_retn (void) +{ + // yield ownership + TAO_AMH_DSI_Response_Handler_ptr val = this->ptr_; + this->ptr_ = TAO_AMH_DSI_Response_Handler::_nil (); + return val; +} TAO_END_VERSIONED_NAMESPACE_DECL |