30 size_t operator()( std::string_view s )
const {
return std::hash<std::string_view>{}( s ); }
78 const std::string&
str()
const {
return m_str; }
80 operator const std::string&()
const {
return m_str; }
82 operator std::string_view()
const {
return m_str; }
109 const std::string& __str__()
const;
111 std::string __repr__()
const;
113 bool __eq__(
const StringKey& right )
const;
115 bool __eq__( std::string_view right )
const;
117 bool __neq__(
const StringKey& right )
const;
119 bool __neq__(
const std::string_view right )
const;
122 std::string toString()
const;
169 GAUDI_API std::ostream&
toStream(
const Gaudi::StringKey& key, std::ostream& s );
191 GAUDI_API StatusCode
parse( Gaudi::StringKey& result, std::string_view input );
201 GAUDI_API StatusCode
parse( std::vector<Gaudi::StringKey>& result, std::string_view input );
Helper class for efficient "key" access for strings.
friend std::string operator+(const std::string &lhs, const Gaudi::StringKey &rhs)
const std::string & str() const
the actual string
std::size_t __hash__() const
the actual access to the hash
friend std::string operator+(const Gaudi::StringKey &lhs, const char *rhs)
std::string m_str
the actual string
bool operator==(const char *rhs) const
Comparison to other string-like types.
bool operator==(std::string_view rhs) const
bool operator==(const std::string &rhs) const
std::size_t m_hash
the hash
operator std::string_view() const
implicit cast to std::string_view
bool operator!() const
empty key?
StringKey(const char *key)
constructor from plain C-string, perform hashing
bool operator==(const StringKey &) const =default
Compiler generated equality operator first comparing hash, then string (see below)
StringKey(std::string key)
constructor from std::string, perform hashing
auto operator<=>(const StringKey &) const =default
Compiler generated spaceship operator first comparing hash, then string (see below)
friend std::string operator+(const Gaudi::StringKey &lhs, const std::string &rhs)
bool empty() const
empty key?
StringKey(std::string_view key)
constructor from std::string_view, perform hashing
StringKey()
Default constructor from empty string.
friend std::string operator+(const char *lhs, const Gaudi::StringKey &rhs)
StatusCode parse(GaudiUtils::HashMap< K, V > &result, std::string_view input)
Basic parser for the types of HashMap used in DODBasicMapper.
std::ostream & toStream(ITERATOR first, ITERATOR last, std::ostream &s, const std::string &open, const std::string &close, const std::string &delim)
the helper function to print the sequence
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
std::ostream & operator<<(std::ostream &o, const Gaudi::StringKey &key)
printout of the object reply on the native printout for the string
std::size_t hash_value(const Gaudi::StringKey &key)
hash-function: heeded for boost::hash
Transparent hash operator for heterogeneous lookups.
size_t operator()(std::string_view s) const
std::size_t operator()(Gaudi::StringKey const &s) const