summaryrefslogtreecommitdiff
path: root/TAO/tao_ace/Reactive_Handler.inl
blob: df65a2494c40c4a2a887238a79bf2dfc9f997114 (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
/* -*- C++ -*- */
//$Id$
ACE_INLINE long
TAO_ACE_Reactive_Handler::incr_ref_count (void)
{
  ACE_TRACE ("TAO_ACE_Reactive_Handler::incr_ref_count");

  return ++this->ref_count_;
}


ACE_INLINE long
TAO_ACE_Reactive_Handler::decr_ref_count (void)
{
  ACE_TRACE ("TAO_ACE_Reactive_Handler::decr_ref_count");
  --this->ref_count_;

  // Delete the object if the reference count goes yo 0.
  if (this->ref_count_ == 0)
    {
      delete this;
      return  0;
    }

  return this->ref_count_.value ();
}

ACE_INLINE long
TAO_ACE_Reactive_Handler::refcount (void) const
{
  ACE_TRACE ("TAO_ACE_Reactive_Handler::refcount");
  return this->ref_count_.value ();
}

ACE_INLINE long
TAO_ACE_Reactive_Handler::priority (void) const
{
  ACE_TRACE ("TAO_ACE_Reactive_Handler::priority");
  return this->priority_;
}

ACE_INLINE void
TAO_ACE_Reactive_Handler::priority (long priority)
{
  ACE_TRACE ("TAO_ACE_Reactive_Handler::priority");

  if (priority < TAO_ACE_Reactive_Handler::MAX_PRIORITY &&
      priority > TAO_ACE_Reactive_Handler::MIN_PRIORITY)
    this->priority_ = priority;
}