source: git/factory/cf_generator.h @ a52291

spielwiese
Last change on this file since a52291 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
Line 
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
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() {};
22    virtual CFGenerator * clone() const { return new CFGenerator();}
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(); }
38    CFGenerator * clone() const;
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(); }
54    CFGenerator * clone() const;
55};
56
57class AlgExtGenerator: public CFGenerator
58{
59private:
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 & );
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(); }
78    CFGenerator * clone() const;
79};
80
81class CFGenFactory
82{
83public:
84    static CFGenerator* generate();
85};
86
87/*ENDPUBLIC*/
88
89#endif /* ! INCL_CF_GENERATOR_H */
Note: See TracBrowser for help on using the repository browser.