#include <Key_Adapters.h>
Public Member Functions | |
int | encode (const PortableServer::ObjectId &original_key, const ACE_Active_Map_Manager_Key &active_key, PortableServer::ObjectId &modified_key) |
int | decode (const PortableServer::ObjectId &modified_key, ACE_Active_Map_Manager_Key &active_key) |
int | decode (const PortableServer::ObjectId &modified_key, PortableServer::ObjectId &original_key) |
Define the encoding and decoding methods for converting between Object Ids and active keys. This class remembers the passed to it.
Definition at line 108 of file Key_Adapters.h.
|
Definition at line 132 of file Key_Adapters.cpp. References ACE_Active_Map_Manager_Key::size().
00134 { 00135 // Size of active key. 00136 size_t active_key_size = ACE_Active_Map_Manager_Key::size (); 00137 00138 // Smartly copy all the data; <original_key does not own the data>. 00139 original_key.replace (static_cast <CORBA::ULong> 00140 (modified_key.maximum () - active_key_size), 00141 static_cast <CORBA::ULong> 00142 (modified_key.length () - active_key_size), 00143 const_cast <CORBA::Octet *> 00144 (modified_key.get_buffer ()) + active_key_size, 00145 0); 00146 00147 // Success. 00148 return 0; 00149 } |
|
Definition at line 121 of file Key_Adapters.cpp. References ACE_Active_Map_Manager_Key::decode().
00123 { 00124 // Read off value of index and generation. 00125 active_key.decode (modified_key.get_buffer ()); 00126 00127 // Success. 00128 return 0; 00129 } |
|
Definition at line 97 of file Key_Adapters.cpp. References ACE_Active_Map_Manager_Key::encode(), ACE_OS::memcpy(), and ACE_Active_Map_Manager_Key::size().
00100 { 00101 // Size of active key. 00102 size_t active_key_size = active_key.size (); 00103 00104 // Resize to accommodate both the original data and the new active key. 00105 modified_key.length (static_cast <CORBA::ULong> (active_key_size) 00106 + original_key.length ()); 00107 00108 // Copy active key data into user key. 00109 active_key.encode (modified_key.get_buffer ()); 00110 00111 // Copy the original key after the active key. 00112 ACE_OS::memcpy (modified_key.get_buffer () + active_key_size, 00113 original_key.get_buffer (), 00114 original_key.length ()); 00115 00116 // Success. 00117 return 0; 00118 } |