Polaris: ProtoRefDatabase< S, T > Class Template Reference

ProtoRefDatabase< S, T > Class Template Reference

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.
More...

#include <ProtoRefDatabase.h>

Inheritance diagram for ProtoRefDatabase< S, T >:

Inheritance graph
[legend]
List of all members.

Public Member Functions

INLINE ProtoRefDatabase ()
INLINE ProtoRefDatabase (const ProtoRefDatabase< S, T > &m)
virtual INLINE ~ProtoRefDatabase ()
INLINE const T * find_ref (const S &key) const
INLINE T * find_ref (const S &key)
 find data of element with key, or 0 if no such element
INLINE Boolean member (const S &key) const
 Return a flag indicating if there is an element with key.
INLINE const T & operator[] (const S &key) const
INLINE T & operator[] (const S &key)
 Return a reference to the data of the element with key.

Protected Member Functions

virtual INLINE Boolean _less (const BMKey &key1, const BMKey &key2) const
 less than compare
virtual INLINE Boolean _equal (const BMKey &key1, const BMKey &key2) const
 equal compare
virtual INLINE void _print (ostream &o, const BMKey &key) const
 print map entry

Detailed Description

template<class S, class T>
class ProtoRefDatabase< 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 31 of file ProtoRefDatabase.h.


Constructor & Destructor Documentation

template<class S, class T>
INLINE ProtoRefDatabase< S, T >::ProtoRefDatabase  ) 
 

< nothing to do

Definition at line 66 of file ProtoRefDatabase.h.

template<class S, class T>
INLINE ProtoRefDatabase< S, T >::ProtoRefDatabase const ProtoRefDatabase< S, T > &  m  ) 
 

< Invoke copy constructor

Definition at line 73 of file ProtoRefDatabase.h.

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

< nothing to do

Definition at line 81 of file ProtoRefDatabase.h.


Member Function Documentation

template<class S, class T>
INLINE Boolean ProtoRefDatabase< S, T >::_less const BMKey key1,
const BMKey key2
const [protected, virtual]
 

less than compare

Implements BaseMapRoot.

Definition at line 88 of file ProtoRefDatabase.h.

template<class S, class T>
INLINE Boolean ProtoRefDatabase< S, T >::_equal const BMKey key1,
const BMKey key2
const [protected, virtual]
 

equal compare

Implements BaseMapRoot.

Definition at line 98 of file ProtoRefDatabase.h.

template<class S, class T>
INLINE void ProtoRefDatabase< S, T >::_print ostream &  o,
const BMKey key
const [protected, virtual]
 

print map entry

Implements BaseMapRoot.

Definition at line 108 of file ProtoRefDatabase.h.

Referenced by RefKeyDatabase< S, T >::print(), and RefDatabase< S, T >::print().

template<class S, class T>
INLINE const T * ProtoRefDatabase< S, T >::find_ref const S &  key  )  const
 

Definition at line 117 of file ProtoRefDatabase.h.

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

Referenced by called_pgm(), Program::compute_call_lists(), ProtoRefDatabase< S, T >::operator[](), replace_lambda_call_expr(), translate_common_var(), and use_call_gsa_name().

template<class S, class T>
INLINE T * ProtoRefDatabase< S, T >::find_ref const S &  key  ) 
 

find data of element with key, or 0 if no such element

Definition at line 128 of file ProtoRefDatabase.h.

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

template<class S, class T>
INLINE Boolean ProtoRefDatabase< S, T >::member const S &  key  )  const
 

Return a flag indicating if there is an element with key.

Definition at line 139 of file ProtoRefDatabase.h.

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

Referenced by _iterate_to_fixed_point(), and LabelDB::member().

template<class S, class T>
INLINE const T & ProtoRefDatabase< S, T >::operator[] const S &  key  )  const
 

Definition at line 150 of file ProtoRefDatabase.h.

References ProtoRefDatabase< S, T >::find_ref().

template<class S, class T>
INLINE T & ProtoRefDatabase< S, T >::operator[] const S &  key  ) 
 

Return a reference to the data of the element with key.

Definition at line 157 of file ProtoRefDatabase.h.

References ProtoRefDatabase< S, T >::find_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:00 2005