QtRocket
 
Loading...
Searching...
No Matches
Catch::Generators::GeneratorUntypedBase Class Referenceabstract

#include <catch_amalgamated.hpp>

Inheritance diagram for Catch::Generators::GeneratorUntypedBase:

Public Member Functions

 GeneratorUntypedBase ()=default
 
 GeneratorUntypedBase (GeneratorUntypedBase const &)=default
 
GeneratorUntypedBaseoperator= (GeneratorUntypedBase const &)=default
 
virtual ~GeneratorUntypedBase ()
 
bool countedNext ()
 
std::size_t currentElementIndex () const
 
StringRef currentElementAsString () const
 

Private Member Functions

virtual bool next ()=0
 
virtual std::string stringifyImpl () const =0
 Customization point for currentElementAsString
 

Private Attributes

std::string m_stringReprCache
 
std::size_t m_currentElementIndex = 0
 

Constructor & Destructor Documentation

◆ GeneratorUntypedBase() [1/2]

Catch::Generators::GeneratorUntypedBase::GeneratorUntypedBase ( )
default
Here is the caller graph for this function:

◆ GeneratorUntypedBase() [2/2]

Catch::Generators::GeneratorUntypedBase::GeneratorUntypedBase ( GeneratorUntypedBase const & )
default
Here is the call graph for this function:

◆ ~GeneratorUntypedBase()

Catch::Generators::GeneratorUntypedBase::~GeneratorUntypedBase ( )
virtualdefault
Here is the call graph for this function:

Member Function Documentation

◆ countedNext()

bool Catch::Generators::GeneratorUntypedBase::countedNext ( )

Attempts to move the generator to the next element

Serves as a non-virtual interface to next, so that the top level interface can provide sanity checking and shared features.

As with next, returns true iff the move succeeded and the generator has new valid element to provide.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ currentElementAsString()

StringRef Catch::Generators::GeneratorUntypedBase::currentElementAsString ( ) const

Returns generator's current element as user-friendly string.

By default returns string equivalent to calling Catch::Detail::stringify on the current element, but generators can customize their implementation as needed.

Not thread-safe due to internal caching.

The returned ref is valid only until the generator instance is destructed, or it moves onto the next element, whichever comes first.

Here is the call graph for this function:

◆ currentElementIndex()

std::size_t Catch::Generators::GeneratorUntypedBase::currentElementIndex ( ) const
inline

◆ next()

virtual bool Catch::Generators::GeneratorUntypedBase::next ( )
privatepure virtual

◆ operator=()

GeneratorUntypedBase & Catch::Generators::GeneratorUntypedBase::operator= ( GeneratorUntypedBase const & )
default
Here is the call graph for this function:

◆ stringifyImpl()

virtual std::string Catch::Generators::GeneratorUntypedBase::stringifyImpl ( ) const
privatepure virtual

Customization point for currentElementAsString

Implemented in Catch::Generators::IGenerator< T >, and Catch::Generators::IGenerator< std::vector< T > >.

Here is the caller graph for this function:

Member Data Documentation

◆ m_currentElementIndex

std::size_t Catch::Generators::GeneratorUntypedBase::m_currentElementIndex = 0
private

◆ m_stringReprCache

std::string Catch::Generators::GeneratorUntypedBase::m_stringReprCache
mutableprivate

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