Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / PortableServer / Key_Adapters.h
blob5c6e9fbfd4520910ba840d8ad7ed69f19c120ea6
1 /* -*- C++ -*- */
3 //=============================================================================
4 /**
5 * @file Key_Adapters.h
7 * @author Irfan Pyarali
8 */
9 //=============================================================================
11 #ifndef TAO_KEY_ADAPTERS_H
12 #define TAO_KEY_ADAPTERS_H
14 #include /**/ "ace/pre.h"
16 #include "tao/PortableServer/portableserver_export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "tao/PortableServer/PS_ForwardC.h"
24 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
25 class ACE_Active_Map_Manager_Key;
26 ACE_END_VERSIONED_NAMESPACE_DECL
28 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
30 ///////////////////////////////////////////////////////////////////////////////
32 /**
33 * @class TAO_Incremental_Key_Generator
35 * @brief Defines a key generator.
37 * This class is used in adapters of maps that do not produce keys.
39 class TAO_Incremental_Key_Generator
41 public:
42 TAO_Incremental_Key_Generator ();
44 int operator() (PortableServer::ObjectId &id);
46 protected:
47 CORBA::ULong counter_;
50 ////////////////////////////////////////////////////////////////////////////////
52 /**
53 * @class TAO_ObjectId_Hash
55 * @brief Hashing class for Object Ids.
57 * Define the hash() method for Object Ids.
59 class TAO_PortableServer_Export TAO_ObjectId_Hash
61 public:
62 /// Returns hash value.
63 u_long operator () (const PortableServer::ObjectId &id) const;
66 ////////////////////////////////////////////////////////////////////////////////
68 /**
69 * @class TAO_Ignore_Original_Key_Adapter
71 * @brief A key adapter (encode/decode) class.
73 * Define the encoding and decoding methods for converting
74 * between Object Ids and active keys. This class ignores the
75 * <original_key> passed to it.
77 class TAO_Ignore_Original_Key_Adapter
79 public:
80 int encode (const PortableServer::ObjectId &original_key,
81 const ACE_Active_Map_Manager_Key &active_key,
82 PortableServer::ObjectId &modified_key);
84 int decode (const PortableServer::ObjectId &modified_key,
85 ACE_Active_Map_Manager_Key &active_key);
87 int decode (const PortableServer::ObjectId &modified_key,
88 PortableServer::ObjectId &original_key);
91 ////////////////////////////////////////////////////////////////////////////////
93 /**
94 * @class TAO_Preserve_Original_Key_Adapter
96 * @brief A key adapter (encode/decode) class.
98 * Define the encoding and decoding methods for converting
99 * between Object Ids and active keys. This class remembers the
100 * <original_key> passed to it.
102 class TAO_Preserve_Original_Key_Adapter
104 public:
105 int encode (const PortableServer::ObjectId &original_key,
106 const ACE_Active_Map_Manager_Key &active_key,
107 PortableServer::ObjectId &modified_key);
109 int decode (const PortableServer::ObjectId &modified_key,
110 ACE_Active_Map_Manager_Key &active_key);
112 int decode (const PortableServer::ObjectId &modified_key,
113 PortableServer::ObjectId &original_key);
116 ///////////////////////////////////////////////////////////////////////////////
118 TAO_END_VERSIONED_NAMESPACE_DECL
120 #include /**/ "ace/post.h"
122 #endif /* TAO_KEY_ADAPTERS_H */