ACE_Active_Map_Manager_Key Class Reference

Key used in the Active Object Map. More...

#include <Active_Map_Manager.h>

Collaboration diagram for ACE_Active_Map_Manager_Key:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ACE_Active_Map_Manager_Key (void)
 Default constructor.

 ACE_Active_Map_Manager_Key (ACE_UINT32 slot_index, ACE_UINT32 slot_generation)
ACE_UINT32 slot_index (void) const
 Get the .

void slot_index (ACE_UINT32 i)
 Set the .

ACE_UINT32 slot_generation (void) const
 Get the number.

void slot_generation (ACE_UINT32 g)
 Set the number.

void decode (const void *data)
void encode (void *data) const
bool operator== (const ACE_Active_Map_Manager_Key &rhs) const
 Compare keys.

bool operator!= (const ACE_Active_Map_Manager_Key &rhs) const
void increment_slot_generation_count (void)
 Increment the number.


Static Public Member Functions

size_t size (void)
 Size required to store information about active key.


Private Attributes

key_data key_data_
 Data for the Active Object Map Key.


Detailed Description

Key used in the Active Object Map.

This key keeps information of the index and the generation count of the slot it represents. Since the index information is part of the key, lookups are super fast and predictable,

Definition at line 37 of file Active_Map_Manager.h.


Constructor & Destructor Documentation

ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE ACE_Active_Map_Manager_Key::ACE_Active_Map_Manager_Key void   ) 
 

Default constructor.

Definition at line 10 of file Active_Map_Manager.inl.

References key_data_, ACE_Active_Map_Manager_Key::key_data::slot_generation_, and ACE_Active_Map_Manager_Key::key_data::slot_index_.

00011 {
00012   // If you change ~0, please change ACE_Map_Manager::free_list_id()
00013   // accordingly.
00014   this->key_data_.slot_index_ = (ACE_UINT32) ~0;
00015   this->key_data_.slot_generation_ = 0;
00016 }

ACE_INLINE ACE_Active_Map_Manager_Key::ACE_Active_Map_Manager_Key ACE_UINT32  slot_index,
ACE_UINT32  slot_generation
 

Constructor given the slot_index and slot_generation number. This is useful once the user has somehow recovered the slot_index and slot_generation number from the client.

Definition at line 19 of file Active_Map_Manager.inl.

References key_data_, ACE_Active_Map_Manager_Key::key_data::slot_generation_, and ACE_Active_Map_Manager_Key::key_data::slot_index_.

00021 {
00022   this->key_data_.slot_index_ = slot_index;
00023   this->key_data_.slot_generation_ = slot_generation;
00024 }


Member Function Documentation

ACE_INLINE void ACE_Active_Map_Manager_Key::decode const void *  data  ) 
 

Recover state of active key from data. User must make sure that data encoded using the encode() method.

Definition at line 78 of file Active_Map_Manager.inl.

References ACE_OS::memcpy().

00079 {
00080   // Copy the information from the user buffer into the key.
00081   ACE_OS::memcpy (&this->key_data_,
00082                   data,
00083                   sizeof this->key_data_);
00084 }

ACE_INLINE void ACE_Active_Map_Manager_Key::encode void *  data  )  const
 

Encode state of the active key into data. data must be as big as the value returned from .

Definition at line 87 of file Active_Map_Manager.inl.

References ACE_OS::memcpy().

00088 {
00089   // Copy the key data to the user buffer.
00090   ACE_OS::memcpy (data,
00091                   &this->key_data_,
00092                   sizeof this->key_data_);
00093 }

ACE_INLINE void ACE_Active_Map_Manager_Key::increment_slot_generation_count void   ) 
 

Increment the number.

Definition at line 65 of file Active_Map_Manager.inl.

References key_data_, and ACE_Active_Map_Manager_Key::key_data::slot_generation_.

Referenced by ACE_Active_Map_Manager< T >::bind().

00066 {
00067   ++this->key_data_.slot_generation_;
00068 }

ACE_INLINE bool ACE_Active_Map_Manager_Key::operator!= const ACE_Active_Map_Manager_Key rhs  )  const
 

Definition at line 47 of file Active_Map_Manager.inl.

References operator==().

00048 {
00049   return !this->operator== (rhs);
00050 }

ACE_INLINE bool ACE_Active_Map_Manager_Key::operator== const ACE_Active_Map_Manager_Key rhs  )  const
 

Compare keys.

Definition at line 39 of file Active_Map_Manager.inl.

References key_data_, ACE_Active_Map_Manager_Key::key_data::slot_generation_, and ACE_Active_Map_Manager_Key::key_data::slot_index_.

Referenced by operator!=().

00040 {
00041   return
00042     this->key_data_.slot_index_ == rhs.key_data_.slot_index_ &&
00043     this->key_data_.slot_generation_ == rhs.key_data_.slot_generation_;
00044 }

ACE_INLINE size_t ACE_Active_Map_Manager_Key::size void   )  [static]
 

Size required to store information about active key.

Definition at line 72 of file Active_Map_Manager.inl.

00073 {
00074   return sizeof (ACE_UINT32) + sizeof (ACE_UINT32);
00075 }

ACE_INLINE void ACE_Active_Map_Manager_Key::slot_generation ACE_UINT32  g  ) 
 

Set the number.

Definition at line 59 of file Active_Map_Manager.inl.

References key_data_, and ACE_Active_Map_Manager_Key::key_data::slot_generation_.

00060 {
00061   this->key_data_.slot_generation_ = g;
00062 }

ACE_INLINE ACE_UINT32 ACE_Active_Map_Manager_Key::slot_generation void   )  const
 

Get the number.

Definition at line 33 of file Active_Map_Manager.inl.

References key_data_, and ACE_Active_Map_Manager_Key::key_data::slot_generation_.

Referenced by ACE_Active_Map_Manager< T >::find().

00034 {
00035   return this->key_data_.slot_generation_;
00036 }

ACE_INLINE void ACE_Active_Map_Manager_Key::slot_index ACE_UINT32  i  ) 
 

Set the .

Definition at line 53 of file Active_Map_Manager.inl.

References key_data_, and ACE_Active_Map_Manager_Key::key_data::slot_index_.

00054 {
00055   this->key_data_.slot_index_ = i;
00056 }

ACE_INLINE ACE_UINT32 ACE_Active_Map_Manager_Key::slot_index void   )  const
 

Get the .

Definition at line 27 of file Active_Map_Manager.inl.

References key_data_, and ACE_Active_Map_Manager_Key::key_data::slot_index_.

Referenced by ACE_Active_Map_Manager< T >::bind(), ACE_Active_Map_Manager< T >::find(), ACE_Active_Map_Manager< T >::rebind(), and ACE_Active_Map_Manager< T >::unbind().

00028 {
00029   return this->key_data_.slot_index_;
00030 }


Member Data Documentation

key_data ACE_Active_Map_Manager_Key::key_data_ [private]
 

Data for the Active Object Map Key.

Definition at line 103 of file Active_Map_Manager.h.

Referenced by ACE_Active_Map_Manager_Key(), increment_slot_generation_count(), operator==(), slot_generation(), and slot_index().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:19:06 2006 for ACE by doxygen 1.3.6