Polaris: ProtoMap< S, T > Class Template Reference

ProtoMap< 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 <ProtoMap.h>

Inheritance diagram for ProtoMap< S, T >:

Inheritance graph
[legend]
List of all members.

Public Member Functions

INLINE ProtoMap ()
INLINE ProtoMap (const ProtoMap< S, T > &m)
virtual INLINE ~ProtoMap ()
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 void print (ostream &out, char *sep1, char *sep2) const
 print map to out with sep1 between key and data and sep2 between each element of the map
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

Friends

ostream & operator<< (ostream &o, const ProtoMap< S, T > &m)
 For testing purposes only.

Detailed Description

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


Constructor & Destructor Documentation

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

Definition at line 80 of file ProtoMap.h.

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

< Invoke copy constructor

Definition at line 90 of file ProtoMap.h.

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

< nothing to do

Definition at line 102 of file ProtoMap.h.


Member Function Documentation

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

less than compare

Implements BaseMapRoot.

Definition at line 114 of file ProtoMap.h.

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

equal compare

Implements BaseMapRoot.

Definition at line 121 of file ProtoMap.h.

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

print map entry

Implements BaseMapRoot.

Definition at line 128 of file ProtoMap.h.

Referenced by ProtoMap< S, T >::print(), Map< S, T >::print(), and KeyMap< S, T >::print().

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

Definition at line 138 of file ProtoMap.h.

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

Referenced by _add_asserts_to_ranges(), SSAFullRangeDict::_get_range_ref(), SSAControlRangeDict::_get_range_ref(), GSAFullRangeDict::_get_range_ref(), GSAControlRangeDict::_get_range_ref(), TranslateObject::_translate_symbol_refs_expr(), InlineObject::access_region(), InlineObject::actual_arg(), AliasSets::aliases(), StmtRanges::del_range(), DefLocMap::find_ref(), RangeAccessor::get_range_ref(), Statement::ins_read_access(), Statement::ins_readwrite_access(), Statement::ins_write_access(), Statement::iter_read_guarded(), Statement::iter_readwrite_guarded(), Statement::iter_write_guarded(), VDL::look_up_expr(), IPCPConstants::operator==(), ProtoMap< S, T >::operator[](), SSAFullRangeDict::pretty_print(), SSAControlRangeDict::pretty_print(), GSAFullRangeDict::pretty_print(), GSAControlRangeDict::pretty_print(), HeapStats::print_memory_leaks(), SSAControlRangeDict::range_vars(), GSAControlRangeDict::range_vars(), remove_gotos(), SSAControlRangeDict::representative_stmt(), GSAControlRangeDict::representative_stmt(), set_ranges_for_symbol(), Statement::symbol_access_exists(), and TranslateObject::translate_symbol().

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

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

Definition at line 149 of file ProtoMap.h.

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

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

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

Definition at line 160 of file ProtoMap.h.

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

Referenced by StmtRanges::grab_range(), and process().

template<class S, class T>
INLINE void ProtoMap< S, T >::print ostream &  out,
char *  sep1,
char *  sep2
const
 

print map to out with sep1 between key and data and sep2 between each element of the map

Reimplemented in KeyMap< S, T >, Map< S, T >, Map< Expression, IntElem >, Map< Symbol, IntElem >, Map< Statement, GSAControlRangeData >, Map< Symbol, GSAFullRangeData >, Map< Symbol, Expression >, Map< Statement, GSAPathMap >, Map< Symbol, GSARangeOrData >, Map< Symbol, DefLoc >, Map< HeapObject, HeapElem >, Map< Symbol, Set< Expression > >, Map< Symbol, RefSet< Expression > >, Map< Statement, InlineObject >, Map< Symbol, SSAFullRangeData >, Map< Symbol, UnionFindSetElem >, Map< Symbol, SymbolAccessRef >, Map< Symbol, SymbolAccess >, Map< Symbol, SymRefElem >, Map< Statement, Map< Symbol, Set< Expression > > >, Map< Symbol, CompareData >, Map< Statement, RefMap< Symbol, Expression > >, Map< Statement, SSAControlRangeData >, Map< Symbol, SSARangeOrData >, Map< Symbol, AbstractAccess >, and Map< S, S >.

Definition at line 185 of file ProtoMap.h.

References BMKey::_keyptr, and ProtoMap< S, T >::_print().

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

Definition at line 171 of file ProtoMap.h.

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

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

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

Definition at line 178 of file ProtoMap.h.

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


Friends And Related Function Documentation

template<class S, class T>
ostream& operator<< ostream &  o,
const ProtoMap< S, T > &  m
[friend]
 

For testing purposes only.

Definition at line 75 of file ProtoMap.h.


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