summaryrefslogtreecommitdiff
path: root/TAO/tao/Array_VarOut_T.cpp
blob: b9058fedc07d37a309b8a8a86d047786e624a8d5 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// $Id$

#ifndef TAO_ARRAY_VAROUT_T_C
#define TAO_ARRAY_VAROUT_T_C

#include "tao/Array_VarOut_T.h"

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

ACE_RCSID (tao, 
           Array_VarOut_T, 
           "$Id$")

template<typename T_slice, typename T_life>
TAO_FixedArray_Var_T<T_slice,T_life> &
TAO_FixedArray_Var_T<T_slice,T_life>::operator= (T_slice * p)
{
  // Is what we own the same that is being assigned to us?
  if (this->ptr_ != p)
    {
      // Delete our stuff and assume ownership of p.
      T_life::tao_free (this->ptr_);
      this->ptr_ = p;
    }
  
  return *this;
}

template<typename T_slice, typename T_life>
TAO_FixedArray_Var_T<T_slice,T_life> &
TAO_FixedArray_Var_T<T_slice,T_life>::operator= (
    const TAO_FixedArray_Var_T<T_slice,T_life> & p
  )
{
  if (this != &p)
    {
      T_life::tao_free (this->ptr_);
      
      // Deep copy.
      this->ptr_ = T_life::tao_dup (p.in ());
    }
  
  return *this;
}

// *************************************************************

template<typename T_slice, typename T_life>
TAO_VarArray_Var_T<T_slice,T_life> &
TAO_VarArray_Var_T<T_slice,T_life>::operator= (T_slice * p)
{
  // Is what we own the same that is being assigned to us?
  if (this->ptr_ != p)
    {
      // Delete our stuff and assume ownership of p.
      T_life::tao_free (this->ptr_);
      this->ptr_ = p;
    }
  
  return *this;
}

template<typename T_slice, typename T_life>
TAO_VarArray_Var_T<T_slice,T_life> &
TAO_VarArray_Var_T<T_slice,T_life>::operator= (
    const TAO_VarArray_Var_T<T_slice,T_life> & p
  )
{
  if (this != &p)
    {
      T_life::tao_free (this->ptr_);
      
      // Deep copy.
      this->ptr_ = T_life::tao_dup (p.in ());
    }
  
  return *this;
}

// *************************************************************

template<typename T_slice, typename T_life>
void
TAO_Array_Forany_T<T_slice,T_life>::_tao_any_destructor (
    void * _tao_void_pointer
  )
{
  T_slice * tmp = ACE_static_cast (T_slice *, _tao_void_pointer);
  T_life::tao_free (tmp);
}

#endif /* TAO_ARRAY_VAROUT_T_C */