ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK > Class Template ReferenceDefine a map abstraction that associates <EXT_ID>s with <INT_ID>s. More...
Collaboration diagram for ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >:
![]()
Detailed Descriptiontemplate<class EXT_ID, class INT_ID, class ACE_LOCK>
Define a map abstraction that associates <EXT_ID>s with <INT_ID>s.
|
typedef EXT_ID ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::KEY |
typedef INT_ID ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::VALUE |
typedef ACE_LOCK ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::lock_type |
typedef ACE_Map_Entry<EXT_ID, INT_ID> ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::ENTRY |
Reimplemented in ACE_Active_Map_Manager< T >, and ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >.
typedef ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::ITERATOR |
Reimplemented in ACE_Active_Map_Manager< T >, and ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >.
typedef ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::CONST_ITERATOR |
typedef ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::REVERSE_ITERATOR |
Reimplemented in ACE_Active_Map_Manager< T >, and ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >.
typedef ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::iterator |
Reimplemented in ACE_Active_Map_Manager< T >, and ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >.
typedef ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::const_iterator |
typedef ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::reverse_iterator |
Reimplemented in ACE_Active_Map_Manager< T >, and ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >.
anonymous enum [protected] |
ACE_INLINE ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::ACE_Map_Manager | ( | ACE_Allocator * | alloc = 0 |
) | [inline] |
Initialize a ACE_Map_Manager with the ACE_DEFAULT_MAP_SIZE.
ACE_INLINE ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::ACE_Map_Manager | ( | size_t | size, | |
ACE_Allocator * | alloc = 0 | |||
) | [inline] |
Initialize a ACE_Map_Manager with size entries.
ACE_INLINE ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::~ACE_Map_Manager | ( | void | ) | [inline] |
Close down a ACE_Map_Manager and release dynamically allocated resources.
ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::ACE_Map_Manager | ( | const ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK > & | ) | [private] |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::open | ( | size_t | length = ACE_DEFAULT_MAP_SIZE , |
|
ACE_Allocator * | alloc = 0 | |||
) | [inline] |
Initialize a ACE_Map_Manager with size length.
Reimplemented in ACE_Active_Map_Manager< T >, and ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >.
ACE_INLINE int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::close | ( | void | ) | [inline] |
Close down a ACE_Map_Manager and release dynamically allocated resources.
Reimplemented in ACE_Active_Map_Manager< T >, and ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >.
ACE_INLINE int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::bind | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id | |||
) | [inline] |
Associate ext_id with int_id. If ext_id is already in the map then the ACE_Map_Entry is not changed.
0 | If a new entry is bound successfully. | |
1 | If an attempt is made to bind an existing entry. | |
-1 | If failures occur. |
ACE_INLINE int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::rebind | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id, | |||
EXT_ID & | old_ext_id, | |||
INT_ID & | old_int_id | |||
) | [inline] |
Reassociate ext_id with int_id. If ext_id is not in the map then behaves just like bind(). Otherwise, store the old values of ext_id and int_id into the "out" parameters and rebind the new parameters. This is very useful if you need to have an atomic way of updating <Map_Entries> and you also need full control over memory allocation.
0 | If a new entry is bound successfully. | |
1 | If an existing entry was rebound. | |
-1 | If failures occur. |
Reimplemented in ACE_Active_Map_Manager< T >.
ACE_INLINE int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::rebind | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id, | |||
INT_ID & | old_int_id | |||
) | [inline] |
Reassociate ext_id with int_id. If ext_id is not in the map then behaves just like <bind>. Otherwise, store the old values of int_id into the "out" parameter and rebind the new parameters.
0 | If a new entry is bound successfully. | |
1 | If an existing entry was rebound. | |
-1 | If failures occur. |
Reimplemented in ACE_Active_Map_Manager< T >.
ACE_INLINE int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::rebind | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id | |||
) | [inline] |
Reassociate ext_id with int_id. Old values in the map are ignored.
Reimplemented in ACE_Active_Map_Manager< T >.
ACE_INLINE int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::trybind | ( | const EXT_ID & | ext_id, | |
INT_ID & | int_id | |||
) | [inline] |
Associate ext_id with int_id if and only if ext_id is not in the map. If ext_id is already in the map then the int_id parameter is overwritten with the existing value in the map
0 | If a new entry is bound successfully. | |
1 | If an attempt is made to bind an existing entry. | |
-1 | If failures occur. |
ACE_INLINE int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::find | ( | const EXT_ID & | ext_id, | |
INT_ID & | int_id | |||
) | const [inline] |
Locate ext_id and pass out parameter via int_id.
0 | If found. | |
-1 | If not found. |
Reimplemented in ACE_Active_Map_Manager< T >.
ACE_INLINE int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::find | ( | const EXT_ID & | ext_id | ) | const [inline] |
Returns 0 if the ext_id is in the mapping, otherwise -1.
Reimplemented in ACE_Active_Map_Manager< T >, and ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >.
ACE_INLINE int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::unbind | ( | const EXT_ID & | ext_id | ) | [inline] |
Unbind (remove) the ext_id from the map. Don't return the int_id to the caller (this is useful for collections where the int_ids are *not* dynamically allocated...) Returns 0 if successful, else -1.
Reimplemented in ACE_Active_Map_Manager< T >, and ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >.
ACE_INLINE int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::unbind | ( | const EXT_ID & | ext_id, | |
INT_ID & | int_id | |||
) | [inline] |
Break any association of ext_id. Returns the value of int_id in case the caller needs to deallocate memory. Returns 0 if successful, else -1.
Reimplemented in ACE_Active_Map_Manager< T >.
void ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::unbind_all | ( | void | ) | [inline] |
Unbind all entires.
ACE_INLINE size_t ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::current_size | ( | void | ) | const [inline] |
Return the current size of the map.
Reimplemented in ACE_Active_Map_Manager< T >, and ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >.
ACE_INLINE size_t ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::total_size | ( | void | ) | const [inline] |
Return the total size of the map.
Reimplemented in ACE_Active_Map_Manager< T >, and ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >.
ACE_INLINE ACE_LOCK & ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::mutex | ( | void | ) | [inline] |
Returns a reference to the underlying <ACE_LOCK>. This makes it possible to acquire the lock explicitly, which can be useful in some cases if you instantiate the ACE_Atomic_Op with an ACE_Recursive_Mutex or ACE_Process_Mutex, or if you need to guard the state of an iterator.
void ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::dump | ( | void | ) | const [inline] |
Dump the state of an object.
Reimplemented in ACE_Active_Map_Manager< T >, and ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >.
ACE_INLINE ACE_Map_Iterator< EXT_ID, INT_ID, ACE_LOCK > ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::begin | ( | void | ) | [inline] |
Return forward iterator.
Reimplemented in ACE_Active_Map_Manager< T >, and ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >.
ACE_INLINE ACE_Map_Iterator< EXT_ID, INT_ID, ACE_LOCK > ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::end | ( | void | ) | [inline] |
Reimplemented in ACE_Active_Map_Manager< T >, and ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >.
ACE_INLINE ACE_Map_Reverse_Iterator< EXT_ID, INT_ID, ACE_LOCK > ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::rbegin | ( | void | ) | [inline] |
Return reverse iterator.
Reimplemented in ACE_Active_Map_Manager< T >, and ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >.
ACE_INLINE ACE_Map_Reverse_Iterator< EXT_ID, INT_ID, ACE_LOCK > ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::rend | ( | void | ) | [inline] |
Reimplemented in ACE_Active_Map_Manager< T >, and ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >.
int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::bind_i | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id | |||
) | [inline, protected] |
Performs the binding of ext_id to int_id. Must be called with locks held.
int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::shared_bind | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id | |||
) | [inline, protected] |
Bind an entry (without finding first). Must be called with locks held.
int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::rebind_i | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id, | |||
EXT_ID & | old_ext_id, | |||
INT_ID & | old_int_id | |||
) | [inline, protected] |
Performs a rebinding of <ext_it> to int_id. Also, recovers old values. Must be called with locks held.
int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::rebind_i | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id, | |||
INT_ID & | old_int_id | |||
) | [inline, protected] |
Performs a rebinding of <ext_it> to int_id. Also, recovers old values. Must be called with locks held.
int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::rebind_i | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id | |||
) | [inline, protected] |
Performs a rebinding of <ext_it> to int_id. Must be called with locks held.
int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::trybind_i | ( | const EXT_ID & | ext_id, | |
INT_ID & | int_id | |||
) | [inline, protected] |
Performs a conditional bind of int_id using ext_id as the key. Must be called with locks held.
int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::find_i | ( | const EXT_ID & | ext_id, | |
INT_ID & | int_id | |||
) | [inline, protected] |
Performs a find of int_id using ext_id as the key. Must be called with locks held.
int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::find_and_return_index | ( | const EXT_ID & | ext_id, | |
ACE_UINT32 & | slot | |||
) | [inline, protected] |
Performs a find using ext_id as the key. Must be called with locks held.
int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::unbind_i | ( | const EXT_ID & | ext_id, | |
INT_ID & | int_id | |||
) | [inline, protected] |
Performs an unbind of int_id using ext_id as the key. Must be called with locks held.
ACE_INLINE int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::unbind_i | ( | const EXT_ID & | ext_id | ) | [inline, protected] |
Performs an unbind using ext_id as the key. Must be called with locks held.
int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::unbind_and_return_index | ( | const EXT_ID & | ext_id, | |
ACE_UINT32 & | slot | |||
) | [inline, protected] |
Performs an unbind using ext_id as the key. Must be called with locks held.
void ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::unbind_slot | ( | ACE_UINT32 | slot | ) | [inline, protected] |
Unbind slot.
int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::resize_i | ( | ACE_UINT32 | size | ) | [inline, protected] |
Resize the map. Must be called with locks held.
int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::close_i | ( | void | ) | [inline, protected] |
Close down a <Map_Manager>. Must be called with locks held.
ACE_INLINE int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::equal | ( | const EXT_ID & | id1, | |
const EXT_ID & | id2 | |||
) | [inline, protected] |
Returns 1 if <id1> == <id2>, else 0. This is defined as a separate method to facilitate template specialization.
ACE_UINT32 ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::new_size | ( | void | ) | [inline, protected] |
This function returns the new size of the Map Manager. This function is called when we run out of room and need to resize.
void ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::free_search_structure | ( | void | ) | [inline, protected] |
Explicitly call the destructors and free up the <search_structure_>.
ACE_INLINE ACE_UINT32 ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::free_list_id | ( | void | ) | const [inline, protected] |
Id of the free list sentinel.
ACE_INLINE ACE_UINT32 ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::occupied_list_id | ( | void | ) | const [inline, protected] |
Id of the occupied list sentinel.
int ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::next_free | ( | ACE_UINT32 & | slot | ) | [inline, protected] |
Finds the next free slot.
ACE_INLINE void ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::move_from_free_list_to_occupied_list | ( | ACE_UINT32 | slot | ) | [inline, protected] |
Move from free list to occupied list.
ACE_INLINE void ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::move_from_occupied_list_to_free_list | ( | ACE_UINT32 | slot | ) | [inline, protected] |
Move from occupied list to free list.
void ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::shared_move | ( | ACE_UINT32 | slot, | |
ACE_Map_Entry< EXT_ID, INT_ID > & | current_list, | |||
ACE_UINT32 | current_list_id, | |||
ACE_Map_Entry< EXT_ID, INT_ID > & | new_list, | |||
ACE_UINT32 | new_list_id | |||
) | [inline, protected] |
Move helper.
void ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::operator= | ( | const ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK > & | ) | [private] |
friend class ACE_Map_Iterator_Base< EXT_ID, INT_ID, ACE_LOCK > [friend] |
friend class ACE_Map_Const_Iterator_Base< EXT_ID, INT_ID, ACE_LOCK > [friend] |
friend class ACE_Map_Iterator< EXT_ID, INT_ID, ACE_LOCK > [friend] |
friend class ACE_Map_Const_Iterator< EXT_ID, INT_ID, ACE_LOCK > [friend] |
friend class ACE_Map_Reverse_Iterator< EXT_ID, INT_ID, ACE_LOCK > [friend] |
ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::ACE_ALLOC_HOOK_DECLARE |
Declare the dynamic allocation hooks.
Reimplemented in ACE_Active_Map_Manager< T >, and ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >.
ACE_Allocator* ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::allocator_ [protected] |
Pointer to a memory allocator.
ACE_LOCK ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::lock_ [mutable, protected] |
Synchronization variable for the MT_SAFE ACE_Map_Manager.
ACE_Map_Entry<EXT_ID, INT_ID>* ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::search_structure_ [protected] |
Implement the Map as a resizeable array of ACE_Map_Entry.
ACE_UINT32 ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::total_size_ [protected] |
Total number of elements in this->search_structure_.
ACE_UINT32 ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::cur_size_ [protected] |
Current size of the map.
ACE_Map_Entry<EXT_ID, INT_ID> ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::free_list_ [protected] |
Free list.
ACE_Map_Entry<EXT_ID, INT_ID> ACE_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::occupied_list_ [protected] |
Occupied list.