/* -*- C++ -*- */ // $Id$ // ============================================================================ // // = LIBRARY // TAO // // = FILENAME // varout.cpp // // = DESCRIPTION // Templates for _var and _out types // // = AUTHOR // // Aniruddha Gokhale // Carlos O'Ryan // ============================================================================ #if !defined (TAO_VAROUT_C) #define TAO_VAROUT_C #include "tao/varout.h" #include "tao/Sequence.h" #if !defined (__ACE_INLINE__) #include "tao/varout.i" #endif /* __ACE_INLINE__ */ ACE_RCSID(tao, varout, "$Id$") template TAO_Object_Field_T:: TAO_Object_Field_T (const TAO_Object_Field_T& rhs) : TAO_Object_Field (rhs), // keep HP/aCC happy ptr_ (T::_duplicate (rhs.ptr_)) { } template TAO_Object_Field_T::~TAO_Object_Field_T (void) { CORBA::release (this->ptr_); } template TAO_Object_Field_T & TAO_Object_Field_T::operator= (T* object) { CORBA::release (this->ptr_); this->ptr_ = object; return *this; } template TAO_Object_Field_T & TAO_Object_Field_T:: operator= (const TAO_Object_Field_T &rhs) { if (this != &rhs) { CORBA::release (this->ptr_); this->ptr_ = T::_duplicate (rhs.ptr_); } return *this; } template TAO_Object_Field_T:: TAO_Object_Field_T (const TAO_Object_Manager & rhs) : ptr_ (T::_duplicate (rhs.in ())) { } template TAO_Object_Field_T& TAO_Object_Field_T:: operator= (const TAO_Object_Manager & rhs) { T* tmp = T::_duplicate (rhs.in ()); CORBA::release (this->ptr_); this->ptr_ = tmp; return *this; } template TAO_Object_Field_T:: TAO_Object_Field_T (const T_var & rhs) : ptr_ (T::_duplicate (rhs.in ())) { } template TAO_Object_Field_T& TAO_Object_Field_T:: operator= (const T_var & rhs) { T* tmp = T::_duplicate (rhs.in ()); CORBA::release (this->ptr_); this->ptr_ = tmp; return *this; } template void TAO_Object_Field_T::_downcast (CORBA_Object* base_ptr, CORBA_Environment &ACE_TRY_ENV) { CORBA::release (this->ptr_); this->ptr_ = 0; this->ptr_ = T::_narrow (base_ptr, ACE_TRY_ENV); } template CORBA_Object* TAO_Object_Field_T::_upcast (void) { return this->ptr_; } template void TAO_Object_Field_T::_release (void) { CORBA::release (this->ptr_); this->ptr_ = 0; } template T* & TAO_Object_Field_T::out (void) { CORBA::release (this->ptr_); this->ptr_ = 0; return this->ptr_; } #endif /* TAO_VAROUT_C */