summaryrefslogtreecommitdiff
path: root/TAO/tao/Objref_VarOut_T.cpp
blob: 4794c81b6349477c82622eeec27552552e3fb015 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// $Id$
#ifndef TAO_OBJREF_VAROUT_T_CPP
#define TAO_OBJREF_VAROUT_T_CPP

#include "tao/Objref_VarOut_T.h"
#include "tao/Environment.h"

#if !defined (__ACE_INLINE__)
#include "tao/Objref_VarOut_T.inl"
#endif /* __ACE_INLINE__ */

template <typename T>
TAO_Objref_Var_T<T>::TAO_Objref_Var_T (
    const TAO_Objref_Var_T<T> & p
  )
  : TAO_Base_var (),
    ptr_ (TAO::Objref_Traits<T>::duplicate (p.ptr ()))
{
}

template <typename T>
TAO_Objref_Var_T<T> &
TAO_Objref_Var_T<T>::operator= (T * p)
{
  TAO::Objref_Traits<T>::release (this->ptr_);
  this->ptr_ = p;
  return *this;
}

template <typename T>
TAO_Objref_Var_T<T> &
TAO_Objref_Var_T<T>::operator= (
    const TAO_Objref_Var_T<T> & p
  )
{
  if (this != &p)
    {
      TAO::Objref_Traits<T>::release (this->ptr_);
      this->ptr_ = TAO::Objref_Traits<T>::duplicate (p.ptr ());
    }

  return *this;
}

#endif /* TAO_OBJREF_VAROUT_T_CPP */