3 //=============================================================================
5 * @file Active_Map_Manager.h
7 * @author Irfan Pyarali
9 //=============================================================================
12 #ifndef ACE_ACTIVE_MAP_MANAGER_H
13 #define ACE_ACTIVE_MAP_MANAGER_H
14 #include /**/ "ace/pre.h"
16 #include /**/ "ace/ACE_export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "ace/Basic_Types.h"
24 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
27 * @class ACE_Active_Map_Manager_Key
29 * @brief Key used in the Active Object Map.
31 * This key keeps information of the index and the generation
32 * count of the slot it represents. Since the index information
33 * is part of the key, lookups are super fast and predictable,
35 class ACE_Export ACE_Active_Map_Manager_Key
38 /// Default constructor.
39 ACE_Active_Map_Manager_Key ();
42 * Constructor given the @a slot_index and @a slot_generation number.
43 * This is useful once the user has somehow recovered the
44 * @a slot_index and @a slot_generation number from the client.
46 ACE_Active_Map_Manager_Key (ACE_UINT32 slot_index
,
47 ACE_UINT32 slot_generation
);
49 /// Get the slot_index.
50 ACE_UINT32
slot_index () const;
52 /// Set the slot_index.
53 void slot_index (ACE_UINT32 i
);
55 /// Get the slot_generation number.
56 ACE_UINT32
slot_generation () const;
58 /// Set the slot_generation number.
59 void slot_generation (ACE_UINT32 g
);
61 /// Size required to store information about active key.
62 static size_t size ();
64 /// Recover state of active key from @a data. User must make sure
65 /// that @a data encoded using the encode() method.
66 void decode (const void *data
);
68 /// Encode state of the active key into @a data. @a data must be as
69 /// big as the value returned from size().
70 void encode (void *data
) const;
73 bool operator== (const ACE_Active_Map_Manager_Key
&rhs
) const;
74 bool operator!= (const ACE_Active_Map_Manager_Key
&rhs
) const;
76 // = This really should be protected but because of template
77 // friends, they are not.
79 /// Increment the slot_generation number.
80 void increment_slot_generation_count ();
84 * @brief Data for the Active Object Map Key.
86 * This separate structure makes it easier to manage copying
87 * the index and the generation to and from the user buffer.
92 /// Slot index in the active map.
93 ACE_UINT32 slot_index_
;
95 /// Slot generation number of @c slot_index_ slot in the active map.
96 ACE_UINT32 slot_generation_
;
99 /// Data for the Active Object Map Key.
103 ACE_END_VERSIONED_NAMESPACE_DECL
105 #if defined (__ACE_INLINE__)
106 #include "ace/Active_Map_Manager.inl"
107 #endif /* __ACE_INLINE__ */
109 // Include the templates here.
110 #include "ace/Active_Map_Manager_T.h"
112 #include /**/ "ace/post.h"
113 #endif /* ACE_ACTIVE_MAP_MANAGER_H */