source: git/factory/cf_generator.h @ cd86ac

spielwiese
Last change on this file since cd86ac was 493c477, checked in by Jens Schmidt <schmidt@…>, 27 years ago
o header fixed git-svn-id: file:///usr/local/Singular/svn/trunk@404 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.2 1997-06-19 12:27:02 schmidt 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    CFGenerator **gens;
59    int n;
60    bool nomoreitems;
61    AlgExtGenerator();
62    AlgExtGenerator( const AlgExtGenerator & );
63    AlgExtGenerator& operator= ( const AlgExtGenerator & );
64public:
65    AlgExtGenerator( const Variable & a );
66    ~AlgExtGenerator();
67
68    bool hasItems() const { return ! nomoreitems; }
69    void reset();
70    CanonicalForm item() const;
71    void next();
72    void operator++ () { next(); }
73    void operator++ ( int ) { next(); }
74};
75
76class CFGenFactory
77{
78public:
79    static CFGenerator* generate();
80};
81
82/*ENDPUBLIC*/
83
84#endif /* ! INCL_CF_GENERATOR_H */
Note: See TracBrowser for help on using the repository browser.