GitHub Actions: Try MSVC builds with /std:c++17 and 20
[ACE_TAO.git] / ACE / ace / Active_Map_Manager.h
blob3bf29130bf6a8e6214534d008114788a0599ae82
1 /* -*- C++ -*- */
3 //=============================================================================
4 /**
5 * @file Active_Map_Manager.h
7 * @author Irfan Pyarali
8 */
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)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "ace/Basic_Types.h"
24 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
26 /**
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
37 public:
38 /// Default constructor.
39 ACE_Active_Map_Manager_Key (void);
41 /**
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 (void) const;
52 /// Set the slot_index.
53 void slot_index (ACE_UINT32 i);
55 /// Get the slot_generation number.
56 ACE_UINT32 slot_generation (void) 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 (void);
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;
72 /// Compare keys.
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 (void);
82 private:
83 /**
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.
90 struct key_data
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.
100 key_data key_data_;
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 */