1 | /* emacs edit mode for this file is -*- C++ -*- */ |
---|
2 | /* $Id$ */ |
---|
3 | |
---|
4 | #ifndef INCL_CF_GENERATOR_H |
---|
5 | #define INCL_CF_GENERATOR_H |
---|
6 | |
---|
7 | // #include "config.h" |
---|
8 | |
---|
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 | virtual CFGenerator * clone() const { return new CFGenerator();} |
---|
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(); } |
---|
38 | CFGenerator * clone() const; |
---|
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(); } |
---|
54 | CFGenerator * clone() const; |
---|
55 | }; |
---|
56 | |
---|
57 | class AlgExtGenerator: public CFGenerator |
---|
58 | { |
---|
59 | private: |
---|
60 | Variable algext; |
---|
61 | FFGenerator **gensf; |
---|
62 | GFGenerator **gensg; |
---|
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(); } |
---|
78 | CFGenerator * clone() const; |
---|
79 | }; |
---|
80 | |
---|
81 | class CFGenFactory |
---|
82 | { |
---|
83 | public: |
---|
84 | static CFGenerator* generate(); |
---|
85 | }; |
---|
86 | |
---|
87 | /*ENDPUBLIC*/ |
---|
88 | |
---|
89 | #endif /* ! INCL_CF_GENERATOR_H */ |
---|