diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-03-20 05:47:24 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-03-20 05:47:24 +0000 |
commit | a1d0bafb9241251362ce04d67f57ce75a186fb4a (patch) | |
tree | d7f18d74903d65f4bf389b7b1c41397f2f704dbc /ace | |
parent | e64aebac31a11704408e4992daef3027b9ea7799 (diff) | |
download | ATCD-a1d0bafb9241251362ce04d67f57ce75a186fb4a.tar.gz |
*** empty log message ***
Diffstat (limited to 'ace')
-rw-r--r-- | ace/Active_Map_Manager.h | 44 | ||||
-rw-r--r-- | ace/Active_Map_Manager.i | 94 | ||||
-rw-r--r-- | ace/Active_Map_Manager_T.i | 46 |
3 files changed, 92 insertions, 92 deletions
diff --git a/ace/Active_Map_Manager.h b/ace/Active_Map_Manager.h index 90e98caaa7a..87223724f6c 100644 --- a/ace/Active_Map_Manager.h +++ b/ace/Active_Map_Manager.h @@ -23,7 +23,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -class ACE_Export ACE_Active_Map_Manager_Key +class ACE_Export ACE_Active_Map_Manager_Key { // = TITLE // Key used in the Active Object Map. @@ -36,24 +36,24 @@ public: ACE_Active_Map_Manager_Key (void); // Default constructor. - ACE_Active_Map_Manager_Key (u_long index, - u_long generation); - // Constructor given the index and generation number. This is - // useful once the user has somehow recovered the index and - // generation number from the client. - - u_long index (void) const; - void index (u_long i); - // Get/Set the index. - - u_long generation (void) const; - void generation (u_long g); - // Get/Set the generation number. - + 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. + + ACE_UINT32 slot_index (void) const; + void slot_index (ACE_UINT32 i); + // Get/Set the <slot_index>. + + ACE_UINT32 slot_generation (void) const; + void slot_generation (ACE_UINT32 g); + // Get/Set the <slot_generation> number. + static size_t size (void); // Size required to store information about active key. - void decode (const void *data); + void decode (const void *data); // Recover state of active key from <data>. User must make sure // that <data> encoded using the <encode> method. @@ -68,15 +68,15 @@ public: // = This really should be protected but because of template // friends, they are not. - void increment_generation_count (void); - // Increment the generation number. + void increment_slot_generation_count (void); + // Increment the <slot_generation> number. private: - u_long index_; - // Index in the active map. + ACE_UINT32 slot_index_; + // Slot index in the active map. - u_long generation_; - // Generation number of <index_> slot in the active map. + ACE_UINT32 slot_generation_; + // Slot generation number of <slot_index_> slot in the active map. }; #if defined (__ACE_INLINE__) diff --git a/ace/Active_Map_Manager.i b/ace/Active_Map_Manager.i index 8980a49002f..e05bc9d3251 100644 --- a/ace/Active_Map_Manager.i +++ b/ace/Active_Map_Manager.i @@ -1,109 +1,109 @@ // $Id$ -ACE_INLINE +ACE_INLINE ACE_Active_Map_Manager_Key::ACE_Active_Map_Manager_Key (void) - : index_ (~0), - generation_ (0) + : slot_index_ (~0), + slot_generation_ (0) { // If you change ~0, please change ACE_Map_Manager::free_list_id() // accordingly. } -ACE_INLINE -ACE_Active_Map_Manager_Key::ACE_Active_Map_Manager_Key (u_long index, - u_long generation) - : index_ (index), - generation_ (generation) +ACE_INLINE +ACE_Active_Map_Manager_Key::ACE_Active_Map_Manager_Key (ACE_UINT32 slot_index, + ACE_UINT32 slot_generation) + : slot_index_ (slot_index), + slot_generation_ (slot_generation) { } -ACE_INLINE u_long -ACE_Active_Map_Manager_Key::index (void) const +ACE_INLINE ACE_UINT32 +ACE_Active_Map_Manager_Key::slot_index (void) const { - return this->index_; + return this->slot_index_; } - -ACE_INLINE u_long -ACE_Active_Map_Manager_Key::generation (void) const + +ACE_INLINE ACE_UINT32 +ACE_Active_Map_Manager_Key::slot_generation (void) const { - return this->generation_; + return this->slot_generation_; } -ACE_INLINE int +ACE_INLINE int ACE_Active_Map_Manager_Key::operator== (const ACE_Active_Map_Manager_Key &rhs) const { - return - this->index_ == rhs.index_ && - this->generation_ == rhs.generation_; + return + this->slot_index_ == rhs.slot_index_ && + this->slot_generation_ == rhs.slot_generation_; } -ACE_INLINE int +ACE_INLINE int ACE_Active_Map_Manager_Key::operator!= (const ACE_Active_Map_Manager_Key &rhs) const { return !this->operator== (rhs); } -ACE_INLINE void -ACE_Active_Map_Manager_Key::index (u_long i) +ACE_INLINE void +ACE_Active_Map_Manager_Key::slot_index (ACE_UINT32 i) { - this->index_ = i; + this->slot_index_ = i; } - -ACE_INLINE void -ACE_Active_Map_Manager_Key::generation (u_long g) + +ACE_INLINE void +ACE_Active_Map_Manager_Key::slot_generation (ACE_UINT32 g) { - this->generation_ = g; + this->slot_generation_ = g; } -ACE_INLINE void -ACE_Active_Map_Manager_Key::increment_generation_count (void) +ACE_INLINE void +ACE_Active_Map_Manager_Key::increment_slot_generation_count (void) { - ++this->generation_; + ++this->slot_generation_; } /* static */ ACE_INLINE size_t ACE_Active_Map_Manager_Key::size (void) { - return sizeof (u_long) + sizeof (u_long); + return sizeof (ACE_UINT32) + sizeof (ACE_UINT32); } -ACE_INLINE void +ACE_INLINE void ACE_Active_Map_Manager_Key::decode (const void *d) { // Cast so that we can do pointer arithmetic. const char *data = (const char *) d; - // Grab the index first. - ACE_OS::memcpy (&this->index_, + // Grab the slot_index first. + ACE_OS::memcpy (&this->slot_index_, data, - sizeof this->index_); + sizeof this->slot_index_); // Move along... - data += sizeof this->index_; + data += sizeof this->slot_index_; - // Grab the generation second. - ACE_OS::memcpy (&this->generation_, + // Grab the slot_generation second. + ACE_OS::memcpy (&this->slot_generation_, data, - sizeof this->generation_); + sizeof this->slot_generation_); } -ACE_INLINE void +ACE_INLINE void ACE_Active_Map_Manager_Key::encode (void *d) const { // Cast so that we can do pointer arithmetic. char *data = (char *) d; - // Grab the index first. + // Grab the slot_index first. ACE_OS::memcpy (data, - &this->index_, - sizeof this->index_); + &this->slot_index_, + sizeof this->slot_index_); // Move along... - data += sizeof this->index_; + data += sizeof this->slot_index_; - // Grab the generation second. + // Grab the slot_generation second. ACE_OS::memcpy (data, - &this->generation_, - sizeof this->generation_); + &this->slot_generation_, + sizeof this->slot_generation_); } diff --git a/ace/Active_Map_Manager_T.i b/ace/Active_Map_Manager_T.i index 0b238b09a13..54388cd354d 100644 --- a/ace/Active_Map_Manager_T.i +++ b/ace/Active_Map_Manager_T.i @@ -4,23 +4,23 @@ template <class T> ACE_INLINE int ACE_Active_Map_Manager<T>::bind (ACE_Active_Map_Manager_Key &key, T *&internal_value) { - size_t index; - int result = this->next_free (index); + size_t slot_index; + int result = this->next_free (slot_index); if (result == 0) { // Move from free list to occupied list - this->move_from_free_list_to_occupied_list (index); + this->move_from_free_list_to_occupied_list (slot_index); // Reset the key. - this->search_structure_[index].ext_id_.increment_generation_count (); - this->search_structure_[index].ext_id_.index (index); + this->search_structure_[slot_index].ext_id_.increment_slot_generation_count (); + this->search_structure_[slot_index].ext_id_.slot_index (slot_index); // Copy the key for the user. - key = this->search_structure_[index].ext_id_; + key = this->search_structure_[slot_index].ext_id_; // This is where the user should place the value. - internal_value = &this->search_structure_[index].int_id_; + internal_value = &this->search_structure_[slot_index].int_id_; // Update the current size. ++this->cur_size_; @@ -57,19 +57,19 @@ template <class T> ACE_INLINE int ACE_Active_Map_Manager<T>::find (const ACE_Active_Map_Manager_Key &key, T *&internal_value) { - size_t index = key.index (); - size_t generation = key.generation (); + size_t slot_index = key.slot_index (); + size_t slot_generation = key.slot_generation (); - if (index > this->total_size_ || - this->search_structure_[index].ext_id_.generation () != generation || - this->search_structure_[index].ext_id_.index () == this->free_list_id ()) + if (slot_index > this->total_size_ || + this->search_structure_[slot_index].ext_id_.slot_generation () != slot_generation || + this->search_structure_[slot_index].ext_id_.slot_index () == this->free_list_id ()) { return -1; } else { // This is where the user value is. - internal_value = &this->search_structure_[index].int_id_; + internal_value = &this->search_structure_[slot_index].int_id_; } return 0; @@ -108,7 +108,7 @@ ACE_Active_Map_Manager<T>::rebind (const ACE_Active_Map_Manager_Key &key, if (result == 0) { // Store new value. - this->search_structure_[key.index ()].int_id_ = value; + this->search_structure_[key.slot_index ()].int_id_ = value; } return result; @@ -124,10 +124,10 @@ ACE_Active_Map_Manager<T>::rebind (const ACE_Active_Map_Manager_Key &key, if (result == 0) { // Copy old value. - old_value = this->search_structure_[key.index ()].int_id_; + old_value = this->search_structure_[key.slot_index ()].int_id_; // Store new value. - this->search_structure_[key.index ()].int_id_ = value; + this->search_structure_[key.slot_index ()].int_id_ = value; } return result; @@ -144,13 +144,13 @@ ACE_Active_Map_Manager<T>::rebind (const ACE_Active_Map_Manager_Key &key, if (result == 0) { // Copy old key. - old_key = this->search_structure_[key.index ()].ext_id_; + old_key = this->search_structure_[key.slot_index ()].ext_id_; // Copy old value. - old_value = this->search_structure_[key.index ()].int_id_; + old_value = this->search_structure_[key.slot_index ()].int_id_; // Store new value. - this->search_structure_[key.index ()].int_id_ = value; + this->search_structure_[key.slot_index ()].int_id_ = value; } return result; @@ -165,13 +165,13 @@ ACE_Active_Map_Manager<T>::unbind (const ACE_Active_Map_Manager_Key &key, if (result == 0) { - size_t index = key.index (); + size_t slot_index = key.slot_index (); // Move from occupied list to free list - this->move_from_occupied_list_to_free_list (index); + this->move_from_occupied_list_to_free_list (slot_index); - // Reset the index. This will tell us that this entry is free. - this->search_structure_[index].ext_id_.index (this->free_list_id ()); + // Reset the slot_index. This will tell us that this entry is free. + this->search_structure_[slot_index].ext_id_.slot_index (this->free_list_id ()); // Update the current size. --this->cur_size_; |