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

One thread's lazy DFAs for one regex: the transition caches a scan fills as it walks. More...

#include <onepass.hpp>

Public Member Functions

 shared_dfa_set (const shared_dfa_set &)=delete
 
shared_dfa_set & operator= (const shared_dfa_set &)=delete
 
 shared_dfa_set (shared_dfa_set &&)=delete
 
shared_dfa_set & operator= (shared_dfa_set &&)=delete
 

Static Public Member Functions

static std::atomic< std::int64_t > & alive () noexcept
 Sets alive, counted for the tests that pin when a destroyed regex's DFAs are freed.
 

Public Attributes

std::optional< lazy_dfa > fwd
 Forward lazy DFA, absent until a route first needs it.
 
std::optional< reverse_dfa > rev
 Reverse lazy DFA, for finding a match start from its end.
 
std::optional< reverse_dfa > il_prefix_rev
 Reverse DFA over the inner-literal PREFIX sub-program only.
 
std::uint64_t generation {0}
 The slot generation these DFAs were built under.
 

Detailed Description

One thread's lazy DFAs for one regex: the transition caches a scan fills as it walks.

A set is used by one thread at a time (see dfa_lease), so a scan takes no lock. It is built for one program: generation names the shared_dfa_slot::generation it was built under, and a lease clears a set whose generation is stale before handing it out.

Member Function Documentation

◆ alive()

static std::atomic< std::int64_t > & real::detail::shared_dfa_set::alive ( )
inlinestaticnoexcept

Sets alive, counted for the tests that pin when a destroyed regex's DFAs are freed.

Returns
A reference to the process-wide counter (relaxed atomic).

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