My Project
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
IntGenerator Class Reference

generate integers starting from 0 More...

#include <cf_generator.h>

Public Member Functions

 IntGenerator ()
 
 ~IntGenerator ()
 
bool hasItems () const
 
void reset ()
 
CanonicalForm item () const
 
void next ()
 
void operator++ ()
 
void operator++ (int)
 
CFGeneratorclone () const
 
- Public Member Functions inherited from CFGenerator
 CFGenerator ()
 
virtual ~CFGenerator ()
 
virtual bool hasItems () const
 
virtual void reset ()
 
virtual CanonicalForm item () const
 
virtual void next ()
 
virtual CFGeneratorclone () const
 

Private Attributes

int current
 

Detailed Description

generate integers starting from 0

Definition at line 36 of file cf_generator.h.

Constructor & Destructor Documentation

◆ IntGenerator()

IntGenerator::IntGenerator ( )
inline

Definition at line 41 of file cf_generator.h.

41: current(0) {}

◆ ~IntGenerator()

IntGenerator::~IntGenerator ( )
inline

Definition at line 42 of file cf_generator.h.

42{}

Member Function Documentation

◆ clone()

CFGenerator * IntGenerator::clone ( ) const
virtual

Reimplemented from CFGenerator.

Definition at line 30 of file cf_generator.cc.

31{
32 return new IntGenerator();
33}

◆ hasItems()

bool IntGenerator::hasItems ( ) const
virtual

Reimplemented from CFGenerator.

Definition at line 15 of file cf_generator.cc.

16{
17 return 1;
18}

◆ item()

CanonicalForm IntGenerator::item ( ) const
virtual

Reimplemented from CFGenerator.

Definition at line 20 of file cf_generator.cc.

21{
22 return mapinto (CanonicalForm (current));
23}
CanonicalForm mapinto(const CanonicalForm &f)
factory's main class
Definition: canonicalform.h:86

◆ next()

void IntGenerator::next ( )
virtual

Reimplemented from CFGenerator.

Definition at line 25 of file cf_generator.cc.

26{
27 current++;
28}

◆ operator++() [1/2]

void IntGenerator::operator++ ( )
inline

Definition at line 47 of file cf_generator.h.

47{ next(); }

◆ operator++() [2/2]

void IntGenerator::operator++ ( int  )
inline

Definition at line 48 of file cf_generator.h.

48{ next(); }

◆ reset()

void IntGenerator::reset ( )
inlinevirtual

Reimplemented from CFGenerator.

Definition at line 44 of file cf_generator.h.

44{ current = 0; }

Field Documentation

◆ current

int IntGenerator::current
private

Definition at line 39 of file cf_generator.h.


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