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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
// $Id$
ACE_INLINE
ACE_Active_Map_Manager_Key::ACE_Active_Map_Manager_Key (void)
: slot_index_ (~0),
slot_generation_ (0)
{
// If you change ~0, please change ACE_Map_Manager::free_list_id()
// accordingly.
}
ACE_INLINE
ACE_Active_Map_Manager_Key::ACE_Active_Map_Manager_Key (ACE_UINT32 slot_index,
ACE_UINT32 slot_generation)
: slot_index_ (slot_index),
slot_generation_ (slot_generation)
{
}
ACE_INLINE ACE_UINT32
ACE_Active_Map_Manager_Key::slot_index (void) const
{
return this->slot_index_;
}
ACE_INLINE ACE_UINT32
ACE_Active_Map_Manager_Key::slot_generation (void) const
{
return this->slot_generation_;
}
ACE_INLINE int
ACE_Active_Map_Manager_Key::operator== (const ACE_Active_Map_Manager_Key &rhs) const
{
return
this->slot_index_ == rhs.slot_index_ &&
this->slot_generation_ == rhs.slot_generation_;
}
ACE_INLINE int
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->slot_index_ = i;
}
ACE_INLINE void
ACE_Active_Map_Manager_Key::slot_generation (ACE_UINT32 g)
{
this->slot_generation_ = g;
}
ACE_INLINE void
ACE_Active_Map_Manager_Key::increment_slot_generation_count (void)
{
++this->slot_generation_;
}
/* static */
ACE_INLINE size_t
ACE_Active_Map_Manager_Key::size (void)
{
return sizeof (ACE_UINT32) + sizeof (ACE_UINT32);
}
ACE_INLINE void
ACE_Active_Map_Manager_Key::decode (const void *d)
{
// Cast so that we can do pointer arithmetic.
const char *data = (const char *) d;
// Grab the slot_index first.
ACE_OS::memcpy (&this->slot_index_,
data,
sizeof this->slot_index_);
// Move along...
data += sizeof this->slot_index_;
// Grab the slot_generation second.
ACE_OS::memcpy (&this->slot_generation_,
data,
sizeof this->slot_generation_);
}
ACE_INLINE void
ACE_Active_Map_Manager_Key::encode (void *d) const
{
// Cast so that we can do pointer arithmetic.
char *data = (char *) d;
// Grab the slot_index first.
ACE_OS::memcpy (data,
&this->slot_index_,
sizeof this->slot_index_);
// Move along...
data += sizeof this->slot_index_;
// Grab the slot_generation second.
ACE_OS::memcpy (data,
&this->slot_generation_,
sizeof this->slot_generation_);
}
|