diff options
-rw-r--r-- | ChangeLog-99b | 9 | ||||
-rw-r--r-- | ace/Active_Map_Manager.h | 22 | ||||
-rw-r--r-- | ace/Active_Map_Manager.i | 60 |
3 files changed, 45 insertions, 46 deletions
diff --git a/ChangeLog-99b b/ChangeLog-99b index 2c1d1f25f06..8a175b48793 100644 --- a/ChangeLog-99b +++ b/ChangeLog-99b @@ -1,3 +1,10 @@ +Tue Apr 06 19:36:24 1999 Irfan Pyarali <irfan@cs.wustl.edu> + + * ace/Active_Map_Manager.h (ACE_Active_Map_Manager_Key): Added a + separate structure that holds the fields of the key. This + separate structure makes it easier to manage copying the index + and the generation to and from the user buffer. + Tue Apr 6 16:07:29 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> * ace/Synch.cpp (get_thread_id): If we have recursive mutexes then @@ -6,7 +13,7 @@ Tue Apr 6 16:07:29 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> Tue Apr 6 15:50:14 1999 Balachandran Natarajan <bala@cs.wustl.edu> - * docs/exceptions.html: + * docs/exceptions.html: Updated the documentation. Tue Apr 6 15:25:56 1999 Darrell Brunsch <brunsch@cs.wustl.edu> diff --git a/ace/Active_Map_Manager.h b/ace/Active_Map_Manager.h index 87223724f6c..713aedd17b4 100644 --- a/ace/Active_Map_Manager.h +++ b/ace/Active_Map_Manager.h @@ -72,11 +72,25 @@ public: // Increment the <slot_generation> number. private: - ACE_UINT32 slot_index_; - // Slot index in the active map. - ACE_UINT32 slot_generation_; - // Slot generation number of <slot_index_> slot in the active map. + struct key_data + { + // = TITLE + // Data for the Active Object Map Key. + // + // = DESCRIPTION + // This separate structure makes it easier to manage copying + // the index and the generation to and from the user buffer. + + ACE_UINT32 slot_index_; + // Slot index in the active map. + + ACE_UINT32 slot_generation_; + // Slot generation number of <slot_index_> slot in the active map. + }; + + key_data key_data_; + // Data for the Active Object Map Key. }; #if defined (__ACE_INLINE__) diff --git a/ace/Active_Map_Manager.i b/ace/Active_Map_Manager.i index e05bc9d3251..486a595b2be 100644 --- a/ace/Active_Map_Manager.i +++ b/ace/Active_Map_Manager.i @@ -2,39 +2,39 @@ ACE_INLINE ACE_Active_Map_Manager_Key::ACE_Active_Map_Manager_Key (void) - : slot_index_ (~0), - slot_generation_ (0) { // If you change ~0, please change ACE_Map_Manager::free_list_id() // accordingly. + this->key_data_.slot_index_ = ~0; + this->key_data_.slot_generation_ = 0; } 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) { + this->key_data_.slot_index_ = slot_index; + this->key_data_.slot_generation_ = slot_generation; } ACE_INLINE ACE_UINT32 ACE_Active_Map_Manager_Key::slot_index (void) const { - return this->slot_index_; + return this->key_data_.slot_index_; } ACE_INLINE ACE_UINT32 ACE_Active_Map_Manager_Key::slot_generation (void) const { - return this->slot_generation_; + return this->key_data_.slot_generation_; } ACE_INLINE int ACE_Active_Map_Manager_Key::operator== (const ACE_Active_Map_Manager_Key &rhs) const { return - this->slot_index_ == rhs.slot_index_ && - this->slot_generation_ == rhs.slot_generation_; + this->key_data_.slot_index_ == rhs.key_data_.slot_index_ && + this->key_data_.slot_generation_ == rhs.key_data_.slot_generation_; } ACE_INLINE int @@ -46,19 +46,19 @@ ACE_Active_Map_Manager_Key::operator!= (const ACE_Active_Map_Manager_Key &rhs) c ACE_INLINE void ACE_Active_Map_Manager_Key::slot_index (ACE_UINT32 i) { - this->slot_index_ = i; + this->key_data_.slot_index_ = i; } ACE_INLINE void ACE_Active_Map_Manager_Key::slot_generation (ACE_UINT32 g) { - this->slot_generation_ = g; + this->key_data_.slot_generation_ = g; } ACE_INLINE void ACE_Active_Map_Manager_Key::increment_slot_generation_count (void) { - ++this->slot_generation_; + ++this->key_data_.slot_generation_; } /* static */ @@ -69,41 +69,19 @@ ACE_Active_Map_Manager_Key::size (void) } ACE_INLINE void -ACE_Active_Map_Manager_Key::decode (const void *d) +ACE_Active_Map_Manager_Key::decode (const void *data) { - // Cast so that we can do pointer arithmetic. - const char *data = (const char *) d; - - // Grab the slot_index first. - ACE_OS::memcpy (&this->slot_index_, - data, - sizeof this->slot_index_); - - // Move along... - data += sizeof this->slot_index_; - - // Grab the slot_generation second. - ACE_OS::memcpy (&this->slot_generation_, + // Copy the information from the user buffer into the key. + ACE_OS::memcpy (&this->key_data_, data, - sizeof this->slot_generation_); + sizeof this->key_data_); } ACE_INLINE void -ACE_Active_Map_Manager_Key::encode (void *d) const +ACE_Active_Map_Manager_Key::encode (void *data) const { - // Cast so that we can do pointer arithmetic. - char *data = (char *) d; - - // Grab the slot_index first. - ACE_OS::memcpy (data, - &this->slot_index_, - sizeof this->slot_index_); - - // Move along... - data += sizeof this->slot_index_; - - // Grab the slot_generation second. + // Copy the key data to the user buffer. ACE_OS::memcpy (data, - &this->slot_generation_, - sizeof this->slot_generation_); + &this->key_data_, + sizeof this->key_data_); } |