summaryrefslogtreecommitdiff
path: root/ACE/ace/Active_Map_Manager.inl
blob: 6abb8c6207927de82b34495bc47940fd68a749b3 (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
90
91
92
// -*- C++ -*-
#include "ace/OS_NS_string.h"

ACE_BEGIN_VERSIONED_NAMESPACE_DECL

ACE_INLINE
ACE_Active_Map_Manager_Key::ACE_Active_Map_Manager_Key ()
{
  // If you change ~0, please change ACE_Map_Manager::free_list_id()
  // accordingly.
  this->key_data_.slot_index_ = (ACE_UINT32) ~0;
  this->key_data_.slot_generation_ = 0;
}

ACE_INLINE
ACE_Active_Map_Manager_Key::ACE_Active_Map_Manager_Key (ACE_UINT32 slot_index,
                                                        ACE_UINT32 slot_generation)
{
  this->key_data_.slot_index_ = slot_index;
  this->key_data_.slot_generation_ = slot_generation;
}

ACE_INLINE ACE_UINT32
ACE_Active_Map_Manager_Key::slot_index () const
{
  return this->key_data_.slot_index_;
}

ACE_INLINE ACE_UINT32
ACE_Active_Map_Manager_Key::slot_generation () const
{
  return this->key_data_.slot_generation_;
}

ACE_INLINE bool
ACE_Active_Map_Manager_Key::operator== (const ACE_Active_Map_Manager_Key &rhs) const
{
  return
    this->key_data_.slot_index_ == rhs.key_data_.slot_index_ &&
    this->key_data_.slot_generation_ == rhs.key_data_.slot_generation_;
}

ACE_INLINE bool
ACE_Active_Map_Manager_Key::operator!= (const ACE_Active_Map_Manager_Key &rhs) const
{
  return !this->operator== (rhs);
}

ACE_INLINE void
ACE_Active_Map_Manager_Key::slot_index (ACE_UINT32 i)
{
  this->key_data_.slot_index_ = i;
}

ACE_INLINE void
ACE_Active_Map_Manager_Key::slot_generation (ACE_UINT32 g)
{
  this->key_data_.slot_generation_ = g;
}

ACE_INLINE void
ACE_Active_Map_Manager_Key::increment_slot_generation_count ()
{
  ++this->key_data_.slot_generation_;
}

/* static */
ACE_INLINE size_t
ACE_Active_Map_Manager_Key::size ()
{
  return sizeof (ACE_UINT32) + sizeof (ACE_UINT32);
}

ACE_INLINE void
ACE_Active_Map_Manager_Key::decode (const void *data)
{
  // Copy the information from the user buffer into the key.
  ACE_OS::memcpy (&this->key_data_,
                  data,
                  sizeof this->key_data_);
}

ACE_INLINE void
ACE_Active_Map_Manager_Key::encode (void *data) const
{
  // Copy the key data to the user buffer.
  ACE_OS::memcpy (data,
                  &this->key_data_,
                  sizeof this->key_data_);
}

ACE_END_VERSIONED_NAMESPACE_DECL