[493c477] | 1 | /* emacs edit mode for this file is -*- C++ -*- */ |
---|
[b96e07] | 2 | /* $Id: cf_generator.h,v 1.3 2004-12-10 10:14:46 Singular Exp $ */ |
---|
[2dd068] | 3 | |
---|
| 4 | #ifndef INCL_CF_GENERATOR_H |
---|
| 5 | #define INCL_CF_GENERATOR_H |
---|
| 6 | |
---|
[ab4548f] | 7 | #include <config.h> |
---|
| 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() {}; |
---|
| 22 | }; |
---|
| 23 | |
---|
| 24 | class FFGenerator : public CFGenerator |
---|
| 25 | { |
---|
| 26 | private: |
---|
| 27 | int current; |
---|
| 28 | public: |
---|
| 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 | }; |
---|
| 38 | |
---|
| 39 | class GFGenerator : public CFGenerator |
---|
| 40 | { |
---|
| 41 | private: |
---|
| 42 | int current; |
---|
| 43 | public: |
---|
| 44 | GFGenerator(); |
---|
| 45 | ~GFGenerator() {} |
---|
| 46 | bool hasItems() const; |
---|
| 47 | void reset(); |
---|
| 48 | CanonicalForm item() const; |
---|
| 49 | void next(); |
---|
| 50 | void operator++ () { next(); } |
---|
| 51 | void operator++ ( int ) { next(); } |
---|
| 52 | }; |
---|
| 53 | |
---|
[b96e07] | 54 | class AlgExtGenerator //??? : public CFGenerator |
---|
[2dd068] | 55 | { |
---|
| 56 | private: |
---|
| 57 | Variable algext; |
---|
[b96e07] | 58 | FFGenerator **gensf; |
---|
| 59 | GFGenerator **gensg; |
---|
[2dd068] | 60 | int n; |
---|
| 61 | bool nomoreitems; |
---|
| 62 | AlgExtGenerator(); |
---|
| 63 | AlgExtGenerator( const AlgExtGenerator & ); |
---|
| 64 | AlgExtGenerator& operator= ( const AlgExtGenerator & ); |
---|
| 65 | public: |
---|
| 66 | AlgExtGenerator( const Variable & a ); |
---|
| 67 | ~AlgExtGenerator(); |
---|
| 68 | |
---|
| 69 | bool hasItems() const { return ! nomoreitems; } |
---|
| 70 | void reset(); |
---|
| 71 | CanonicalForm item() const; |
---|
| 72 | void next(); |
---|
| 73 | void operator++ () { next(); } |
---|
| 74 | void operator++ ( int ) { next(); } |
---|
| 75 | }; |
---|
| 76 | |
---|
| 77 | class CFGenFactory |
---|
| 78 | { |
---|
| 79 | public: |
---|
| 80 | static CFGenerator* generate(); |
---|
| 81 | }; |
---|
| 82 | |
---|
| 83 | /*ENDPUBLIC*/ |
---|
| 84 | |
---|
[493c477] | 85 | #endif /* ! INCL_CF_GENERATOR_H */ |
---|