source: git/factory/cf_generator.h @ e4fe2b

spielwiese
Last change on this file since e4fe2b was e4fe2b, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
FIX: Fixed huge BUG in cf_gmp.h CHG: starting to cleanup factory
  • Property mode set to 100644
File size: 1.8 KB
RevLine 
[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
13class CFGenerator
14{
15public:
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
25class FFGenerator : public CFGenerator
26{
27private:
28    int current;
29public:
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
41class GFGenerator : public CFGenerator
42{
43private:
44    int current;
45public:
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]57class AlgExtGenerator: public CFGenerator
[2dd068]58{
59private:
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 & );
68public:
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
81class CFGenFactory
82{
83public:
84    static CFGenerator* generate();
85};
86
87/*ENDPUBLIC*/
88
[493c477]89#endif /* ! INCL_CF_GENERATOR_H */
Note: See TracBrowser for help on using the repository browser.