summaryrefslogtreecommitdiff
path: root/TAO/tao/PICurrent.inl
blob: f4deba73c6e61c21086a94cf80a25f4687700598 (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
// -*- C++ -*-
//
// $Id$


ACE_INLINE PortableInterceptor::SlotId
TAO::PICurrent::slot_count (void) const
{
  return this->slot_count_;
}

ACE_INLINE void
TAO::PICurrent::initialize (PortableInterceptor::SlotId sc)
{
  this->slot_count_ = sc;
}

ACE_INLINE void
TAO::PICurrent::check_validity (const PortableInterceptor::SlotId &id
                                ACE_ENV_ARG_DECL)
{
  // No need to acquire a lock for this check.  At this point, these
  // attributes are read only.
  if (id >= this->slot_count_)
    ACE_THROW (PortableInterceptor::InvalidSlot ());
}

// ------------------------------------------------------------------

ACE_INLINE void
TAO::PICurrent_Impl::copy_callback (TAO::PICurrent_Copy_Callback * cb)
{
  this->copy_callback_ = cb;
}

ACE_INLINE void
TAO::PICurrent_Impl::destruction_callback (TAO::PICurrent_Impl * p)
{
  this->destruction_callback_ = p;
}

ACE_INLINE TAO::PICurrent_Impl::Table &
TAO::PICurrent_Impl::slot_table (void)
{
  return this->slot_table_;
}

ACE_INLINE TAO::PICurrent_Impl::Table &
TAO::PICurrent_Impl::current_slot_table (void)
{
  return
    this->lc_slot_table_ == 0 ? this->slot_table_ : *this->lc_slot_table_;
}

ACE_INLINE void
TAO::PICurrent_Impl::lc_slot_table (TAO::PICurrent_Impl * p)
{
  if (p != 0)
    {
      Table * t = &p->current_slot_table ();

      if (t != this->lc_slot_table_)
        {
          this->lc_slot_table_ = t;

          if (this != p)
            p->destruction_callback (this);
        }
      else
        this->lc_slot_table_ = 0;
    }
  else
    this->lc_slot_table_ = 0;
}

ACE_INLINE TAO::PICurrent_Impl::Table *
TAO::PICurrent_Impl::lc_slot_table (void) const
{
  return this->lc_slot_table_;
}