ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
string_pool Class Reference

#include <string_pool.h>

Classes

struct  chunk_t

Public Member Functions

template<typename T>
unsigned operator[] (const T &s)
 string_pool ()
 ~string_pool ()=default
const char * c_str (size_t no) const
const std::string & get_string (size_t no) const

Protected Types

typedef std::unordered_map< std::string_view, unsigned, string_view_hash, string_view_equal > hash_tablet

Protected Member Functions

unsigned get (std::string_view s)

Protected Attributes

hash_tablet hash_table
std::array< std::unique_ptr< chunk_t >, MAX_CHUNKS > chunk_storage {}
std::array< std::atomic< chunk_t * >, MAX_CHUNKS > chunks {}
std::atomic< size_t > published_size {0}
std::shared_mutex pool_mutex

Static Protected Attributes

static constexpr size_t CHUNK_SHIFT = 12
static constexpr size_t CHUNK_SIZE = size_t{1} << CHUNK_SHIFT
static constexpr size_t CHUNK_MASK = CHUNK_SIZE - 1
static constexpr size_t MAX_CHUNKS = 2048

Member Typedef Documentation

◆ hash_tablet

typedef std::unordered_map< std::string_view, unsigned, string_view_hash, string_view_equal> string_pool::hash_tablet
protected

Constructor & Destructor Documentation

◆ string_pool()

string_pool::string_pool ( )
inline

◆ ~string_pool()

string_pool::~string_pool ( )
default

Member Function Documentation

◆ c_str()

const char * string_pool::c_str ( size_t no) const
inline

◆ get()

unsigned string_pool::get ( std::string_view s)
protected

◆ get_string()

const std::string & string_pool::get_string ( size_t no) const
inline

◆ operator[]()

template<typename T>
unsigned string_pool::operator[] ( const T & s)
inline

Member Data Documentation

◆ CHUNK_MASK

size_t string_pool::CHUNK_MASK = CHUNK_SIZE - 1
staticconstexprprotected

◆ CHUNK_SHIFT

size_t string_pool::CHUNK_SHIFT = 12
staticconstexprprotected

◆ CHUNK_SIZE

size_t string_pool::CHUNK_SIZE = size_t{1} << CHUNK_SHIFT
staticconstexprprotected

◆ chunk_storage

std::array<std::unique_ptr<chunk_t>, MAX_CHUNKS> string_pool::chunk_storage {}
protected

◆ chunks

std::array<std::atomic<chunk_t *>, MAX_CHUNKS> string_pool::chunks {}
protected

◆ hash_table

hash_tablet string_pool::hash_table
protected

◆ MAX_CHUNKS

size_t string_pool::MAX_CHUNKS = 2048
staticconstexprprotected

◆ pool_mutex

std::shared_mutex string_pool::pool_mutex
mutableprotected

◆ published_size

std::atomic<size_t> string_pool::published_size {0}
protected

The documentation for this class was generated from the following files: