Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Catch::Generators::ChunkGenerator< T > Class Template Referencefinal

#include <catch_generators_generic.hpp>

Inheritance diagram for Catch::Generators::ChunkGenerator< T >:
Collaboration diagram for Catch::Generators::ChunkGenerator< T >:

Public Member Functions

 ChunkGenerator (size_t size, GeneratorWrapper< T > generator)
 
std::vector< T > const & get () const override
 
bool next () override
 
 ChunkGenerator (size_t size, GeneratorWrapper< T > generator)
 
std::vector< T > const & get () const override
 
bool next () override
 
- Public Member Functions inherited from Catch::Generators::IGenerator< std::vector< T > >
virtual ~IGenerator ()=default
 
virtual ~IGenerator ()=default
 
- Public Member Functions inherited from Catch::Generators::GeneratorUntypedBase
 GeneratorUntypedBase ()=default
 
virtual ~GeneratorUntypedBase ()
 
 GeneratorUntypedBase ()=default
 
virtual ~GeneratorUntypedBase ()
 

Additional Inherited Members

- Public Types inherited from Catch::Generators::IGenerator< std::vector< T > >
using type
 

Detailed Description

template<typename T>
class Catch::Generators::ChunkGenerator< T >

Definition at line 3880 of file catch.hpp.

Constructor & Destructor Documentation

◆ ChunkGenerator() [1/2]

template<typename T >
Catch::Generators::ChunkGenerator< T >::ChunkGenerator ( size_t size,
GeneratorWrapper< T > generator )
inline

Definition at line 204 of file catch_generators_generic.hpp.

204 :
205 m_chunk_size(size), m_generator(std::move(generator))
206 {
207 m_chunk.reserve(m_chunk_size);
208 m_chunk.push_back(m_generator.get());
209 for (size_t i = 1; i < m_chunk_size; ++i) {
210 if (!m_generator.next()) {
211 Catch::throw_exception(GeneratorException("Not enough values to initialize the first chunk"));
212 }
213 m_chunk.push_back(m_generator.get());
214 }
215 }
void throw_exception(std::exception const &e)
Here is the call graph for this function:

◆ ChunkGenerator() [2/2]

template<typename T >
Catch::Generators::ChunkGenerator< T >::ChunkGenerator ( size_t size,
GeneratorWrapper< T > generator )
inline

Definition at line 3886 of file catch.hpp.

3886 :
3887 m_chunk_size(size), m_generator(std::move(generator))
3888 {
3889 m_chunk.reserve(m_chunk_size);
3890 m_chunk.push_back(m_generator.get());
3891 for (size_t i = 1; i < m_chunk_size; ++i) {
3892 if (!m_generator.next()) {
3893 Catch::throw_exception(GeneratorException("Not enough values to initialize the first chunk"));
3894 }
3895 m_chunk.push_back(m_generator.get());
3896 }
3897 }
Here is the call graph for this function:

Member Function Documentation

◆ get() [1/2]

template<typename T >
std::vector< T > const & Catch::Generators::ChunkGenerator< T >::get ( ) const
inlineoverridevirtual

Implements Catch::Generators::IGenerator< std::vector< T > >.

Definition at line 216 of file catch_generators_generic.hpp.

216 {
217 return m_chunk;
218 }

◆ get() [2/2]

template<typename T >
std::vector< T > const & Catch::Generators::ChunkGenerator< T >::get ( ) const
inlineoverridevirtual

Implements Catch::Generators::IGenerator< std::vector< T > >.

Definition at line 3898 of file catch.hpp.

3898 {
3899 return m_chunk;
3900 }

◆ next() [1/2]

template<typename T >
bool Catch::Generators::ChunkGenerator< T >::next ( )
inlineoverridevirtual

Implements Catch::Generators::GeneratorUntypedBase.

Definition at line 219 of file catch_generators_generic.hpp.

219 {
220 m_chunk.clear();
221 for (size_t idx = 0; idx < m_chunk_size; ++idx) {
222 if (!m_generator.next()) {
223 return false;
224 }
225 m_chunk.push_back(m_generator.get());
226 }
227 return true;
228 }

◆ next() [2/2]

template<typename T >
bool Catch::Generators::ChunkGenerator< T >::next ( )
inlineoverridevirtual

Implements Catch::Generators::GeneratorUntypedBase.

Definition at line 3901 of file catch.hpp.

3901 {
3902 m_chunk.clear();
3903 for (size_t idx = 0; idx < m_chunk_size; ++idx) {
3904 if (!m_generator.next()) {
3905 return false;
3906 }
3907 m_chunk.push_back(m_generator.get());
3908 }
3909 return true;
3910 }
Here is the call graph for this function:

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