source: git/factory/cf_generator.h @ fce807

spielwiese
Last change on this file since fce807 was 362fc67, checked in by Martin Lee <martinlee84@…>, 12 years ago
chg: remove $Id$
  • Property mode set to 100644
File size: 1.8 KB
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2
3#ifndef INCL_CF_GENERATOR_H
4#define INCL_CF_GENERATOR_H
5
6// #include "config.h"
7
8#include "canonicalform.h"
9
10/*BEGINPUBLIC*/
11
12class CFGenerator
13{
14public:
15    CFGenerator() {}
16    virtual ~CFGenerator() {}
17    virtual bool hasItems() const { return false; }
18    virtual void reset() {};
19    virtual CanonicalForm item() const { return 0; }
20    virtual void next() {};
21    virtual CFGenerator * clone() const { return new CFGenerator();}
22};
23
24class FFGenerator : public CFGenerator
25{
26private:
27    int current;
28public:
29    FFGenerator() : current(0) {}
30    ~FFGenerator() {}
31    bool hasItems() const;
32    void reset() { current = 0; }
33    CanonicalForm item() const;
34    void next();
35    void operator++ () { next(); }
36    void operator++ ( int ) { next(); }
37    CFGenerator * clone() const;
38};
39
40class GFGenerator : public CFGenerator
41{
42private:
43    int current;
44public:
45    GFGenerator();
46    ~GFGenerator() {}
47    bool hasItems() const;
48    void reset();
49    CanonicalForm item() const;
50    void next();
51    void operator++ () { next(); }
52    void operator++ ( int ) { next(); }
53    CFGenerator * clone() const;
54};
55
56class AlgExtGenerator: public CFGenerator
57{
58private:
59    Variable algext;
60    FFGenerator **gensf;
61    GFGenerator **gensg;
62    int n;
63    bool nomoreitems;
64    AlgExtGenerator();
65    AlgExtGenerator( const AlgExtGenerator & );
66    AlgExtGenerator& operator= ( const AlgExtGenerator & );
67public:
68    AlgExtGenerator( const Variable & a );
69    ~AlgExtGenerator();
70
71    bool hasItems() const { return ! nomoreitems; }
72    void reset();
73    CanonicalForm item() const;
74    void next();
75    void operator++ () { next(); }
76    void operator++ ( int ) { next(); }
77    CFGenerator * clone() const;
78};
79
80class CFGenFactory
81{
82public:
83    static CFGenerator* generate();
84};
85
86/*ENDPUBLIC*/
87
88#endif /* ! INCL_CF_GENERATOR_H */
Note: See TracBrowser for help on using the repository browser.