blob: 90e98caaa7a9b7ae252cb1503b0ebd974320ec04 (
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
|
/* -*- C++ -*- */
// $Id$
// ============================================================================
//
// = LIBRARY
// ace
//
// = FILENAME
// Active_Map_Manager.h
//
// = AUTHOR
// Irfan Pyarali
//
// ============================================================================
#ifndef ACE_ACTIVE_MAP_MANAGER_H
#define ACE_ACTIVE_MAP_MANAGER_H
#include "ace/OS.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
class ACE_Export ACE_Active_Map_Manager_Key
{
// = TITLE
// Key used in the Active Object Map.
//
// = DESCRIPTION
// This key keeps information of the index and the generation
// count of the slot it represents. Since the index information
// is part of the key, lookups are super fast and predictable,
public:
ACE_Active_Map_Manager_Key (void);
// Default constructor.
ACE_Active_Map_Manager_Key (u_long index,
u_long generation);
// Constructor given the index and generation number. This is
// useful once the user has somehow recovered the index and
// generation number from the client.
u_long index (void) const;
void index (u_long i);
// Get/Set the index.
u_long generation (void) const;
void generation (u_long g);
// Get/Set the generation number.
static size_t size (void);
// Size required to store information about active key.
void decode (const void *data);
// Recover state of active key from <data>. User must make sure
// that <data> encoded using the <encode> method.
void encode (void *data) const;
// Encode state of the active key into <data>. <data> must be as
// big as the value returned from <size>.
int operator== (const ACE_Active_Map_Manager_Key &rhs) const;
int operator!= (const ACE_Active_Map_Manager_Key &rhs) const;
// Compare keys.
// = This really should be protected but because of template
// friends, they are not.
void increment_generation_count (void);
// Increment the generation number.
private:
u_long index_;
// Index in the active map.
u_long generation_;
// Generation number of <index_> slot in the active map.
};
#if defined (__ACE_INLINE__)
#include "ace/Active_Map_Manager.i"
#endif /* __ACE_INLINE__ */
// Include the templates here.
#include "ace/Active_Map_Manager_T.h"
#endif /* ACE_ACTIVE_MAP_MANAGER_H */
|