Public Member Functions | Protected Types | Protected Attributes

wali::KeySpace Class Reference

List of all members.

Public Member Functions

 KeySpace ()
 ~KeySpace ()
wali::Key getKey (key_src_t ks)
 get_key returns the unique wali::Key associated with the key_src_t ks.
wali::Key getKey (const std::string &s)
 Wrapper method for createing a StringSource and inserting it into the KeySpace.
wali::Key getKey (const char *s)
 Wrapper method for createing a StringSource and inserting it into the KeySpace.
wali::Key getKey (int i)
 Wrapper method for createing a IntSource and inserting it into the KeySpace.
wali::Key getKey (wali::Key k1, wali::Key k2)
 Wrapper method for createing a KeyPairSource and inserting it into the KeySpace.
key_src_t getKeySource (wali::Key key)
 getKeySource retrieves the key_src_t associated to the wali::Key key.
void clear ()
 Reset the KeySpace.
size_t size ()
 Return the number of allocated keys.
wali::Key getKey (std::set< wali::Key > kys)
 Wrapper method for creating a KeySetSource and inserting it into the KeySpace.
std::ostream & printKey (std::ostream &o, wali::Key key, bool abbreviate=false)
 Helper method that looks up the key and calls KeySource::print.
std::string key2str (wali::Key key)
 Return std::string rep of KeySource.

Protected Types

typedef wali::HashMap
< key_src_t, wali::Key
ks_hash_map_t
typedef std::vector< key_src_tks_vector_t

Protected Attributes

ks_hash_map_t keymap
 keymap maps key_src_t to wali::Key.
ks_vector_t values
 wali::Key's are guaranteed to be unique w.r.t.

Member Typedef Documentation

typedef std::vector< key_src_t > wali::KeySpace::ks_vector_t [protected]

Constructor & Destructor Documentation

wali::KeySpace::KeySpace (  ) 
wali::KeySpace::~KeySpace (  ) 

Member Function Documentation

wali_key_t wali::KeySpace::getKey ( key_src_t  ks  ) 

get_key returns the unique wali::Key associated with the key_src_t ks.

get_key returns the unique wali_key_t associated with the key_src_t ks.

If no such key exists, a new wali::Key will be generated.

See also:
KeySource
wali::Key
Parameters:
key_src_t ks for which a key is sought
Returns:
wali::Key associated with parameter KeySource

If no such key exists, a new wali_key_t will be generated.

See also:
KeySource
wali_key_t
Parameters:
key_src_t ks for which a key is sought
Returns:
wali_key_t associated with parameter KeySource

References wali::HashMap< Key, Data, HashFunc, EqualFunc >::end(), wali::HashMap< Key, Data, HashFunc, EqualFunc >::find(), wali::HashMap< Key, Data, HashFunc, EqualFunc >::insert(), keymap, and values.

Referenced by getKey().

Key wali::KeySpace::getKey ( const std::string &  s  ) 

Wrapper method for createing a StringSource and inserting it into the KeySpace.

References getKey().

Key wali::KeySpace::getKey ( const char *  s  ) 

Wrapper method for createing a StringSource and inserting it into the KeySpace.

References getKey().

Key wali::KeySpace::getKey ( int  i  ) 

Wrapper method for createing a IntSource and inserting it into the KeySpace.

References getKey().

Key wali::KeySpace::getKey ( wali::Key  k1,
wali::Key  k2 
)

Wrapper method for createing a KeyPairSource and inserting it into the KeySpace.

References getKey().

key_src_t wali::KeySpace::getKeySource ( wali::Key  key  ) 

getKeySource retrieves the key_src_t associated to the wali::Key key.

getKeySource retrieves the key_src_t associated to the Key key.

If no such KeySource exists, then a NULL pointer (0) is returned.

See also:
KeySource
wali::Key
Parameters:
key whose correpsonding key_src_t is desired
Returns:
key_src_t associated with parameter key

If no such KeySource exists, then a NULL pointer (0) is returned.

See also:
KeySource
Key
Parameters:
key whose correpsonding key_src_t is desired
Returns:
key_src_t associated with parameter key

References size(), and values.

Referenced by key2str(), and printKey().

void wali::KeySpace::clear (  ) 
size_t wali::KeySpace::size (  ) 

Return the number of allocated keys.

References values.

Referenced by getKeySource().

wali::Key wali::KeySpace::getKey ( std::set< wali::Key kys  ) 

Wrapper method for creating a KeySetSource and inserting it into the KeySpace.

std::ostream & wali::KeySpace::printKey ( std::ostream &  o,
wali::Key  key,
bool  abbreviate = false 
)

Helper method that looks up the key and calls KeySource::print.

If abbreviate is true and the string representation of the key being printed is greater than 20 characters, then the actual numeric key is printed instead.

See also:
KeySource
KeySource

References getKeySource(), wali::ref_ptr< T >::is_valid(), and wali::waliErr.

std::string wali::KeySpace::key2str ( wali::Key  key  ) 

Return std::string rep of KeySource.

Looks up the key and calls KeySource::to_string().

See also:
KeySource

Looks up the key and calls KeySource::toString().

See also:
KeySource

References getKeySource(), and wali::ref_ptr< T >::is_valid().


Member Data Documentation

keymap maps key_src_t to wali::Key.

The wali::Key is an index into the vector values

Referenced by clear(), and getKey().

wali::Key's are guaranteed to be unique w.r.t.

this KeySpace because they are indexes into the vector values. KeySource's are retrieved by a lookup into values

Referenced by clear(), getKey(), getKeySource(), and size().


The documentation for this class was generated from the following files: