TAO_Ignore_Original_Key_Adapter Class Reference

A key adapter (encode/decode) class. More...

#include <Key_Adapters.h>

List of all members.

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)


Detailed Description

A key adapter (encode/decode) class.

Define the encoding and decoding methods for converting between Object Ids and active keys. This class ignores the <original_key> passed to it.

Definition at line 82 of file Key_Adapters.h.


Member Function Documentation

int TAO_Ignore_Original_Key_Adapter::decode ( const PortableServer::ObjectId modified_key,
PortableServer::ObjectId original_key 
)

Definition at line 80 of file Key_Adapters.cpp.

00082 {
00083   // Smartly copy all the data; <original_key does not own the data>.
00084   original_key.replace (modified_key.maximum (),
00085                         modified_key.length (),
00086                         const_cast <CORBA::Octet *>
00087                                    (modified_key.get_buffer ()),
00088                         0);
00089 
00090   // Success.
00091   return 0;
00092 }

int TAO_Ignore_Original_Key_Adapter::decode ( const PortableServer::ObjectId modified_key,
ACE_Active_Map_Manager_Key active_key 
)

Definition at line 69 of file Key_Adapters.cpp.

References ACE_Active_Map_Manager_Key::decode().

00071 {
00072   // Read off value of index and generation.
00073   active_key.decode (modified_key.get_buffer ());
00074 
00075   // Success.
00076   return 0;
00077 }

int TAO_Ignore_Original_Key_Adapter::encode ( const PortableServer::ObjectId original_key,
const ACE_Active_Map_Manager_Key active_key,
PortableServer::ObjectId modified_key 
)

Definition at line 49 of file Key_Adapters.cpp.

References ACE_Active_Map_Manager_Key::encode(), and ACE_Active_Map_Manager_Key::size().

00052 {
00053   ACE_UNUSED_ARG (original_key);
00054 
00055   // Size of active key.
00056   size_t active_key_size = active_key.size ();
00057 
00058   // Resize to accommodate both the original data and the new active key.
00059   modified_key.length (static_cast <CORBA::ULong> (active_key_size));
00060 
00061   // Copy active key data into user key.
00062   active_key.encode (modified_key.get_buffer ());
00063 
00064   // Success.
00065   return 0;
00066 }


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:41:29 2010 for TAO_PortableServer by  doxygen 1.4.7