#include </builds/gaudi/Gaudi/GaudiKernel/include/GaudiKernel/StringKey.h>
|
| bool | operator== (const StringKey &lhs, const StringKey &rhs) |
| | equality Key for efficiency reason compare the hash-values first More...
|
| |
| bool | operator== (const StringKey &lhs, const std::string &rhs) |
| | equality, without hashing string rely on the native string equality More...
|
| |
| bool | operator== (const std::string &lhs, const StringKey &rhs) |
| |
| bool | operator== (const StringKey &lhs, std::string_view rhs) |
| |
| bool | operator== (std::string_view lhs, const StringKey &rhs) |
| |
| bool | operator!= (const StringKey &lhs, const StringKey &rhs) |
| | non equality Key More...
|
| |
| bool | operator!= (const StringKey &lhs, std::string_view rhs) |
| | non-equality string More...
|
| |
| bool | operator!= (const StringKey &lhs, const std::string &rhs) |
| |
| bool | operator!= (std::string_view lhs, const StringKey &rhs) |
| |
| bool | operator!= (const std::string &lhs, const StringKey &rhs) |
| |
| bool | operator< (const StringKey &lhs, const StringKey &rhs) |
| | less key It can be used as a key for std::map, e.g. More...
|
| |
| bool | operator> (const StringKey &lhs, const StringKey &rhs) |
| | greater key More...
|
| |
| bool | operator<= (const StringKey &lhs, const StringKey &rhs) |
| | less or equal key More...
|
| |
| bool | operator>= (const StringKey &lhs, const StringKey &rhs) |
| | greater or equal key 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
- Attention
- NEVER use the actual hash value for anything stored in files, as it is not guaranteed that the hashing scheme will remain the same.
- Author
- Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
- Date
- 2009-04-08
Definition at line 35 of file StringKey.h.
◆ StringKey() [1/2]
| Gaudi::StringKey::StringKey |
( |
const char * |
key = "" | ) |
|
|
inline |
constructor from plain C-string, perform hashing
Definition at line 38 of file StringKey.h.
◆ StringKey() [2/2]
| Gaudi::StringKey::StringKey |
( |
std::string |
key | ) |
|
constructor from std::string, perform hashing
Definition at line 22 of file StringKey.cpp.
◆ __eq__() [1/2]
| bool Gaudi::StringKey::__eq__ |
( |
const StringKey & |
right | ) |
const |
equality operator for python
Definition at line 29 of file StringKey.cpp.
29 {
return *
this == right; }
◆ __eq__() [2/2]
| bool Gaudi::StringKey::__eq__ |
( |
std::string_view |
right | ) |
const |
equality operators for python
Definition at line 30 of file StringKey.cpp.
30 {
return *
this == right; }
◆ __hash__()
| std::size_t Gaudi::StringKey::__hash__ |
( |
| ) |
const |
|
inline |
the actual access to the hash
- Attention
- NEVER use the actual hash value for anything stored in files, as it is not guaranteed that the hashing scheme will remain the same. The two reason for this function are:
- transparent usage of this object for hashmap-like containers
- Python @reutrn the actual hash value
Definition at line 117 of file StringKey.h.
◆ __neq__() [1/2]
| bool Gaudi::StringKey::__neq__ |
( |
const std::string_view |
right | ) |
const |
non-equality operator for python
Definition at line 32 of file StringKey.cpp.
32 {
return *
this != right; }
◆ __neq__() [2/2]
| bool Gaudi::StringKey::__neq__ |
( |
const StringKey & |
right | ) |
const |
non-equality operator for python
Definition at line 31 of file StringKey.cpp.
31 {
return *
this != right; }
◆ __repr__()
| std::string Gaudi::StringKey::__repr__ |
( |
| ) |
const |
the representation of the object
Definition at line 28 of file StringKey.cpp.
◆ __str__()
| const std::string & Gaudi::StringKey::__str__ |
( |
| ) |
const |
the representation of the object
Definition at line 27 of file StringKey.cpp.
◆ empty()
| bool Gaudi::StringKey::empty |
( |
| ) |
const |
|
inline |
◆ operator const std::string &()
| Gaudi::StringKey::operator const std::string & |
( |
| ) |
const |
|
inline |
implicit cast to std::string
Definition at line 46 of file StringKey.h.
◆ operator!()
| bool Gaudi::StringKey::operator! |
( |
| ) |
const |
|
inline |
◆ str()
| const std::string& Gaudi::StringKey::str |
( |
| ) |
const |
|
inline |
◆ toString()
| std::string Gaudi::StringKey::toString |
( |
| ) |
const |
string representation (for properties)
Definition at line 26 of file StringKey.cpp.
◆ operator!= [1/5]
Definition at line 74 of file StringKey.h.
74 {
return !( lhs == rhs ); }
◆ operator!= [2/5]
Definition at line 72 of file StringKey.h.
72 {
return !( lhs == rhs ); }
◆ operator!= [3/5]
non equality Key
Definition at line 69 of file StringKey.h.
69 {
return !( lhs == rhs ); }
◆ operator!= [4/5]
non-equality string
Definition at line 71 of file StringKey.h.
71 {
return !( lhs == rhs ); }
◆ operator!= [5/5]
Definition at line 73 of file StringKey.h.
73 {
return !( lhs == rhs ); }
◆ operator<
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 ;
MAP::const_iterator i1 =
m.find (
key ) ;
MAP::const_iterator i2 = m_find( "SomeLongKey,_e.g._TES_Locaiton" );
Definition at line 97 of file StringKey.h.
98 return lhs.m_hash == rhs.m_hash ? lhs.m_str < rhs.m_str : lhs.m_hash < rhs.m_hash;
◆ operator<=
less or equal key
Definition at line 103 of file StringKey.h.
103 {
return !( lhs > rhs ); }
◆ operator== [1/5]
| bool operator== |
( |
const std::string & |
lhs, |
|
|
const StringKey & |
rhs |
|
) |
| |
|
friend |
Definition at line 63 of file StringKey.h.
63 {
return rhs == lhs; }
◆ operator== [2/5]
| bool operator== |
( |
const StringKey & |
lhs, |
|
|
const std::string & |
rhs |
|
) |
| |
|
friend |
equality, without hashing string rely on the native string equality
Definition at line 62 of file StringKey.h.
62 {
return lhs.m_str == rhs; }
◆ operator== [3/5]
equality Key for efficiency reason compare the hash-values first
Definition at line 56 of file StringKey.h.
57 return lhs.m_hash == rhs.m_hash && lhs.m_str == rhs.m_str;
◆ operator== [4/5]
| bool operator== |
( |
const StringKey & |
lhs, |
|
|
std::string_view |
rhs |
|
) |
| |
|
friend |
Definition at line 64 of file StringKey.h.
64 {
return lhs.m_str == rhs; }
◆ operator== [5/5]
| bool operator== |
( |
std::string_view |
lhs, |
|
|
const StringKey & |
rhs |
|
) |
| |
|
friend |
Definition at line 65 of file StringKey.h.
65 {
return rhs == lhs; }
◆ operator>
greater key
Definition at line 101 of file StringKey.h.
101 {
return rhs < lhs; }
◆ operator>=
greater or equal key
Definition at line 105 of file StringKey.h.
105 {
return !( lhs < rhs ); }
◆ m_hash
| std::size_t Gaudi::StringKey::m_hash |
|
private |
◆ m_str
| std::string Gaudi::StringKey::m_str |
|
private |
The documentation for this class was generated from the following files: