summaryrefslogtreecommitdiff
path: root/TAO/tao/Intrusive_Ref_Count_Base_T.inl
blob: 336e713d1d77348a820d878f3655582aefb3db78 (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
// -*- C++ -*-
TAO_BEGIN_VERSIONED_NAMESPACE_DECL

template <typename T>
ACE_INLINE
TAO_Intrusive_Ref_Count_Base<T>::TAO_Intrusive_Ref_Count_Base (void)
  : refcount_(1)
{}


template <typename T>
ACE_INLINE
void
TAO_Intrusive_Ref_Count_Base<T>::_add_ref (void)
{
  ++this->refcount_;
}


template <typename T>
ACE_INLINE
void
TAO_Intrusive_Ref_Count_Base<T>::_remove_ref (void)
{
  CORBA::ULong const new_count = --this->refcount_;

  if (new_count != 0)
    {
      return;
    }

  delete this;
}

TAO_END_VERSIONED_NAMESPACE_DECL