Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
peg::PackratCache Class Reference

#include <peglib.h>

Classes

struct  Slot

Public Member Functions

 PackratCache (size_t expected_entries)
bool find (size_t key, size_t &len, std::any &val) const
void insert_or_assign (size_t key, size_t len, const std::any &val)
void erase (size_t key)

Private Member Functions

void grow ()

Static Private Member Functions

static size_t mix (size_t key)

Private Attributes

size_t initial_capacity_ = 1024
std::vector< Slotslots_
std::vector< std::any > vals_
size_t used_ = 0

Static Private Attributes

static constexpr size_t kEmpty = static_cast<size_t>(-1)
static constexpr size_t kTombstone = static_cast<size_t>(-2)

Constructor & Destructor Documentation

◆ PackratCache()

peg::PackratCache::PackratCache ( size_t expected_entries)
inlineexplicit

Member Function Documentation

◆ erase()

void peg::PackratCache::erase ( size_t key)
inline
Here is the call graph for this function:

◆ find()

bool peg::PackratCache::find ( size_t key,
size_t & len,
std::any & val ) const
inline
Here is the call graph for this function:

◆ grow()

void peg::PackratCache::grow ( )
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ insert_or_assign()

void peg::PackratCache::insert_or_assign ( size_t key,
size_t len,
const std::any & val )
inline
Here is the call graph for this function:

◆ mix()

size_t peg::PackratCache::mix ( size_t key)
inlinestaticprivate
Here is the caller graph for this function:

Member Data Documentation

◆ initial_capacity_

size_t peg::PackratCache::initial_capacity_ = 1024
private

◆ kEmpty

size_t peg::PackratCache::kEmpty = static_cast<size_t>(-1)
staticconstexprprivate

◆ kTombstone

size_t peg::PackratCache::kTombstone = static_cast<size_t>(-2)
staticconstexprprivate

◆ slots_

std::vector<Slot> peg::PackratCache::slots_
private

◆ used_

size_t peg::PackratCache::used_ = 0
private

◆ vals_

std::vector<std::any> peg::PackratCache::vals_
private

The documentation for this class was generated from the following file:
  • libcockatrice_utility/libcockatrice/utility/peglib.h