ACE  6.0.6
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Private Member Functions
ACE_Active_Map_Manager Class Reference

Define a map abstraction that associates system generated keys with user specified values. More...

#include <Active_Map_Manager_T.h>

Inheritance diagram for ACE_Active_Map_Manager:
Inheritance graph
[legend]
Collaboration diagram for ACE_Active_Map_Manager:
Collaboration graph
[legend]

List of all members.

Public Types

typedef ACE_Active_Map_Manager_Key key_type
typedef T mapped_type
typedef ACE_Map_Entry
< ACE_Active_Map_Manager_Key,
T > 
ENTRY
typedef ACE_Map_Iterator
< ACE_Active_Map_Manager_Key,
T, ACE_Null_Mutex
ITERATOR
typedef
ACE_Map_Reverse_Iterator
< ACE_Active_Map_Manager_Key,
T, ACE_Null_Mutex
REVERSE_ITERATOR
typedef ENTRY entry
typedef ITERATOR iterator
typedef REVERSE_ITERATOR reverse_iterator

Public Member Functions

 ACE_Active_Map_Manager (ACE_Allocator *alloc=0)
 Initialize a Active_Map_Manager with the ACE_DEFAULT_MAP_SIZE.
 ACE_Active_Map_Manager (size_t size, ACE_Allocator *alloc=0)
 Initialize a Active_Map_Manager with size entries.
 ~ACE_Active_Map_Manager (void)
int open (size_t length=ACE_DEFAULT_MAP_SIZE, ACE_Allocator *alloc=0)
 Initialize a Active_Map_Manager with size length.
int close (void)
int bind (const T &value, ACE_Active_Map_Manager_Key &key)
int bind (const T &value)
int bind (ACE_Active_Map_Manager_Key &key, T *&internal_value)
int rebind (const ACE_Active_Map_Manager_Key &key, const T &value)
int rebind (const ACE_Active_Map_Manager_Key &key, const T &value, T &old_value)
int rebind (const ACE_Active_Map_Manager_Key &key, const T &value, ACE_Active_Map_Manager_Key &old_key, T &old_value)
int find (const ACE_Active_Map_Manager_Key &key, T &value) const
 Locate value associated with key.
int find (const ACE_Active_Map_Manager_Key &key) const
 Is key in the map?
int find (const ACE_Active_Map_Manager_Key &key, T *&internal_value) const
int unbind (const ACE_Active_Map_Manager_Key &key)
 Remove key from the map.
int unbind (const ACE_Active_Map_Manager_Key &key, T &value)
int unbind (const ACE_Active_Map_Manager_Key &key, T *&internal_value)
size_t current_size (void) const
 Return the current size of the map.
size_t total_size (void) const
 Return the total size of the map.
void dump (void) const
 Dump the state of an object.
ACE_Map_Iterator
< ACE_Active_Map_Manager_Key,
T, ACE_Null_Mutex
begin (void)
 Return forward iterator.
ACE_Map_Iterator
< ACE_Active_Map_Manager_Key,
T, ACE_Null_Mutex
end (void)
ACE_Map_Reverse_Iterator
< ACE_Active_Map_Manager_Key,
T, ACE_Null_Mutex
rbegin (void)
 Return reverse iterator.
ACE_Map_Reverse_Iterator
< ACE_Active_Map_Manager_Key,
T, ACE_Null_Mutex
rend (void)

Static Public Member Functions

static const
ACE_Active_Map_Manager_Key 
npos (void)
 Returns a key that cannot be found in the map.

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.

Protected Types

typedef ACE_Map_Manager
< ACE_Active_Map_Manager_Key,
T, ACE_Null_Mutex
ACE_AMM_BASE
 Private base class.

Private Member Functions

void operator= (const ACE_Active_Map_Manager< T > &)
 ACE_Active_Map_Manager (const ACE_Active_Map_Manager< T > &)

Detailed Description

Define a map abstraction that associates system generated keys with user specified values.

Since the key is system generated, searches are very fast and take a constant amount of time.


Member Typedef Documentation

Private base class.


Constructor & Destructor Documentation

ACE_Active_Map_Manager::ACE_Active_Map_Manager ( ACE_Allocator alloc = 0) [inline]

Initialize a Active_Map_Manager with the ACE_DEFAULT_MAP_SIZE.

ACE_Active_Map_Manager::ACE_Active_Map_Manager ( size_t  size,
ACE_Allocator alloc = 0 
) [inline]

Initialize a Active_Map_Manager with size entries.

ACE_Active_Map_Manager::~ACE_Active_Map_Manager ( void  ) [inline]

Close down a Active_Map_Manager and release dynamically allocated resources.

ACE_Active_Map_Manager::ACE_Active_Map_Manager ( const ACE_Active_Map_Manager< T > &  ) [private]

Member Function Documentation

ACE_Map_Iterator< ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex > ACE_Active_Map_Manager::begin ( void  )

Return forward iterator.

Reimplemented from ACE_Map_Manager< ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex >.

int ACE_Active_Map_Manager::bind ( const T &  value,
ACE_Active_Map_Manager_Key key 
) [inline]

Add value to the map, and the corresponding key produced by the Active_Map_Manager is returned through key.

int ACE_Active_Map_Manager::bind ( const T &  value) [inline]

Add value to the map. The user does not care about the corresponding key produced by the Active_Map_Manager.

int ACE_Active_Map_Manager::bind ( ACE_Active_Map_Manager_Key key,
T *&  internal_value 
) [inline]

Reserves a slot in the internal structure and returns the key and a pointer to the value. User should place their value into internal_value. This method is useful in reducing the number of copies required in some cases. Note that internal_value is only a temporary pointer and will change when the map resizes. Therefore, the user should use the pointer immediately and not hold on to it.

int ACE_Active_Map_Manager::close ( void  ) [inline]

Close down a Active_Map_Manager and release dynamically allocated resources.

Reimplemented from ACE_Map_Manager< ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex >.

size_t ACE_Active_Map_Manager::current_size ( void  ) const [inline]

Return the current size of the map.

Reimplemented from ACE_Map_Manager< ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex >.

void ACE_Active_Map_Manager::dump ( void  ) const [inline]

Dump the state of an object.

Reimplemented from ACE_Map_Manager< ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex >.

ACE_Map_Iterator< ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex > ACE_Active_Map_Manager::end ( void  ) [inline]
int ACE_Active_Map_Manager::find ( const ACE_Active_Map_Manager_Key key,
T &  value 
) const [inline]

Locate value associated with key.

int ACE_Active_Map_Manager::find ( const ACE_Active_Map_Manager_Key key) const [inline]

Is key in the map?

int ACE_Active_Map_Manager::find ( const ACE_Active_Map_Manager_Key key,
T *&  internal_value 
) const [inline]

Locate value associated with key. The value is returned via internal_value and hence a copy is saved. Note that internal_value is only a temporary pointer and will change when the map resizes. Therefore, the user should use the pointer immediately and not hold on to it.

const ACE_Active_Map_Manager_Key ACE_Active_Map_Manager::npos ( void  ) [inline, static]

Returns a key that cannot be found in the map.

int ACE_Active_Map_Manager::open ( size_t  length = ACE_DEFAULT_MAP_SIZE,
ACE_Allocator alloc = 0 
) [inline]

Initialize a Active_Map_Manager with size length.

Reimplemented from ACE_Map_Manager< ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex >.

void ACE_Active_Map_Manager::operator= ( const ACE_Active_Map_Manager< T > &  ) [private]
ACE_Map_Reverse_Iterator< ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex > ACE_Active_Map_Manager::rbegin ( void  ) [inline]

Return reverse iterator.

Reimplemented from ACE_Map_Manager< ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex >.

int ACE_Active_Map_Manager::rebind ( const ACE_Active_Map_Manager_Key key,
const T &  value 
) [inline]

Reassociate key with value. The function fails if key is not in the map.

int ACE_Active_Map_Manager::rebind ( const ACE_Active_Map_Manager_Key key,
const T &  value,
T &  old_value 
) [inline]

Reassociate key with value, storing the old value into the "out" parameter old_value. The function fails if key is not in the map.

int ACE_Active_Map_Manager::rebind ( const ACE_Active_Map_Manager_Key key,
const T &  value,
ACE_Active_Map_Manager_Key old_key,
T &  old_value 
) [inline]

Reassociate key with value, storing the old key and value into the "out" parameter old_key and old_value. The function fails if key is not in the map.

ACE_Map_Reverse_Iterator< ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex > ACE_Active_Map_Manager::rend ( void  ) [inline]
size_t ACE_Active_Map_Manager::total_size ( void  ) const [inline]

Return the total size of the map.

Reimplemented from ACE_Map_Manager< ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex >.

int ACE_Active_Map_Manager::unbind ( const ACE_Active_Map_Manager_Key key) [inline]

Remove key from the map.

int ACE_Active_Map_Manager::unbind ( const ACE_Active_Map_Manager_Key key,
T &  value 
) [inline]

Remove key from the map, and return the value associated with key.

int ACE_Active_Map_Manager::unbind ( const ACE_Active_Map_Manager_Key key,
T *&  internal_value 
) [inline]

Locate value associated with key. The value is returned via internal_value and hence a copy is saved. Note that internal_value is only a temporary pointer and will change when the map resizes or when this slot is reused. Therefore, the user should use the pointer immediately and not hold on to it.


Member Data Documentation

Declare the dynamic allocation hooks.

Reimplemented from ACE_Map_Manager< ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex >.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines