Polaris: ProtoDatabase< S, T > Class Template Reference

ProtoDatabase< S, T > Class Template Reference

#include <ProtoDatabase.h>

Inheritance diagram for ProtoDatabase< S, T >:

Inheritance graph
[legend]
List of all members.

Public Member Functions

INLINE ProtoDatabase ()
INLINE ProtoDatabase (const ProtoDatabase< S, T > &m)
virtual INLINE ~ProtoDatabase ()
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 ProtoDatabase< 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 34 of file ProtoDatabase.h.


Constructor & Destructor Documentation

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

< nothing to do

Definition at line 98 of file ProtoDatabase.h.

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

< Invoke copy constructor

Definition at line 105 of file ProtoDatabase.h.

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

< nothing to do

Definition at line 113 of file ProtoDatabase.h.


Member Function Documentation

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

less than compare

Implements BaseMapRoot.

Definition at line 69 of file ProtoDatabase.h.

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

equal compare

Implements BaseMapRoot.

Definition at line 79 of file ProtoDatabase.h.

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

print map entry

Implements BaseMapRoot.

Definition at line 89 of file ProtoDatabase.h.

Referenced by KeyDatabase< S, T >::print(), and Database< S, T >::print().

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

Definition at line 120 of file ProtoDatabase.h.

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

Referenced by AIRangeDict::_del_range(), ControlRangeDict::_get_range_ref(), AIRangeDict::_get_range_ref(), AIRangeDict::_set_range(), adjust_switch_value(), build_def_map(), build_in_out_set(), build_in_out_sets(), IPCPProcData::call_data(), EquivalenceDict::clean(), clone_loop(), clone_loop_body(), InterPCodeDomain::contains(), IntraPCodeDomain::contains(), IPCPProcData::create_jump_function(), BinRep::del(), dump_switches(), AIRangeDict::elim_known_facts(), InterPCodeDomain::expand_context_after(), InterPCodeDomain::expand_context_before(), find_defs(), Dictionary< T >::find_ref(), BinRep::find_ref(), InterPCodeDomain::local_domain(), main(), ProtoDatabase< S, T >::operator[](), ControlRangeDict::pretty_print(), AIRangeDict::pretty_print(), AIRangeDict::range_vars(), register_instance(), SEARCH(), switch_value(), translate_common_var(), unregister_instance(), use_call_gsa_name(), and Equivalence::write().

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

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

Definition at line 131 of file ProtoDatabase.h.

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

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

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

Definition at line 142 of file ProtoDatabase.h.

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

Referenced by InterProcConstProp::expand_all_substituted(), and InterProcConstProp::pgms_can_be_called_externally().

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

Definition at line 153 of file ProtoDatabase.h.

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

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

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

Definition at line 160 of file ProtoDatabase.h.

References ProtoDatabase< 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:07:59 2005