Polaris: TypedBaseRefMap< S, T > Class Template Reference

TypedBaseRefMap< S, T > Class Template Reference

DESCRIPTION

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

#include <TypedBaseRefMap.h>

Inheritance diagram for TypedBaseRefMap< S, T >:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual INLINE BaseRefList_base_data_list () const
 ONLY TO BE USED BY KeyIterator TO REPLACE A FRIEND!
virtual INLINE const S * arb_key_ref () const
 return a pointer to an arbitrary element of the Map, else 0 if empty.
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 ~TypedBaseRefMap ()

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 node y's data from the internal list.

Detailed Description

template<class S, class T>
class TypedBaseRefMap< 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 TypedBaseRefMap.h.


Constructor & Destructor Documentation

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

< nothing to do

Definition at line 72 of file TypedBaseRefMap.h.


Member Function Documentation

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

Remove node y's data from the internal list.

Reimplemented from BaseMapRoot.

Definition at line 91 of file TypedBaseRefMap.h.

References BaseRefList::_del().

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

Remove node y's data from the internal list.

Reimplemented from BaseMapRoot.

Definition at line 109 of file TypedBaseRefMap.h.

References BaseRefList::_del().

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

Delete node y's data from the internal list.

Reimplemented from BaseMapRoot.

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

ONLY TO BE USED BY KeyIterator TO REPLACE A FRIEND!

Definition at line 124 of file TypedBaseRefMap.h.

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

return a pointer to an arbitrary element of the Map, else 0 if empty.

Definition at line 79 of file TypedBaseRefMap.h.

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

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

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

Definition at line 131 of file TypedBaseRefMap.h.

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

Referenced by LabelDB::first_ref().

template<class S, class T>
INLINE const S * TypedBaseRefMap< 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 144 of file TypedBaseRefMap.h.

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

Referenced by LabelDB::successor_ref().

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

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

Definition at line 170 of file TypedBaseRefMap.h.

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

Referenced by LabelDB::last_ref().


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