NAME

ACE_Map - Defines a map interface.

SYNOPSIS

#include <ace/Map_T.h>

template<class KEY, class VALUE> class ACE_Map { public: typedef KEY key_type; typedef VALUE mapped_type; typedef ACE_Reference_Pair<const KEY, VALUE> value_type; typedef ACE_Iterator<value_type> iterator; typedef ACE_Reverse_Iterator<value_type> reverse_iterator; typedef ACE_Iterator_Impl<value_type> iterator_implementation; typedef ACE_Reverse_Iterator_Impl<value_type> reverse_iterator_implementation; virtual ~ACE_Map (void); virtual int open ( size_t length = ACE_DEFAULT_MAP_SIZE, ACE_Allocator *alloc = 0 ) = 0; virtual int close (void) = 0; virtual int bind (const KEY &key, const VALUE &value) = 0; virtual int bind_modify_key (const VALUE &value, KEY &key) = 0; virtual int bind_create_key (const VALUE &value, KEY &key) = 0; virtual int bind_create_key (const VALUE &value) = 0; virtual int recover_key ( const KEY &modified_key, KEY &original_key ) = 0; virtual int rebind (const KEY &key, const VALUE &value) = 0; virtual int rebind ( const KEY &key, const VALUE &value, VALUE &old_value ) = 0; virtual int rebind ( const KEY &key, const VALUE &value, KEY &old_key, VALUE &old_value ) = 0; virtual int trybind (const KEY &key, VALUE &value) = 0; virtual int find (const KEY &key, VALUE &value) = 0; virtual int find (const KEY &key) = 0; virtual int unbind (const KEY &key) = 0; virtual int unbind (const KEY &key, VALUE &value) = 0; virtual size_t current_size (void) const = 0; virtual size_t total_size (void) const = 0; virtual void dump (void) const = 0; iterator begin (void); iterator end (void); reverse_iterator rbegin (void); reverse_iterator rend (void); protected: ACE_Map (void); virtual ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *begin_impl ( void ) = 0; virtual ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *end_impl ( void ) = 0; virtual ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *rbegin_impl ( void ) = 0; virtual ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *rend_impl ( void ) = 0; private: inline ACE_UNIMPLEMENTED_FUNC ( void operator= (const ACE_Map<KEY, VALUE> &) ); };

DESCRIPTION

Implementation to be provided by subclasses.

Traits.

typedef KEY  key_type;

typedef VALUE  mapped_type;

typedef ACE_Reference_Pair<const KEY, VALUE>  value_type;

typedef ACE_Iterator<value_type>  iterator;

typedef ACE_Reverse_Iterator<value_type>  reverse_iterator;

typedef ACE_Iterator_Impl<value_type>  iterator_implementation;

    typedef ACE_Reverse_Iterator_Impl<value_type>  reverse_iterator_implementation;
    

virtual ~ACE_Map (void);

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

virtual int close (void) = 0;

virtual int bind (const KEY &key, const VALUE &value) = 0;

virtual int bind_modify_key (const VALUE &value, KEY &key) = 0;

virtual int bind_create_key (const VALUE &value, KEY &key) = 0;

virtual int bind_create_key (const VALUE &value) = 0;

virtual int recover_key (
    const KEY &modified_key,
    KEY &original_key
    ) = 0;

virtual int rebind (const KEY &key, const VALUE &value) = 0;

virtual int rebind (
    const KEY &key,
    const VALUE &value,
    VALUE &old_value
    ) = 0;

virtual int rebind (
    const KEY &key,
    const VALUE &value,
    KEY &old_key,
    VALUE &old_value
    ) = 0;

virtual int trybind (const KEY &key, VALUE &value) = 0;

virtual int find (const KEY &key, VALUE &value) = 0;

virtual int find (const KEY &key) = 0;

virtual int unbind (const KEY &key) = 0;

virtual int unbind (const KEY &key, VALUE &value) = 0;

virtual size_t current_size (void) const = 0;

virtual size_t total_size (void) const = 0;

virtual void dump (void) const = 0;

STL styled iterator factory functions.

iterator begin (void);

iterator end (void);

reverse_iterator rbegin (void);

reverse_iterator rend (void);

Protected no-op constructor.

ACE_Map (void);

virtual ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *begin_impl (
    void
    ) = 0;

virtual ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *end_impl (
    void
    ) = 0;

virtual ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *rbegin_impl (
    void
    ) = 0;

virtual ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *rend_impl (
    void
    ) = 0;

Disallow these operations.

inline ACE_UNIMPLEMENTED_FUNC (
    void operator= (const ACE_Map<KEY, VALUE> &)
    );

AUTHOR

Irfan Pyarali irfan@cs.wustl.edu

LIBRARY

ace