Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
RandomIntGenerator Class Reference
Inheritance diagram for RandomIntGenerator:
Collaboration diagram for RandomIntGenerator:

Public Member Functions

 RandomIntGenerator (int low, int high)
 
int const & get () const override
 
bool next () override
 
- Public Member Functions inherited from Catch::Generators::IGenerator< int >
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< int >
using type
 

Detailed Description

Definition at line 12 of file 300-Gen-OwnGenerator.cpp.

Constructor & Destructor Documentation

◆ RandomIntGenerator()

RandomIntGenerator::RandomIntGenerator ( int low,
int high )
inline

Definition at line 18 of file 300-Gen-OwnGenerator.cpp.

18 :
19 m_rand(std::random_device{}()),
20 m_dist(low, high)
21 {
22 static_cast<void>(next());
23 }
Here is the call graph for this function:

Member Function Documentation

◆ get()

int const & RandomIntGenerator::get ( ) const
overridevirtual

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

Definition at line 33 of file 300-Gen-OwnGenerator.cpp.

33 {
34 return current_number;
35}

◆ next()

bool RandomIntGenerator::next ( )
inlineoverridevirtual

Implements Catch::Generators::GeneratorUntypedBase.

Definition at line 26 of file 300-Gen-OwnGenerator.cpp.

26 {
27 current_number = m_dist(m_rand);
28 return true;
29 }
Here is the caller graph for this function:

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