source: git/factory/cf_generator.h @ b96e07

spielwiese
Last change on this file since b96e07 was b96e07, checked in by Hans Schönemann <hannes@…>, 19 years ago
*pohl: AlgExtGenerator etc. git-svn-id: file:///usr/local/Singular/svn/trunk@7622 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.7 KB
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2/* $Id: cf_generator.h,v 1.3 2004-12-10 10:14:46 Singular Exp $ */
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};
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(); }
37};
38
39class GFGenerator : public CFGenerator
40{
41private:
42    int current;
43public:
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
54class AlgExtGenerator //??? : public CFGenerator
55{
56private:
57    Variable algext;
58    FFGenerator **gensf;
59    GFGenerator **gensg;
60    int n;
61    bool nomoreitems;
62    AlgExtGenerator();
63    AlgExtGenerator( const AlgExtGenerator & );
64    AlgExtGenerator& operator= ( const AlgExtGenerator & );
65public:
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
77class CFGenFactory
78{
79public:
80    static CFGenerator* generate();
81};
82
83/*ENDPUBLIC*/
84
85#endif /* ! INCL_CF_GENERATOR_H */
Note: See TracBrowser for help on using the repository browser.