Polaris: TypedBaseMap< S, T > Class Template Reference

TypedBaseMap< S, T > Class Template Reference

#include <TypedBaseMap.h>

Inheritance diagram for TypedBaseMap< S, T >:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual INLINE BaseList_base_data_list () const
 Return a reference to the list structure.
virtual INLINE const S * key_ref (T &data) const
 Return a pointer to the key for this data item, if no key return 0.
virtual INLINE const S * arb_key_ref () const
 Return a pointer to an arbitrary key, if empty return 0.
virtual INLINE const S * first_ref () const
 Return a pointer to a key which is minimum in the map.
virtual INLINE const S * successor_ref (const S &key) const
 Return a pointer to a key which is the next key in the map.
virtual INLINE const S * last_ref () const
 Return a pointer to a key which is maximum in the map.
virtual INLINE ~TypedBaseMap ()

Protected Member Functions

virtual INLINE void * _list_remove (Wrapper *rem_wrap)
 Remove node y's data from the internal list.
virtual INLINE void _list_delete (Wrapper *del_wrap)
 Remove node y's data from the internal list.
virtual INLINE void _kill_data (void *data)
 Delete an element of type T.

Detailed Description

template<class S, class T>
class TypedBaseMap< S, T >

DESCRIPTION

A template for a map for owned keys of type S to objects of type T where:

    1.  'S' is a class with:
   
       a) <, == and << operators taking S& arguments.
       b) a copy constructor S(S &) to clone the
          input object or simple enough structure
          for the default copy constructor to work.
   
    2.  'T' is a class derived from Listable.

The map is implemented as a tree of pointers to whatever type is specified. Thus, all methods to insert elements into a map take a pointer to the key and data and do not allocate space. (i.e., the map aliases whatever is in the list). However, the map takes over ownership of the keys on insert and will delete both a map element and its associated key.

Definition at line 36 of file TypedBaseMap.h.


Constructor & Destructor Documentation

template<class S, class T>
INLINE TypedBaseMap< S, T >::~TypedBaseMap  )  [virtual]
 

Definition at line 75 of file TypedBaseMap.h.


Member Function Documentation

template<class S, class T>
INLINE void * TypedBaseMap< S, T >::_list_remove Wrapper rem_wrap  )  [protected, virtual]
 

Remove node y's data from the internal list.

Reimplemented from BaseMapRoot.

Definition at line 104 of file TypedBaseMap.h.

References BaseList::grab().

template<class S, class T>
INLINE void TypedBaseMap< S, T >::_list_delete Wrapper del_wrap  )  [protected, virtual]
 

Remove node y's data from the internal list.

Reimplemented from BaseMapRoot.

Definition at line 116 of file TypedBaseMap.h.

References BaseList::_del(), and Listable::ref_dec().

template<class S, class T>
INLINE void TypedBaseMap< S, T >::_kill_data void *  data  )  [protected, virtual]
 

Delete an element of type T.

Reimplemented from BaseMapRoot.

Definition at line 126 of file TypedBaseMap.h.

template<class S, class T>
INLINE BaseList & TypedBaseMap< S, T >::_base_data_list  )  const [virtual]
 

Return a reference to the list structure.

ONLY TO BE USED BY KeyIterator TO REPLACE A FRIEND!

Definition at line 133 of file TypedBaseMap.h.

template<class S, class T>
INLINE const S * TypedBaseMap< S, T >::key_ref T &  data  )  const [virtual]
 

Return a pointer to the key for this data item, if no key return 0.

Definition at line 97 of file TypedBaseMap.h.

References BaseMapRoot::key_ref().

template<class S, class T>
INLINE const S * TypedBaseMap< S, T >::arb_key_ref  )  const [virtual]
 

Return a pointer to an arbitrary key, if empty return 0.

Definition at line 85 of file TypedBaseMap.h.

References BaseMapRoot::_arb_bmkey_ref(), and BMKey::_keyptr.

Referenced by Dictionary< T >::arb_ref(), and KeySet< S >::grab().

template<class S, class T>
INLINE const S * TypedBaseMap< S, T >::first_ref  )  const [virtual]
 

Return a pointer to a key which is minimum in the map.

Definition at line 140 of file TypedBaseMap.h.

References BaseMapRoot::_first(), BMNode::_key, BMKey::_keyptr, BMPosition::_ptr, and BaseMapRoot::entries().

Referenced by build_in_out_sets(), EquivalenceDict::clean(), dump_switches(), HeapStats::print_memory_leaks(), and Equivalence::write().

template<class S, class T>
INLINE const S * TypedBaseMap< S, T >::successor_ref const S &  key  )  const [virtual]
 

Return a pointer to a key which is the next key in the map.

Definition at line 153 of file TypedBaseMap.h.

References BMNode::_key, BMKey::_keyptr, BaseMapRoot::_position(), BMPosition::_ptr, BaseMapRoot::_successor(), BMPosition::_type, LEFT, and TOP.

Referenced by dump_switches(), and HeapStats::print_memory_leaks().

template<class S, class T>
INLINE const S * TypedBaseMap< S, T >::last_ref  )  const [virtual]
 

Return a pointer to a key which is maximum in the map.

Definition at line 179 of file TypedBaseMap.h.

References BMNode::_key, BMKey::_keyptr, BaseMapRoot::_last(), BMPosition::_ptr, and BaseMapRoot::entries().


The documentation for this class was generated from the following file:
 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:08:34 2005