ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
SGTools
SGTools
StringPool.h
Go to the documentation of this file.
1
// This file's extension implies that it's C, but it's really -*- C++ -*-.
2
/*
3
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
4
*/
22
23
#ifndef SGTOOLS_STRINGPOOL_H
24
#define SGTOOLS_STRINGPOOL_H
25
26
#include <stdint.h>
27
#include <string>
28
#include <memory>
29
30
namespace
SG
{
31
32
class
StringPoolImpl
;
33
34
class
StringPool
35
{
36
public
:
38
typedef
uint32_t
sgkey_t
;
39
41
typedef
unsigned
int
sgaux_t;
42
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;
48
50
StringPool();
51
53
~StringPool();
54
56
StringPool (
const
StringPool& other);
57
StringPool (StringPool&& other);
58
60
StringPool&
operator=
(
const
StringPool& other);
61
StringPool&
operator=
(StringPool&& other);
62
72
sgkey_t
stringToKey
(
const
std::string&
str
, sgaux_t aux = 0);
73
81
const
std::string*
keyToString
(sgkey_t key)
const
;
82
91
const
std::string*
keyToString
(sgkey_t key, sgaux_t& aux)
const
;
92
104
bool
registerKey
(sgkey_t key,
105
const
std::string&
str
,
106
sgaux_t aux = 0);
107
108
112
size_t
size
()
const
;
113
117
void
dump
()
const
;
118
119
123
void
clear
();
124
125
133
bool
merge
(
const
StringPool& other);
134
135
136
private
:
137
std::unique_ptr<StringPoolImpl>
m_impl
;
138
};
139
140
141
}
// namespace SG
142
143
144
#endif
// not SGTOOLS_STRINGPOOL_H
operator=
ElementLink & operator=(const ElementLink &)=default
size
size_t size() const
Number of registered mappings.
registerKey
bool registerKey(sgkey_t key, const std::string &str, sgaux_t aux=0)
Remember an additional mapping from key to string.
m_impl
std::unique_ptr< StringPoolImpl > m_impl
Definition
StringPool.h:137
keyToString
const std::string * keyToString(sgkey_t key) const
Find the string corresponding to a given key.
stringToKey
sgkey_t stringToKey(const std::string &str, sgaux_t aux=0)
clear
void clear()
Empty the pool.
SG::StringPoolImpl
Definition
StringPool.cxx:34
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
SG::sgkey_t
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Definition
sgkey_t.h:32
dump
-event-from-file
merge
Definition
merge.py:1
str
Definition
BTagTrackIpAccessor.cxx:11
xAOD::uint32_t
setEventNumber uint32_t
Definition
EventInfo_v1.cxx:127
Generated on
for ATLAS Offline Software by
1.17.0