OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Friends | List of all members
Accessible< Base > Class Template Reference

#include <AccessibleVector.h>

Inheritance diagram for Accessible< Base >:

Public Types

using const_iterator = decltype(std::declval< const Base * >() ->begin())
 
using value_type = std::iter_value_t< const_iterator >
 
using const_reference = std::iter_reference_t< const_iterator >
 

Public Member Functions

const_reference operator[] (size_t index) const
 
size_t size () const
 
const_reference front () const
 
const_reference back () const
 
AccessibleVector< value_typefrontBack () const
 
auto delta () const
 
AccessibleVector< value_typeadjacentDeltas () const
 
const_reference min () const
 
const_reference max () const
 
AccessibleVector< value_typeminMax () const
 
auto flattened () const
 
template<class Filter >
AccessibleVector< value_typefiltered (Filter filter) const
 
AccessibleVector< value_typereversed () const
 
bool contains (const value_type &value) const
 
template<class... Args>
bool containsAll (const Args &... args) const
 
template<class... Args>
bool containsAny (const Args &... args) const
 
template<class Predicate >
requires std::is_invocable_v<Predicate, value_type>
bool contains (Predicate predicate) const
 

Friends

AccessibleVector< value_typecalculateDelta (const Accessible &l, const Accessible &r)
 

Detailed Description

template<class Base>
class Accessible< Base >

Extension class that adds a couple methods to a container that makes writing tests easier.

The methods themselves might remind you of what's available in Java 8 Stream API, or in std::ranges, but the underlying implementation here is very dumb and doesn't even try to be fast. Every method allocates, so this class isn't suitable for runtime usage - use std::ranges instead.

Aside from the useful methods, Accessible also provides an operator== that makes it possible to compare any two Accessible classes as long as their elements are comparable.

See also
AccessibleVector

Member Typedef Documentation

◆ const_iterator

template<class Base >
using Accessible< Base >::const_iterator = decltype(std::declval<const Base *>()->begin())

◆ const_reference

template<class Base >
using Accessible< Base >::const_reference = std::iter_reference_t<const_iterator>

◆ value_type

template<class Base >
using Accessible< Base >::value_type = std::iter_value_t<const_iterator>

Member Function Documentation

◆ adjacentDeltas()

template<class Base >
AccessibleVector< value_type > Accessible< Base >::adjacentDeltas ( ) const
inline

◆ back()

template<class Base >
const_reference Accessible< Base >::back ( ) const
inline

◆ contains() [1/2]

template<class Base >
bool Accessible< Base >::contains ( const value_type value) const
inline

◆ contains() [2/2]

template<class Base >
template<class Predicate >
requires std::is_invocable_v<Predicate, value_type>
bool Accessible< Base >::contains ( Predicate  predicate) const
inline

◆ containsAll()

template<class Base >
template<class... Args>
bool Accessible< Base >::containsAll ( const Args &...  args) const
inline

◆ containsAny()

template<class Base >
template<class... Args>
bool Accessible< Base >::containsAny ( const Args &...  args) const
inline

◆ delta()

template<class Base >
auto Accessible< Base >::delta ( ) const
inline

◆ filtered()

template<class Base >
template<class Filter >
AccessibleVector< value_type > Accessible< Base >::filtered ( Filter  filter) const
inline

◆ flattened()

template<class Base >
auto Accessible< Base >::flattened ( ) const
inline

◆ front()

template<class Base >
const_reference Accessible< Base >::front ( ) const
inline

◆ frontBack()

template<class Base >
AccessibleVector< value_type > Accessible< Base >::frontBack ( ) const
inline

◆ max()

template<class Base >
const_reference Accessible< Base >::max ( ) const
inline

◆ min()

template<class Base >
const_reference Accessible< Base >::min ( ) const
inline

◆ minMax()

template<class Base >
AccessibleVector< value_type > Accessible< Base >::minMax ( ) const
inline

◆ operator[]()

template<class Base >
const_reference Accessible< Base >::operator[] ( size_t  index) const
inline

◆ reversed()

template<class Base >
AccessibleVector< value_type > Accessible< Base >::reversed ( ) const
inline

◆ size()

template<class Base >
size_t Accessible< Base >::size ( ) const
inline

Friends And Related Function Documentation

◆ calculateDelta

template<class Base >
AccessibleVector< value_type > calculateDelta ( const Accessible< Base > &  l,
const Accessible< Base > &  r 
)
friend

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