The Gaudi Framework
v30r3 (a5ef0a68)
|
The helper class to represent the efficient "key" for access. More...
#include <GaudiKernel/StringKey.h>
Public Member Functions | |
StringKey (const char *key="") | |
constructor from plain C-string, perform hashing More... | |
StringKey (std::string key) | |
constructor from std::string, perform hashing More... | |
const std::string & | str () const |
the actual string More... | |
operator const std::string & () const | |
implicit cast to std::string More... | |
bool | empty () const |
empty key? More... | |
bool | operator! () const |
empty key? More... | |
bool | operator== (const StringKey &o) const |
equality Key for efficiency reason compare the hash-values first More... | |
bool | operator== (const std::string &o) const |
equality, without hashing string rely on the native string equality More... | |
bool | operator!= (const StringKey &o) const |
non equality Key More... | |
bool | operator!= (const std::string &o) const |
non-equality string More... | |
bool | operator< (const StringKey &o) const |
less key It can be used as a key for std::map, e.g. More... | |
bool | operator> (const StringKey &o) const |
greater key More... | |
bool | operator<= (const StringKey &o) const |
less or equal key More... | |
bool | operator>= (const StringKey &o) const |
greater or equal key More... | |
std::size_t | __hash__ () const |
the actual access to the hash More... | |
std::string | __str__ () const |
the representation of the object More... | |
std::string | __repr__ () const |
the representation of the object More... | |
bool | __eq__ (const StringKey &right) const |
equality operator for python More... | |
bool | __eq__ (const std::string &right) const |
equality operators for python More... | |
bool | __neq__ (const StringKey &right) const |
non-equality operator for python More... | |
bool | __neq__ (const std::string &right) const |
non-equality operator for python More... | |
std::string | toString () const |
string representation (for properties) More... | |
Private Attributes | |
std::string | m_str |
the actual string: More... | |
std::size_t | m_hash |
the hash: More... | |
The helper class to represent the efficient "key" for access.
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 char * | key = "" | ) |
Gaudi::StringKey::StringKey | ( | std::string | key | ) |
constructor from std::string, perform hashing
Definition at line 19 of file StringKey.cpp.
bool Gaudi::StringKey::__eq__ | ( | const StringKey & | right | ) | const |
bool Gaudi::StringKey::__eq__ | ( | const std::string & | right | ) | const |
equality operators for python
Definition at line 48 of file StringKey.cpp.
|
inline |
the actual access to the hash
Definition at line 116 of file StringKey.h.
bool Gaudi::StringKey::__neq__ | ( | const StringKey & | right | ) | const |
bool Gaudi::StringKey::__neq__ | ( | const std::string & | right | ) | const |
non-equality operator for python
Definition at line 56 of file StringKey.cpp.
std::string Gaudi::StringKey::__repr__ | ( | ) | const |
the representation of the object
Definition at line 41 of file StringKey.cpp.
std::string Gaudi::StringKey::__str__ | ( | ) | const |
the representation of the object
Definition at line 37 of file StringKey.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
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:
Definition at line 96 of file StringKey.h.
|
inline |
|
inline |
equality Key for efficiency reason compare the hash-values first
Definition at line 60 of file StringKey.h.
|
inline |
equality, without hashing string rely on the native string equality
Definition at line 64 of file StringKey.h.
|
inline |
|
inline |
|
inline |
std::string Gaudi::StringKey::toString | ( | ) | const |
string representation (for properties)
Definition at line 33 of file StringKey.cpp.
|
private |
the hash:
Definition at line 141 of file StringKey.h.
|
private |
the actual string:
Definition at line 139 of file StringKey.h.