![]() |
The Gaudi Framework
master (e3184c44)
|
#include </builds/gaudi/Gaudi/GaudiKernel/include/GaudiKernel/StringKey.h>
Public Member Functions | |
StringKey () | |
Default constructor from empty string. More... | |
StringKey (const char *key) | |
constructor from plain C-string, perform hashing More... | |
StringKey (std::string_view key) | |
constructor from std::string_view, 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... | |
operator std::string_view () const | |
implicit cast to std::string_view More... | |
bool | empty () const |
empty key? More... | |
bool | operator! () const |
empty key? More... | |
bool | operator== (const StringKey &) const =default |
Compiler generated equality operator first comparing hash, then string (see below) More... | |
auto | operator (const StringKey &) const =default |
Compiler generated spaceship operator first comparing hash, then string (see below) More... | |
bool | operator== (const char *rhs) const |
Comparison to other string-like types. More... | |
bool | operator== (std::string_view rhs) const |
bool | operator== (const std::string &rhs) const |
std::size_t | __hash__ () const |
the actual access to the hash More... | |
const 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__ (std::string_view right) const |
equality operators for python More... | |
bool | __neq__ (const StringKey &right) const |
non-equality operator for python More... | |
bool | __neq__ (const std::string_view right) const |
non-equality operator for python More... | |
std::string | toString () const |
string representation (for properties) More... | |
Private Attributes | |
std::size_t | m_hash |
the hash More... | |
std::string | m_str |
the actual string More... | |
Friends | |
std::string | operator+ (const std::string &lhs, const Gaudi::StringKey &rhs) |
std::string | operator+ (const char *lhs, const Gaudi::StringKey &rhs) |
std::string | operator+ (const Gaudi::StringKey &lhs, const std::string &rhs) |
std::string | operator+ (const Gaudi::StringKey &lhs, const char *rhs) |
Helper class for efficient "key" access for strings.
Multiple lookups of the same key can be speed up by using a pre-computed key:
The class also supports heterogeneous lookups without the need to construct a temporary StringKey object:
Definition at line 66 of file StringKey.h.
|
inline |
|
inline |
constructor from plain C-string, perform hashing
Definition at line 71 of file StringKey.h.
|
inline |
|
inline |
bool Gaudi::StringKey::__eq__ | ( | const StringKey & | right | ) | const |
equality operator for python
Definition at line 25 of file StringKey.cpp.
bool Gaudi::StringKey::__eq__ | ( | std::string_view | right | ) | const |
equality operators for python
Definition at line 26 of file StringKey.cpp.
|
inline |
the actual access to the hash
Definition at line 107 of file StringKey.h.
bool Gaudi::StringKey::__neq__ | ( | const std::string_view | right | ) | const |
non-equality operator for python
Definition at line 28 of file StringKey.cpp.
bool Gaudi::StringKey::__neq__ | ( | const StringKey & | right | ) | const |
non-equality operator for python
Definition at line 27 of file StringKey.cpp.
std::string Gaudi::StringKey::__repr__ | ( | ) | const |
const std::string & Gaudi::StringKey::__str__ | ( | ) | const |
|
inline |
|
default |
Compiler generated spaceship operator first comparing hash, then string (see below)
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 96 of file StringKey.h.
|
default |
Compiler generated equality operator first comparing hash, then string (see below)
|
inline |
Definition at line 95 of file StringKey.h.
|
inline |
std::string Gaudi::StringKey::toString | ( | ) | const |
|
friend |
Definition at line 126 of file StringKey.h.
|
friend |
Definition at line 128 of file StringKey.h.
|
friend |
Definition at line 127 of file StringKey.h.
|
friend |
Definition at line 125 of file StringKey.h.
|
private |
the hash
Definition at line 137 of file StringKey.h.
|
private |
the actual string
Definition at line 140 of file StringKey.h.