23#ifndef SGTOOLS_STRINGPOOL_H
24#define SGTOOLS_STRINGPOOL_H
41 typedef unsigned int sgaux_t;
45 static const int sgkey_t_nbits = 30;
46 static const sgkey_t sgkey_t_max =
47 (
static_cast<sgkey_t>(1) << sgkey_t_nbits) - 1;
56 StringPool (
const StringPool& other);
57 StringPool (StringPool&& other);
60 StringPool&
operator= (
const StringPool& other);
61 StringPool&
operator= (StringPool&& other);
91 const std::string*
keyToString (sgkey_t key, sgaux_t& aux)
const;
105 const std::string&
str,
133 bool merge (
const StringPool& other);
ElementLink & operator=(const ElementLink &)=default
size_t size() const
Number of registered mappings.
bool registerKey(sgkey_t key, const std::string &str, sgaux_t aux=0)
Remember an additional mapping from key to string.
std::unique_ptr< StringPoolImpl > m_impl
const std::string * keyToString(sgkey_t key) const
Find the string corresponding to a given key.
sgkey_t stringToKey(const std::string &str, sgaux_t aux=0)
void clear()
Empty the pool.
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.