purify
C++ Purify implementation with native circuit and BPP support
Loading...
Searching...
No Matches
purify::bppp::ExperimentalCircuitCache Class Referencefinal

Caller-owned cache for reusable experimental circuit reduction and BPPP backend data. More...

#include <bppp.hpp>

Inheritance diagram for purify::bppp::ExperimentalCircuitCache:
purify::bppp::ExperimentalCircuitBackend

Data Structures

struct  Impl

Public Member Functions

 ExperimentalCircuitCache ()
 ExperimentalCircuitCache (const ExperimentalCircuitCache &)=delete
ExperimentalCircuitCache & operator= (const ExperimentalCircuitCache &)=delete
 ExperimentalCircuitCache (ExperimentalCircuitCache &&other) noexcept
ExperimentalCircuitCache & operator= (ExperimentalCircuitCache &&other) noexcept
 ~ExperimentalCircuitCache ()
void clear ()
std::size_t size () const noexcept
Result< ExperimentalCircuitCacheLine > clone_line_for_thread (std::span< const PointBytes > generators) const
 Clones one warmed backend-resource line for thread-local use.
std::shared_ptr< const void > find_public_data (const std::array< unsigned char, 32 > &key) const
 Looks up opaque cached reduction data by digest key.
void insert_public_data (std::array< unsigned char, 32 > key, std::shared_ptr< const void > value)
 Stores opaque cached reduction data by digest key.
purify_bppp_backend_resources * get_or_create_backend_resources (std::span< const PointBytes > generators, purify_secp_context *secp_context)
 Returns cached backend resources for this generator set, creating them on first use.
Public Member Functions inherited from purify::bppp::ExperimentalCircuitBackend
 ExperimentalCircuitBackend (const ExperimentalCircuitBackend &)=delete
ExperimentalCircuitBackend & operator= (const ExperimentalCircuitBackend &)=delete
 ExperimentalCircuitBackend (ExperimentalCircuitBackend &&) noexcept=default
ExperimentalCircuitBackend & operator= (ExperimentalCircuitBackend &&) noexcept=default
virtual ~ExperimentalCircuitBackend ()

Additional Inherited Members

Protected Member Functions inherited from purify::bppp::ExperimentalCircuitBackend
 ExperimentalCircuitBackend ()=default

Detailed Description

Definition at line 191 of file bppp.hpp.

Constructor & Destructor Documentation

◆ ExperimentalCircuitCache() [1/3]

purify::bppp::ExperimentalCircuitCache::ExperimentalCircuitCache ( )

Definition at line 158 of file bppp.cpp.

Referenced by ExperimentalCircuitCache(), ExperimentalCircuitCache(), operator=(), and operator=().

◆ ExperimentalCircuitCache() [2/3]

purify::bppp::ExperimentalCircuitCache::ExperimentalCircuitCache ( const ExperimentalCircuitCache & )
delete

◆ ExperimentalCircuitCache() [3/3]

purify::bppp::ExperimentalCircuitCache::ExperimentalCircuitCache ( ExperimentalCircuitCache && other)
defaultnoexcept

◆ ~ExperimentalCircuitCache()

Member Function Documentation

◆ clear()

void purify::bppp::ExperimentalCircuitCache::clear ( )

Definition at line 169 of file bppp.cpp.

Referenced by ~ExperimentalCircuitCache().

◆ clone_line_for_thread()

Result< ExperimentalCircuitCacheLine > purify::bppp::ExperimentalCircuitCache::clone_line_for_thread ( std::span< const PointBytes > generators) const
nodiscard

If a warmed backend entry matching generators exists, it is deep-cloned so the returned line has its own scratch space and mutable generator scratch buffers for that one entry. No public reduction data is copied into the clone. If no warmed entry matches, the returned line is empty.

Returns
A thread-local one-line clone, or a backend/internal error if duplication fails.

Definition at line 182 of file bppp.cpp.

References purify::BackendRejectedInput, purify::bppp::generator_backend_cache_key(), purify_bppp_backend_resources_clone(), and purify::unexpected_error().

Referenced by ~ExperimentalCircuitCache().

◆ find_public_data()

std::shared_ptr< const void > purify::bppp::ExperimentalCircuitCache::find_public_data ( const std::array< unsigned char, 32 > & key) const
nodiscard

Definition at line 208 of file bppp.cpp.

Referenced by ~ExperimentalCircuitCache().

◆ get_or_create_backend_resources()

purify_bppp_backend_resources * purify::bppp::ExperimentalCircuitCache::get_or_create_backend_resources ( std::span< const PointBytes > generators,
purify_secp_context * secp_context )
nodiscard

Definition at line 220 of file bppp.cpp.

Referenced by ~ExperimentalCircuitCache().

◆ insert_public_data()

void purify::bppp::ExperimentalCircuitCache::insert_public_data ( std::array< unsigned char, 32 > key,
std::shared_ptr< const void > value )

Definition at line 213 of file bppp.cpp.

Referenced by ~ExperimentalCircuitCache().

◆ operator=() [1/2]

ExperimentalCircuitCache & purify::bppp::ExperimentalCircuitCache::operator= ( const ExperimentalCircuitCache & )
delete

◆ operator=() [2/2]

ExperimentalCircuitCache & purify::bppp::ExperimentalCircuitCache::operator= ( ExperimentalCircuitCache && other)
defaultnoexcept

◆ size()

std::size_t purify::bppp::ExperimentalCircuitCache::size ( ) const
nodiscardnoexcept

Definition at line 176 of file bppp.cpp.

References size().

Referenced by size(), and ~ExperimentalCircuitCache().


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