NAME

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

SYNOPSIS

#include <ace/Active_Map_Manager_T.h>

template<class T> class ACE_Active_Map_Manager : public ACE_Map_Manager<ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex> { public: 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; ACE_Active_Map_Manager (ACE_Allocator *alloc = 0); ACE_Active_Map_Manager (size_t size, ACE_Allocator *alloc = 0); ~ACE_Active_Map_Manager (void); int open ( size_t length = ACE_DEFAULT_MAP_SIZE, ACE_Allocator *alloc = 0 ); 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; int find (const ACE_Active_Map_Manager_Key &key) const; int find ( const ACE_Active_Map_Manager_Key &key, T *&internal_value ) const; int unbind (const ACE_Active_Map_Manager_Key &key); 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; size_t total_size (void) const; static const ACE_Active_Map_Manager_Key npos (void); void dump (void) const; ACE_Map_Iterator<ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex> begin ( void ); 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 ); ACE_Map_Reverse_Iterator<ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex> rend ( void ); ACE_ALLOC_HOOK_DECLARE; protected: typedef ACE_Map_Manager<ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex> ACE_AMM_BASE; private: inline ACE_UNIMPLEMENTED_FUNC ( void operator= (const ACE_Active_Map_Manager<T> &) ); };

DESCRIPTION

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

Traits.

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;

Initialization and termination methods.

ACE_Active_Map_Manager (ACE_Allocator *alloc = 0);

ACE_Active_Map_Manager (size_t size, ACE_Allocator *alloc = 0);

~ACE_Active_Map_Manager (void);

int open (
    size_t length = ACE_DEFAULT_MAP_SIZE,
    ACE_Allocator *alloc = 0
    );

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;

int find (const ACE_Active_Map_Manager_Key &key) const;

int find (
    const ACE_Active_Map_Manager_Key &key,
    T *&internal_value
    ) const;

Creates a key. User should place their value into *internal_value. This method is useful in reducing the number of copies required in some cases.

int unbind (const ACE_Active_Map_Manager_Key &key);

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;

size_t total_size (void) const;

static const ACE_Active_Map_Manager_Key npos (void);

void dump (void) const;

STL styled iterator factory functions.

ACE_Map_Iterator<ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex> begin (
    void
    );

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
    );

ACE_Map_Reverse_Iterator<ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex> rend (
    void
    );

ACE_ALLOC_HOOK_DECLARE;

Disallow these operations.

inline ACE_UNIMPLEMENTED_FUNC (
    void operator= (const ACE_Active_Map_Manager<T> &)
    );

AUTHOR

Irfan Pyarali

LIBRARY

ace