[493c477] | 1 | /* emacs edit mode for this file is -*- C++ -*- */ |
---|
[341696] | 2 | /* $Id$ */ |
---|
[2dd068] | 3 | |
---|
| 4 | #ifndef INCL_CF_GENERATOR_H |
---|
| 5 | #define INCL_CF_GENERATOR_H |
---|
| 6 | |
---|
[e4fe2b] | 7 | // #include "config.h" |
---|
[ab4548f] | 8 | |
---|
[2dd068] | 9 | #include "canonicalform.h" |
---|
| 10 | |
---|
| 11 | /*BEGINPUBLIC*/ |
---|
| 12 | |
---|
| 13 | class CFGenerator |
---|
| 14 | { |
---|
| 15 | public: |
---|
| 16 | CFGenerator() {} |
---|
| 17 | virtual ~CFGenerator() {} |
---|
| 18 | virtual bool hasItems() const { return false; } |
---|
| 19 | virtual void reset() {}; |
---|
| 20 | virtual CanonicalForm item() const { return 0; } |
---|
| 21 | virtual void next() {}; |
---|
[99ffd8] | 22 | virtual CFGenerator * clone() const { return new CFGenerator();} |
---|
[2dd068] | 23 | }; |
---|
| 24 | |
---|
| 25 | class FFGenerator : public CFGenerator |
---|
| 26 | { |
---|
| 27 | private: |
---|
| 28 | int current; |
---|
| 29 | public: |
---|
| 30 | FFGenerator() : current(0) {} |
---|
| 31 | ~FFGenerator() {} |
---|
| 32 | bool hasItems() const; |
---|
| 33 | void reset() { current = 0; } |
---|
| 34 | CanonicalForm item() const; |
---|
| 35 | void next(); |
---|
| 36 | void operator++ () { next(); } |
---|
| 37 | void operator++ ( int ) { next(); } |
---|
[99ffd8] | 38 | CFGenerator * clone() const; |
---|
[2dd068] | 39 | }; |
---|
| 40 | |
---|
| 41 | class GFGenerator : public CFGenerator |
---|
| 42 | { |
---|
| 43 | private: |
---|
| 44 | int current; |
---|
| 45 | public: |
---|
| 46 | GFGenerator(); |
---|
| 47 | ~GFGenerator() {} |
---|
| 48 | bool hasItems() const; |
---|
| 49 | void reset(); |
---|
| 50 | CanonicalForm item() const; |
---|
| 51 | void next(); |
---|
| 52 | void operator++ () { next(); } |
---|
| 53 | void operator++ ( int ) { next(); } |
---|
[99ffd8] | 54 | CFGenerator * clone() const; |
---|
[2dd068] | 55 | }; |
---|
| 56 | |
---|
[99ffd8] | 57 | class AlgExtGenerator: public CFGenerator |
---|
[2dd068] | 58 | { |
---|
| 59 | private: |
---|
| 60 | Variable algext; |
---|
[b96e07] | 61 | FFGenerator **gensf; |
---|
| 62 | GFGenerator **gensg; |
---|
[2dd068] | 63 | int n; |
---|
| 64 | bool nomoreitems; |
---|
| 65 | AlgExtGenerator(); |
---|
| 66 | AlgExtGenerator( const AlgExtGenerator & ); |
---|
| 67 | AlgExtGenerator& operator= ( const AlgExtGenerator & ); |
---|
| 68 | public: |
---|
| 69 | AlgExtGenerator( const Variable & a ); |
---|
| 70 | ~AlgExtGenerator(); |
---|
| 71 | |
---|
| 72 | bool hasItems() const { return ! nomoreitems; } |
---|
| 73 | void reset(); |
---|
| 74 | CanonicalForm item() const; |
---|
| 75 | void next(); |
---|
| 76 | void operator++ () { next(); } |
---|
| 77 | void operator++ ( int ) { next(); } |
---|
[99ffd8] | 78 | CFGenerator * clone() const; |
---|
[2dd068] | 79 | }; |
---|
| 80 | |
---|
| 81 | class CFGenFactory |
---|
| 82 | { |
---|
| 83 | public: |
---|
| 84 | static CFGenerator* generate(); |
---|
| 85 | }; |
---|
| 86 | |
---|
| 87 | /*ENDPUBLIC*/ |
---|
| 88 | |
---|
[493c477] | 89 | #endif /* ! INCL_CF_GENERATOR_H */ |
---|