source: git/factory/cf_generator.h @ 362fc67

spielwiese
Last change on this file since 362fc67 was 362fc67, checked in by Martin Lee <martinlee84@…>, 12 years ago
chg: remove $Id$
  • Property mode set to 100644
File size: 1.8 KB
RevLine 
[493c477]1/* emacs edit mode for this file is -*- C++ -*- */
[2dd068]2
3#ifndef INCL_CF_GENERATOR_H
4#define INCL_CF_GENERATOR_H
5
[e4fe2b]6// #include "config.h"
[ab4548f]7
[2dd068]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() {};
[99ffd8]21    virtual CFGenerator * clone() const { return new CFGenerator();}
[2dd068]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(); }
[99ffd8]37    CFGenerator * clone() const;
[2dd068]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(); }
[99ffd8]53    CFGenerator * clone() const;
[2dd068]54};
55
[99ffd8]56class AlgExtGenerator: public CFGenerator
[2dd068]57{
58private:
59    Variable algext;
[b96e07]60    FFGenerator **gensf;
61    GFGenerator **gensg;
[2dd068]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(); }
[99ffd8]77    CFGenerator * clone() const;
[2dd068]78};
79
80class CFGenFactory
81{
82public:
83    static CFGenerator* generate();
84};
85
86/*ENDPUBLIC*/
87
[493c477]88#endif /* ! INCL_CF_GENERATOR_H */
Note: See TracBrowser for help on using the repository browser.