Gaudi Framework, version v23r0 |
Home | Generated: Mon Jan 30 2012 |
Common class providing an architecture-independent hash map. More...
#include <GaudiKernel/HashMap.h>
Public Types | |
typedef H | hasher |
Public Member Functions | |
hasher | hash_funct () const |
Common class providing an architecture-independent hash map.
Due to helper base class Gaudi::Utils::MapBase, this class is "python-friendly", and one can perform all python manipulaitons in intuitive way:
>>> m = ... ## get the map >>> print m ## print the map a'la python class dict ... >>> for key in m : print key, m[key] ## iteration over the map ... >>> for key,value in m.iteritems() : print key, value ... >>> keys = m.keys() ## get the list of keys >>> values = m.values () ## get the list of values >> items = m.items () ## get the list of items >>> if 'one' in m ## check the presence of the key in map >>> v = m.get(key', None) ## return m[key] for existing key, else None >>> del m[key] ## erase the key form the map >>> value m[key] ## unchecked access through the key ... >>> m.update( key, value ) ## update/insert key/value pair
__setitem__
and __getitem__
methods in python:>>> type(m).__setitem__ = Gaudi.Utils.MapBase.__setitem__ >>> type(m).__getitem__ = Gaudi.Utils.MapBase.__getitem__ >>> m[key] = value ## much more intuitive semantics for key insertion
In a similar way __delitem__
methods can be redefined.
Definition at line 108 of file HashMap.h.
typedef H GaudiUtils::HashMap< K, T, H, M >::hasher |
hasher GaudiUtils::HashMap< K, T, H, M >::hash_funct | ( | ) | const [inline] |