summaryrefslogtreecommitdiff
path: root/TAO/tao/ORB_Table.inl
blob: 8994755cbb4151c2740abaf95cac816f0f58cc14 (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
// -*- C++ -*-
#include "tao/ORB_Core.h"

#include <algorithm>

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

ACE_INLINE ::TAO_ORB_Core *
TAO::ORB_Table::first_orb (void)
{
  return this->first_orb_;
}

ACE_INLINE TAO::ORB_Table::iterator
TAO::ORB_Table::begin (void)
{
  return this->table_.begin ();
}

ACE_INLINE TAO::ORB_Table::iterator
TAO::ORB_Table::end (void)
{
  return this->table_.end ();
}

/// Accessor to the underlying table_
ACE_INLINE TAO::ORB_Table::Table *
TAO::ORB_Table::table (void)
{
  return &this->table_;
}

ACE_INLINE TAO_SYNCH_MUTEX &
TAO::ORB_Table::lock (void)
{
  return this->lock_;
}

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

ACE_INLINE
TAO::ORB_Core_Ref_Counter::ORB_Core_Ref_Counter (void)
  : core_ (0)
{
}

ACE_INLINE
TAO::ORB_Core_Ref_Counter::ORB_Core_Ref_Counter (::TAO_ORB_Core * core)
  : core_ (core)
{
//   ACE_ASSERT (core != 0);

  // Note that the TAO_ORB_Core pointer should always be valid in this
  // constructor.

  // Claim ownership.
  (void) this->core_->_incr_refcnt ();
}

ACE_INLINE
TAO::ORB_Core_Ref_Counter::~ORB_Core_Ref_Counter (void)
{
  if (this->core_)
    (void) this->core_->_decr_refcnt (); // Should never throw.
}

ACE_INLINE
TAO::ORB_Core_Ref_Counter::ORB_Core_Ref_Counter (
  TAO::ORB_Core_Ref_Counter const & rhs)
  : core_ (rhs.core_)
{
  // Claim ownership.
  if (this->core_)
    (void) this->core_->_incr_refcnt ();
}

ACE_INLINE void
TAO::ORB_Core_Ref_Counter::operator= (TAO::ORB_Core_Ref_Counter const & rhs)
{
  // Strongly exception safe.  May not be strictly necessary, but
  // let's do things the right way, regardless.
  TAO::ORB_Core_Ref_Counter tmp (rhs);
  std::swap (this->core_, tmp.core_);
}

TAO_END_VERSIONED_NAMESPACE_DECL