REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
Loading...
Searching...
No Matches
real::detail::pc_set_cache Struct Reference

A tiny open-chaining hash set of interned PC-set state ids, keyed by their pc-set. Replaces a std::unordered_map so the DFAs stay literal types (a constexpr real::regex embeds one in its scratch state); all-std::vector storage is constexpr-constructible in C++20. Maps a candidate pc-set to its existing state id, or not_found, comparing against the owner's pcs. More...

#include <lazy_dfa.hpp>

Public Member Functions

constexpr pc_set_cache ()
 
constexpr std::uint32_t find (const std::vector< std::int32_t > &pcs, const std::vector< std::vector< std::int32_t > > &state_pcs) const
 
constexpr void insert (const std::vector< std::int32_t > &pcs, std::uint32_t id)
 
constexpr void clear ()
 

Static Public Member Functions

static constexpr std::size_t hash (const std::vector< std::int32_t > &v)
 

Public Attributes

std::vector< std::vector< std::uint32_t > > buckets
 

Static Public Attributes

static constexpr std::size_t bucket_count {2048}
 
static constexpr std::uint32_t not_found {0xFFFFFFFFU}
 

Detailed Description

A tiny open-chaining hash set of interned PC-set state ids, keyed by their pc-set. Replaces a std::unordered_map so the DFAs stay literal types (a constexpr real::regex embeds one in its scratch state); all-std::vector storage is constexpr-constructible in C++20. Maps a candidate pc-set to its existing state id, or not_found, comparing against the owner's pcs.

Definition at line 425 of file lazy_dfa.hpp.

Constructor & Destructor Documentation

◆ pc_set_cache()

constexpr real::detail::pc_set_cache::pc_set_cache ( )
inlineconstexpr

Definition at line 432 of file lazy_dfa.hpp.

Member Function Documentation

◆ clear()

constexpr void real::detail::pc_set_cache::clear ( )
inlineconstexpr

Definition at line 465 of file lazy_dfa.hpp.

◆ find()

constexpr std::uint32_t real::detail::pc_set_cache::find ( const std::vector< std::int32_t > &  pcs,
const std::vector< std::vector< std::int32_t > > &  state_pcs 
) const
inlineconstexpr

Definition at line 448 of file lazy_dfa.hpp.

◆ hash()

static constexpr std::size_t real::detail::pc_set_cache::hash ( const std::vector< std::int32_t > &  v)
inlinestaticconstexpr

Definition at line 436 of file lazy_dfa.hpp.

◆ insert()

constexpr void real::detail::pc_set_cache::insert ( const std::vector< std::int32_t > &  pcs,
std::uint32_t  id 
)
inlineconstexpr

Definition at line 459 of file lazy_dfa.hpp.

Member Data Documentation

◆ bucket_count

constexpr std::size_t real::detail::pc_set_cache::bucket_count {2048}
staticconstexpr

Definition at line 427 of file lazy_dfa.hpp.

◆ buckets

std::vector<std::vector<std::uint32_t> > real::detail::pc_set_cache::buckets

Definition at line 430 of file lazy_dfa.hpp.

◆ not_found

constexpr std::uint32_t real::detail::pc_set_cache::not_found {0xFFFFFFFFU}
staticconstexpr

Definition at line 428 of file lazy_dfa.hpp.


The documentation for this struct was generated from the following file: