|
Gaudi Framework, version v21r8 |
| Home | Generated: 17 Mar 2010 |
#include <StringKey.h>

Public Member Functions | |
| StringKey (const std::string &key="") | |
| constructor from the string, perform hashing | |
| const std::string & | str () const |
| the actual string | |
| operator const std::string & () const | |
| implicit cast to std::string | |
| bool | empty () const |
| empty key? | |
| bool | operator! () const |
| empty key? | |
| bool | operator== (const StringKey &o) const |
| equality Key for efficiency reason compare the hash-values first | |
| bool | operator== (const std::string &o) const |
| equality, without hashing string rely on the native string equality | |
| bool | operator!= (const StringKey &o) const |
| non equality Key | |
| bool | operator!= (const std::string &o) const |
| non-equality string | |
| bool | operator< (const StringKey &o) const |
| less key It can be used as a key for std::map, e.g. | |
| bool | operator> (const StringKey &o) const |
| greater key | |
| bool | operator<= (const StringKey &o) const |
| less or equal key | |
| bool | operator>= (const StringKey &o) const |
| greater or equal key | |
| std::size_t | __hash__ () const |
| the actual access to the hash | |
| std::string | __str__ () const |
| the representation of the object | |
| std::string | __repr__ () const |
| the representation of the object | |
| bool | __eq__ (const StringKey &right) const |
| equality operator for python | |
| bool | __eq__ (const std::string &right) const |
| equality operators for python | |
| bool | __neq__ (const StringKey &right) const |
| non-equality operator for python | |
| bool | __neq__ (const std::string &right) const |
| non-equality operator for python | |
| std::string | toString () const |
| string representation (for properties) | |
Private Attributes | |
| std::string | m_str |
| the actual string: | |
| std::size_t | m_hash |
| the hash: | |
Essentially it is a bit modified version ("boost-free") of the original class stringKey by Gerhard Raven, which is heavily used now in HLT
Definition at line 35 of file StringKey.h.
| Gaudi::StringKey::StringKey | ( | const std::string & | key = "" |
) |
constructor from the string, perform hashing
Definition at line 25 of file StringKey.cpp.
00026 : m_str ( key ) 00027 , m_hash ( boost::hash_value( key ) ) // NB! hashing here!!! 00028 {}
| const std::string& Gaudi::StringKey::str | ( | ) | const [inline] |
| Gaudi::StringKey::operator const std::string & | ( | ) | const [inline] |
| bool Gaudi::StringKey::empty | ( | void | ) | const [inline] |
| bool Gaudi::StringKey::operator! | ( | ) | const [inline] |
| bool Gaudi::StringKey::operator== | ( | const std::string & | o | ) | const [inline] |
equality, without hashing string rely on the native string equality
Definition at line 63 of file StringKey.h.
| bool Gaudi::StringKey::operator!= | ( | const std::string & | o | ) | const [inline] |
less key It can be used as a key for std::map, e.g.
std::map<StringKey,double> Note that with such maps one can gain if using prehashed key:
typedef std::map<StringKey,double> MAP ; const StringKey& key = ... ; const MAP& m = ... ; // EFFICIENT: MAP::const_iterator i1 = m.find ( key ) ; // CAN BE VERY INEFICIENT: MAP::const_iterator i2 = m_find( "SomeLongKey,_e.g._TES_Locaiton" );
Definition at line 94 of file StringKey.h.
| std::size_t Gaudi::StringKey::__hash__ | ( | ) | const [inline] |
the actual access to the hash
Definition at line 114 of file StringKey.h.
00114 { return m_hash ; }
| std::string Gaudi::StringKey::__str__ | ( | ) | const |
the representation of the object
Definition at line 37 of file StringKey.cpp.
00037 { return toString() ; }
| std::string Gaudi::StringKey::__repr__ | ( | ) | const |
the representation of the object
Definition at line 41 of file StringKey.cpp.
00041 { return toString() ; }
| bool Gaudi::StringKey::__eq__ | ( | const std::string & | right | ) | const |
equality operators for python
Definition at line 49 of file StringKey.cpp.
00050 { return *this == right ; }
| bool Gaudi::StringKey::__neq__ | ( | const std::string & | right | ) | const |
non-equality operator for python
Definition at line 59 of file StringKey.cpp.
00060 { return *this != right ; }
| std::string Gaudi::StringKey::toString | ( | ) | const |
string representation (for properties)
Definition at line 32 of file StringKey.cpp.
00033 { return Gaudi::Utils::toString ( m_str ) ; }
std::string Gaudi::StringKey::m_str [private] |
std::size_t Gaudi::StringKey::m_hash [private] |