summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/performance-tests/RTEvent/lib/Servant_var.inl
blob: bc65b994d0db4f48c62d818be1a7ae6e66f52131 (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
/**
 * @file Servant_var.inl
 *
 * $Id$
 *
 * @author Jody Hagins <jody@atdesk.com>
 * @author Carlos O'Ryan <coryan@uci.edu>
 */

template<class SERVANT> ACE_INLINE SERVANT *
Servant_var<SERVANT>::duplicate (SERVANT *servant)
{
  if (servant != 0)
    servant->_add_ref ();
  return servant;
}

template<class SERVANT> ACE_INLINE
Servant_var<SERVANT>::Servant_var (SERVANT *s)
  : ptr_ (s)
{
}

template<class SERVANT> ACE_INLINE
Servant_var<SERVANT>::Servant_var (const Servant_var<SERVANT> &rhs)
  : ptr_ (Servant_var<SERVANT>::duplicate (rhs.ptr_))
{
}

template<class SERVANT> ACE_INLINE Servant_var<SERVANT>&
Servant_var<SERVANT>::operator= (const Servant_var<SERVANT> &rhs)
{
  Servant_var<SERVANT> tmp (rhs);
  ACE_Swap<SERVANT*>::swap (this->ptr_, tmp.ptr_);
  return *this;
}

template<class SERVANT> ACE_INLINE Servant_var<SERVANT>&
Servant_var<SERVANT>::operator= (SERVANT *rhs)
{
  Servant_var<SERVANT> tmp (rhs);
  ACE_Swap<SERVANT*>::swap (this->ptr_, tmp.ptr_);
  return *this;
}

template<class SERVANT> ACE_INLINE SERVANT*
Servant_var<SERVANT>::operator-> ()
{
  return this->ptr_;
}

template<class SERVANT> ACE_INLINE const SERVANT*
Servant_var<SERVANT>::operator-> () const
{
  return this->ptr_;
}

template<class SERVANT> ACE_INLINE
Servant_var<SERVANT>::operator SERVANT *()
{
  return this->ptr_;
}

template<class SERVANT> ACE_INLINE
Servant_var<SERVANT>::operator const SERVANT * () const
{
  return this->ptr_;
}

template<class SERVANT> ACE_INLINE SERVANT *
Servant_var<SERVANT>::in () const
{
  return this->ptr_;
}

template<class SERVANT> ACE_INLINE SERVANT *&
Servant_var<SERVANT>::out ()
{
  Servant_var<SERVANT> tmp;
  ACE_Swap<SERVANT*>::swap (tmp.ptr_, this->ptr_);

  return this->ptr_;
}

template<class SERVANT> ACE_INLINE SERVANT *&
Servant_var<SERVANT>::inout ()
{
  return this->ptr_;
}