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

`#include <catch_amalgamated.hpp>`

Inheritance diagram for Catch::Generators::GeneratorUntypedBase:
[legend]

## Public Member Functions

| GeneratorUntypedBase ()=default
| GeneratorUntypedBase (GeneratorUntypedBase const &)=default
GeneratorUntypedBase & | operator= (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

Attempts to move the generator to the next element

Returns true iff the move succeeded (and a valid element can be retrieved).

Implemented in Catch::Generators::ChunkGenerator< T >, Catch::Generators::FilterGenerator< T, Predicate >, Catch::Generators::FixedValuesGenerator< T >, Catch::Generators::Generators< T >, Catch::Generators::MapGenerator< T, U, Func >, Catch::Generators::RepeatGenerator< T >, Catch::Generators::SingleValueGenerator< T >, and Catch::Generators::TakeGenerator< T >.

Here is the caller graph for this function:

## 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:

- tests/vendor/catch_amalgamated.hpp
- tests/vendor/catch_amalgamated.cpp