BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Member Functions | List of all members
BALL::HashMap< Key, T > Class Template Reference

HashMap class based on the STL map (containing serveral convenience functions) More...

#include <BALL/DATATYPE/hashMap.h>

Inheritance diagram for BALL::HashMap< Key, T >:
BALL::StringHashMap< BALL::Atom::Type > BALL::StringHashMap< BALL::GAFFCESParser * > BALL::StringHashMap< BALL::GAMESSDatFile::block > BALL::StringHashMap< BALL::HybridisationProcessor::Elements_ > BALL::StringHashMap< BALL::JohnsonBoveyShiftProcessor::Ring > BALL::StringHashMap< BALL::Options * > BALL::StringHashMap< BALL::ParameterDescription > BALL::StringHashMap< BALL::String > BALL::StringHashMap< BALL::StringHashMap< BALL::StringHashMap< std::multimap< float, BALL::HybridisationProcessor::AtomNames_ > > > > BALL::StringHashMap< BALL::TVector3 > BALL::StringHashMap< BALL::VIEW::ColorRGBA > BALL::StringHashMap< BALL_INDEX_TYPE > BALL::StringHashMap< BALL_SIZE_TYPE > BALL::StringHashMap< boost::shared_ptr< BALL::BondOrderAssignmentStrategy > > BALL::StringHashMap< CreateMethod > BALL::StringHashMap< CreationMethod > BALL::StringHashMap< double * > BALL::StringHashMap< double(*)(double)> BALL::StringHashMap< EmbeddableVector > BALL::StringHashMap< float > BALL::StringHashMap< JCAMPValue > BALL::StringHashMap< list< BALL_SIZE_TYPE > > BALL::StringHashMap< RuleList > BALL::StringHashMap< SectionIterator > BALL::StringHashMap< std::list< BALL::String >::iterator > BALL::StringHashMap< String > BALL::StringHashMap< StringHashMap< String > > BALL::StringHashMap< vector< BALL::ResidueTorsions::Data > > BALL::StringHashMap< vector< BALL_SIZE_TYPE > >

Classes

class  IllegalKey
 HashMap illegal key exception. More...
 

Public Types

OpenMS style typedefs
typedef boost::unordered_map
< Key, T > 
Base
 
typedef Base::value_type ValueType
 
typedef Key KeyType
 
typedef Base::value_type * PointerType
 
typedef Base::iterator Iterator
 
typedef Base::const_iterator ConstIterator
 

Public Member Functions

bool has (const Key &key) const
 Test whether the map contains the given key. More...
 
const T & operator[] (const Key &key) const
 Return a constant reference to the element whose key is key. More...
 
T & operator[] (const Key &key)
 Return a mutable reference to the element whose key is key. If an element with the key key does not exist, it is inserted. More...
 
bool operator== (const HashMap< Key, T > &rhs) const
 Equality operator. Check whether two two hashmaps contain the same elements. O(n) runtime. More...
 
Size size () const
 

Detailed Description

template<class Key, class T>
class BALL::HashMap< Key, T >

HashMap class based on the STL map (containing serveral convenience functions)

Definition at line 73 of file hashMap.h.

Member Typedef Documentation

template<class Key, class T>
typedef boost::unordered_map<Key, T> BALL::HashMap< Key, T >::Base

Definition at line 93 of file hashMap.h.

template<class Key, class T>
typedef Base::const_iterator BALL::HashMap< Key, T >::ConstIterator

Definition at line 98 of file hashMap.h.

template<class Key, class T>
typedef Base::iterator BALL::HashMap< Key, T >::Iterator

Definition at line 97 of file hashMap.h.

template<class Key, class T>
typedef Key BALL::HashMap< Key, T >::KeyType

Definition at line 95 of file hashMap.h.

template<class Key, class T>
typedef Base::value_type* BALL::HashMap< Key, T >::PointerType

Definition at line 96 of file hashMap.h.

template<class Key, class T>
typedef Base::value_type BALL::HashMap< Key, T >::ValueType

Definition at line 94 of file hashMap.h.

Member Function Documentation

template<class Key, class T>
bool BALL::HashMap< Key, T >::has ( const Key &  key) const
inline

Test whether the map contains the given key.

Definition at line 102 of file hashMap.h.

template<class Key, class T>
bool BALL::HashMap< Key, T >::operator== ( const HashMap< Key, T > &  rhs) const

Equality operator. Check whether two two hashmaps contain the same elements. O(n) runtime.

Definition at line 144 of file hashMap.h.

template<class Key, class T >
const T & BALL::HashMap< Key, T >::operator[] ( const Key &  key) const

Return a constant reference to the element whose key is key.

Exceptions
IllegalKeyif the given key does not exist

Definition at line 130 of file hashMap.h.

template<class Key, class T >
T & BALL::HashMap< Key, T >::operator[] ( const Key &  key)

Return a mutable reference to the element whose key is key. If an element with the key key does not exist, it is inserted.

Definition at line 165 of file hashMap.h.

template<class Key, class T>
Size BALL::HashMap< Key, T >::size ( ) const
inline

Return the size of the hash map. TODO: Remove this. This narrows the precision of size_t! (But of course breaks persistence...)

Definition at line 122 of file hashMap.h.