Used for string interning of repeated type names, field names, etc.
The call operator returns for every given string the one immutable pointer to that string in the pool. After calling Freeze(), no new string must be added and the pool is safe to use from multiple threads.
Definition at line 56 of file RNTupleUtils.hxx.
Public Member Functions | |
| RStringPool ()=default | |
| RStringPool (const RStringPool &other)=delete | |
| RStringPool (RStringPool &&other)=default | |
| ~RStringPool ()=default | |
| void | Freeze () |
| const std::string * | Intern (std::string_view str) |
| Searches for str in the pool. | |
| RStringPool & | operator= (const RStringPool &other)=delete |
| RStringPool & | operator= (RStringPool &&other)=default |
Static Private Member Functions | |
| static bool | Less (const std::unique_ptr< std::string > &a, const std::string_view &b) |
Private Attributes | |
| bool | fFrozen = false |
| std::vector< std::unique_ptr< std::string > > | fStrings |
#include <ROOT/RNTupleUtils.hxx>
|
default |
|
default |
|
delete |
|
default |
|
inline |
Definition at line 73 of file RNTupleUtils.hxx.
| const std::string * ROOT::Internal::RStringPool::Intern | ( | std::string_view | str | ) |
Searches for str in the pool.
If not present, adds the string to the pool before returning a pointer to it. Throws if frozen and str is not yet in the pool.
Definition at line 53 of file RNTupleUtils.cxx.
|
inlinestaticprivate |
Definition at line 60 of file RNTupleUtils.hxx.
|
delete |
|
default |
Definition at line 58 of file RNTupleUtils.hxx.
|
private |
Definition at line 57 of file RNTupleUtils.hxx.