ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::Shadow< Inc, Scratch, Eq > Class Template Reference

an observer that forwards every event to an incremental observer and to one that computes from scratch, and compares their answers at each query by Eq: an audit of the incremental one by recomputation, at a cost of about twice the work More...

#include <ADS/Modification.h>

Classes

struct  Counts
 what a shadow counts More...

Public member functions

 Shadow (Inc &i, Scratch &s, Eq eq=Eq())
 the shadow of \( i \) by \( s \), compared by \( \mathit{eq} \)
template<class E>
requires ( forwarded< E > )
void on (const E &e) noexcept(nothrow_for< E >)
 forwards \( e \) to both, to those that want it
void group_begin (const mod::Group &g)
 the group hooks of both, where they have them
void group_end (void)
 the end of a group for both
void flush (void)
 flush() of both, where they have it
template<class F>
requires ( ! forwarding_query_tag< std::remove_cvref_t< F > > )
auto query (F &&f)
 the answer of the incremental observer to \( f \), compared with that of the other one (a violation at the level of the audits if they differ)
template<class F>
bool agree (F &&f)
 whether the two observers give the same answer to \( f \)
template<class S>
bool audit (const S &s) const
 the audits of both, where they have them
const Counts & counts (void) const
 the counts
Inc & incremental (void)
 the incremental observer
Scratch & scratch (void)
 the observer from scratch

Static public member functions

template<meetable_query T>
static constexpr auto query (T) noexcept
 the answer of the composition of the two observers to the forwarded query of the tag T [see Capabilities.h], the meet of theirs

Detailed description

template<class Inc, class Scratch, class Eq = std::equal_to<>>
class ADS::Shadow< Inc, Scratch, Eq >

an observer that forwards every event to an incremental observer and to one that computes from scratch, and compares their answers at each query by Eq: an audit of the incremental one by recomputation, at a cost of about twice the work

Constructor and destructor documentation

◆ Shadow()

template<class Inc, class Scratch, class Eq = std::equal_to<>>
ADS::Shadow< Inc, Scratch, Eq >::Shadow ( Inc & i,
Scratch & s,
Eq eq = Eq() )
inline

the shadow of \( i \) by \( s \), compared by \( \mathit{eq} \)

Member function documentation

◆ agree()

template<class Inc, class Scratch, class Eq = std::equal_to<>>
template<class F>
bool ADS::Shadow< Inc, Scratch, Eq >::agree ( F && f)
inlinenodiscard

whether the two observers give the same answer to \( f \)

◆ audit()

template<class Inc, class Scratch, class Eq = std::equal_to<>>
template<class S>
bool ADS::Shadow< Inc, Scratch, Eq >::audit ( const S & s) const
inlinenodiscard

the audits of both, where they have them

◆ counts()

template<class Inc, class Scratch, class Eq = std::equal_to<>>
const Counts & ADS::Shadow< Inc, Scratch, Eq >::counts ( void ) const
inlinenodiscard

the counts

◆ flush()

template<class Inc, class Scratch, class Eq = std::equal_to<>>
void ADS::Shadow< Inc, Scratch, Eq >::flush ( void )
inline

flush() of both, where they have it

◆ group_begin()

template<class Inc, class Scratch, class Eq = std::equal_to<>>
void ADS::Shadow< Inc, Scratch, Eq >::group_begin ( const mod::Group & g)
inline

the group hooks of both, where they have them

◆ group_end()

template<class Inc, class Scratch, class Eq = std::equal_to<>>
void ADS::Shadow< Inc, Scratch, Eq >::group_end ( void )
inline

the end of a group for both

◆ incremental()

template<class Inc, class Scratch, class Eq = std::equal_to<>>
Inc & ADS::Shadow< Inc, Scratch, Eq >::incremental ( void )
inlinenodiscard

the incremental observer

◆ on()

template<class Inc, class Scratch, class Eq = std::equal_to<>>
template<class E>
requires ( forwarded< E > )
void ADS::Shadow< Inc, Scratch, Eq >::on ( const E & e)
inlinenoexcept

forwards \( e \) to both, to those that want it

◆ query() [1/2]

template<class Inc, class Scratch, class Eq = std::equal_to<>>
template<class F>
requires ( ! forwarding_query_tag< std::remove_cvref_t< F > > )
auto ADS::Shadow< Inc, Scratch, Eq >::query ( F && f)
inline

the answer of the incremental observer to \( f \), compared with that of the other one (a violation at the level of the audits if they differ)

◆ query() [2/2]

template<class Inc, class Scratch, class Eq = std::equal_to<>>
template<meetable_query T>
constexpr auto ADS::Shadow< Inc, Scratch, Eq >::query ( T )
inlinestaticnodiscardconstexprnoexcept

the answer of the composition of the two observers to the forwarded query of the tag T [see Capabilities.h], the meet of theirs

◆ scratch()

template<class Inc, class Scratch, class Eq = std::equal_to<>>
Scratch & ADS::Shadow< Inc, Scratch, Eq >::scratch ( void )
inlinenodiscard

the observer from scratch


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