// -*- C++ -*- TAO_BEGIN_VERSIONED_NAMESPACE_DECL template ACE_INLINE TAO_Var_Base_T::TAO_Var_Base_T () : ptr_ (nullptr) {} template ACE_INLINE TAO_Var_Base_T::TAO_Var_Base_T (T * p) : ptr_ (p) {} template ACE_INLINE TAO_Var_Base_T::~TAO_Var_Base_T () { delete this->ptr_; } template ACE_INLINE const T * TAO_Var_Base_T::operator-> () const { return this->ptr_; } template ACE_INLINE T * TAO_Var_Base_T::operator-> () { return this->ptr_; } template ACE_INLINE const T & TAO_Var_Base_T::in () const { return *this->ptr_; } template ACE_INLINE T & TAO_Var_Base_T::inout () { return *this->ptr_; } template ACE_INLINE T * TAO_Var_Base_T::ptr () const { return this->ptr_; } template ACE_INLINE TAO_Var_Base_T::operator T *& () { return this->ptr_; } // ************************************************************* template ACE_INLINE TAO_Fixed_Var_T::TAO_Fixed_Var_T () {} template ACE_INLINE TAO_Fixed_Var_T::TAO_Fixed_Var_T (T * p) : TAO_Var_Base_T (p) {} template ACE_INLINE TAO_Fixed_Var_T::TAO_Fixed_Var_T (const TAO_Fixed_Var_T & p) : TAO_Var_Base_T (p) {} // Fixed-size types only. template ACE_INLINE TAO_Fixed_Var_T::TAO_Fixed_Var_T (const T & p) { ACE_NEW (this->ptr_, T (p)); } template ACE_INLINE TAO_Fixed_Var_T & TAO_Fixed_Var_T::operator= (T * p) { delete this->ptr_; this->ptr_ = p; return *this; } template ACE_INLINE TAO_Fixed_Var_T::operator const T & () const { return *this->ptr_; } template ACE_INLINE TAO_Fixed_Var_T::operator T & () { // Use plain new, using the ACE_NEW macros will mean we dereference a // nil pointer and crash which is more bad then plain new which could // lead to a bad_alloc exception if (!this->ptr_) { this->ptr_ = new T; } return *this->ptr_; } template ACE_INLINE TAO_Fixed_Var_T::operator T & () const { return *this->ptr_; } // Mapping for fixed size. template ACE_INLINE T & TAO_Fixed_Var_T::out () { // Use plain new, using the ACE_NEW macros will mean we dereference a // nil pointer and crash which is more bad then plain new which could // lead to a bad_alloc exception if (!this->ptr_) { this->ptr_ = new T; } return *this->ptr_; } template ACE_INLINE T TAO_Fixed_Var_T::_retn () { return *this->ptr_; } // ************************************************************* template ACE_INLINE TAO_Var_Var_T::TAO_Var_Var_T () {} template ACE_INLINE TAO_Var_Var_T::TAO_Var_Var_T (T * p) : TAO_Var_Base_T (p) {} template ACE_INLINE TAO_Var_Var_T::TAO_Var_Var_T (const TAO_Var_Var_T & p) : TAO_Var_Base_T (p) {} template ACE_INLINE TAO_Var_Var_T & TAO_Var_Var_T::operator= (T * p) { delete this->ptr_; this->ptr_ = p; return *this; } template ACE_INLINE TAO_Var_Var_T::operator const T & () const { return *this->ptr_; } template ACE_INLINE TAO_Var_Var_T::operator T & () { return *this->ptr_; } template ACE_INLINE TAO_Var_Var_T::operator T & () const { return *this->ptr_; } // Mapping for variable size. template ACE_INLINE T *& TAO_Var_Var_T::out () { delete this->ptr_; this->ptr_ = nullptr; return this->ptr_; } template ACE_INLINE T * TAO_Var_Var_T::_retn () { T * tmp = this->ptr_; this->ptr_ = nullptr; return tmp; } // ************************************************************* template ACE_INLINE TAO_Out_T::TAO_Out_T (T *& p) : ptr_ (p) { this->ptr_ = nullptr; } template ACE_INLINE TAO_Out_T::TAO_Out_T (T_var & p) : ptr_ (p.out ()) { delete this->ptr_; this->ptr_ = nullptr; } template ACE_INLINE TAO_Out_T::TAO_Out_T (const TAO_Out_T & p) : ptr_ (p.ptr_) {} template ACE_INLINE TAO_Out_T & TAO_Out_T::operator= (const TAO_Out_T & p) { this->ptr_ = p.ptr_; return *this; } template ACE_INLINE TAO_Out_T & TAO_Out_T::operator= (T * p) { this->ptr_ = p; return *this; } template ACE_INLINE TAO_Out_T::operator T *& () { return this->ptr_; } template ACE_INLINE T *& TAO_Out_T::ptr () { return this->ptr_; } template ACE_INLINE T * TAO_Out_T::operator-> () { return this->ptr_; } TAO_END_VERSIONED_NAMESPACE_DECL