// $Id$ template ACE_INLINE int ACE_Active_Map_Manager::create_key (ACE_Active_Map_Manager_Key &key) { size_t index; int result = this->next_free (index); if (result == 0) { // Move from free list to occupied list this->move_from_free_list_to_occupied_list (index); // Reset the key. this->search_structure_[index].ext_id_.increment_generation_count (); this->search_structure_[index].ext_id_.index (index); // Copy the key for the user. key = this->search_structure_[index].ext_id_; } return result; } template ACE_INLINE int ACE_Active_Map_Manager::bind (const T &value) { ACE_Active_Map_Manager_Key key; return this->bind (value, key); } template ACE_INLINE int ACE_Active_Map_Manager::bind (const T &value, ACE_Active_Map_Manager_Key &key) { int result = this->create_key (key); if (result == 0) { // Store new value. this->search_structure_[key.index ()].int_id_ = value; // Update the current size. ++this->cur_size_; } return result; } template ACE_INLINE int ACE_Active_Map_Manager::find (const ACE_Active_Map_Manager_Key &key) { size_t index = key.index (); size_t generation = key.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 ()) return -1; return 0; } template ACE_INLINE int ACE_Active_Map_Manager::find (const ACE_Active_Map_Manager_Key &key, T &value) { int result = this->find (key); if (result == 0) { // Get current value for key. size_t index = key.index (); value = this->search_structure_[index].int_id_; } return result; } template ACE_INLINE int ACE_Active_Map_Manager::rebind (const ACE_Active_Map_Manager_Key &key, const T &value, T &old_value) { int result = this->find (key); if (result == 0) { // Copy old value. old_value = this->search_structure_[key.index ()].int_id_; // Store new value. this->search_structure_[key.index ()].int_id_ = value; } return result; } template ACE_INLINE int ACE_Active_Map_Manager::rebind (const ACE_Active_Map_Manager_Key &key, const T &value) { int result = this->find (key); if (result == 0) { // Store new value. this->search_structure_[key.index ()].int_id_ = value; } return result; } template ACE_INLINE void ACE_Active_Map_Manager::shared_unbind (const ACE_Active_Map_Manager_Key &key) { size_t index = key.index (); // Move from occupied list to free list this->move_from_occupied_list_to_free_list (index); // Reset the index. This will tell us that this entry is free. this->search_structure_[index].ext_id_.index (this->free_list_id ()); // Update the current size. --this->cur_size_; } template ACE_INLINE int ACE_Active_Map_Manager::unbind (const ACE_Active_Map_Manager_Key &key, T &value) { int result = this->find (key); if (result == 0) { // Copy old value. size_t index = key.index (); value = this->search_structure_[index].int_id_; // Unbind. this->shared_unbind (key); } return result; } template ACE_INLINE int ACE_Active_Map_Manager::unbind (const ACE_Active_Map_Manager_Key &key) { int result = this->find (key); if (result == 0) { // Unbind. this->shared_unbind (key); } return result; } template ACE_INLINE ACE_Active_Map_Manager::ACE_Active_Map_Manager (ACE_Allocator *alloc) : BASE (alloc) { } template ACE_INLINE ACE_Active_Map_Manager::ACE_Active_Map_Manager (size_t size, ACE_Allocator *alloc) : BASE (size, alloc) { } template ACE_INLINE ACE_Active_Map_Manager::~ACE_Active_Map_Manager (void) { } template ACE_INLINE int ACE_Active_Map_Manager::open (size_t length, ACE_Allocator *alloc) { return BASE::open (length, alloc); } template ACE_INLINE int ACE_Active_Map_Manager::close (void) { return BASE::close (); } template ACE_INLINE size_t ACE_Active_Map_Manager::current_size (void) { return BASE::current_size (); } template ACE_INLINE size_t ACE_Active_Map_Manager::total_size (void) { return BASE::total_size (); } template ACE_INLINE void ACE_Active_Map_Manager::dump (void) const { return BASE::dump (); } template ACE_Map_Iterator ACE_Active_Map_Manager::begin (void) { return BASE::begin (); } template ACE_INLINE ACE_Map_Iterator ACE_Active_Map_Manager::end (void) { return BASE::end (); } template ACE_INLINE ACE_Map_Reverse_Iterator ACE_Active_Map_Manager::rbegin (void) { return BASE::rbegin (); } template ACE_INLINE ACE_Map_Reverse_Iterator ACE_Active_Map_Manager::rend (void) { return BASE::rend (); }