Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::concept::Map< K, T > Class Template Reference

#include </home/casse/otawa/elm/src/concepts.h>

+ Inheritance diagram for elm::concept::Map< K, T >:

Classes

class  KeyIterator
 
class  PairIterator
 

Public Member Functions

Option< const T & > get (const K &key) const
 
const T & get (const K &key, const T &def) const
 
bool hasKey (const K &key) const
 
- Public Member Functions inherited from elm::concept::Collection< Pair< K, T > >
int count (void)
 
bool contains (const Pair< K, T > &item)
 
bool containsAll (const C< Pair< K, T > > &collection)
 
bool isEmpty (void)
 
 operator bool (void)
 

Detailed Description

template<class K, class T>
class elm::concept::Map< K, T >

This concept defines collections of items retrievable by an assigned key.

Implemented by:

Member Function Documentation

template<class K, class T>
Option<const T&> elm::concept::Map< K, T >::get ( const K &  key) const

Get a value by its key.

Parameters
keyKey to get the value for.
Returns
The matching value.
template<class K, class T>
const T& elm::concept::Map< K, T >::get ( const K &  key,
const T &  def 
) const

Get a value by its key.

Parameters
keyKey to get the value for.
defDefault value to return if the key is not found.
Returns
Found value or default value.
template<class K, class T>
bool elm::concept::Map< K, T >::hasKey ( const K &  key) const

Test if the key is defined in the map.

Parameters
keyKey to look for.
Returns
True if the key is defined in the map, false else.

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