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

#include <catch_generators_specific.hpp>

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

Public Member Functions

 RangeGenerator (T const &start, T const &end, T const &step)
 
 RangeGenerator (T const &start, T const &end)
 
T const & get () const override
 
bool next () override
 
 RangeGenerator (T const &start, T const &end, T const &step)
 
 RangeGenerator (T const &start, T const &end)
 
T const & get () const override
 
bool next () override
 
- Public Member Functions inherited from Catch::Generators::IGenerator< 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< T >
using type = T
 

Detailed Description

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

Definition at line 4123 of file catch.hpp.

Constructor & Destructor Documentation

◆ RangeGenerator() [1/4]

template<typename T >
Catch::Generators::RangeGenerator< T >::RangeGenerator ( T const & start,
T const & end,
T const & step )
inline

Definition at line 93 of file catch_generators_specific.hpp.

93 :
94 m_current(start),
95 m_end(end),
96 m_step(step),
97 m_positive(m_step > T(0))
98 {
99 assert(m_current != m_end && "Range start and end cannot be equal");
100 assert(m_step != T(0) && "Step size cannot be zero");
101 assert(((m_positive && m_current <= m_end) || (!m_positive && m_current >= m_end)) && "Step moves away from end");
102 }
#define T(meth, val, expected)

◆ RangeGenerator() [2/4]

template<typename T >
Catch::Generators::RangeGenerator< T >::RangeGenerator ( T const & start,
T const & end )
inline

Definition at line 104 of file catch_generators_specific.hpp.

104 :
105 RangeGenerator(start, end, (start < end) ? T(1) : T(-1))
106 {}
RangeGenerator(T const &start, T const &end, T const &step)

◆ RangeGenerator() [3/4]

template<typename T >
Catch::Generators::RangeGenerator< T >::RangeGenerator ( T const & start,
T const & end,
T const & step )
inline

Definition at line 4130 of file catch.hpp.

4130 :
4131 m_current(start),
4132 m_end(end),
4133 m_step(step),
4134 m_positive(m_step > T(0))
4135 {
4136 assert(m_current != m_end && "Range start and end cannot be equal");
4137 assert(m_step != T(0) && "Step size cannot be zero");
4138 assert(((m_positive && m_current <= m_end) || (!m_positive && m_current >= m_end)) && "Step moves away from end");
4139 }

◆ RangeGenerator() [4/4]

template<typename T >
Catch::Generators::RangeGenerator< T >::RangeGenerator ( T const & start,
T const & end )
inline

Definition at line 4141 of file catch.hpp.

4141 :
4142 RangeGenerator(start, end, (start < end) ? T(1) : T(-1))
4143 {}

Member Function Documentation

◆ get() [1/2]

template<typename T >
T const & Catch::Generators::RangeGenerator< T >::get ( ) const
inlineoverridevirtual

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

Definition at line 108 of file catch_generators_specific.hpp.

108 {
109 return m_current;
110 }

◆ get() [2/2]

template<typename T >
T const & Catch::Generators::RangeGenerator< T >::get ( ) const
inlineoverridevirtual

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

Definition at line 4145 of file catch.hpp.

4145 {
4146 return m_current;
4147 }

◆ next() [1/2]

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

Implements Catch::Generators::GeneratorUntypedBase.

Definition at line 112 of file catch_generators_specific.hpp.

112 {
113 m_current += m_step;
114 return (m_positive) ? (m_current < m_end) : (m_current > m_end);
115 }

◆ next() [2/2]

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

Implements Catch::Generators::GeneratorUntypedBase.

Definition at line 4149 of file catch.hpp.

4149 {
4150 m_current += m_step;
4151 return (m_positive) ? (m_current < m_end) : (m_current > m_end);
4152 }

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