source: git/kernel/old.lplist.h @ fbc7cb

spielwiese
Last change on this file since fbc7cb was a9c298, checked in by Hans Schoenemann <hannes@…>, 10 years ago
format stuff
  • Property mode set to 100644
File size: 2.0 KB
Line 
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4/*
5* ABSTRACT: list interface
6*/
7#include <kernel/lpolynomial.h>
8#ifndef LPLIST_HEADER
9#define LPLIST_HEADER
10
11#ifdef HAVE_F5
12
13
14
15
16
17/*
18=======================
19=======================
20linked lists for LPolys
21=======================
22=======================
23*/
24
25
26
27
28
29
30
31/*
32=================
33classes in a list
34=================
35*/
36class Node;
37class FirstNode;
38class LastNode;
39class GenNode;
40class LpList;
41
42/*
43===================
44abstract Node class
45===================
46*/
47class Node {
48    public:
49        Node() {};
50        virtual         ~Node() {};
51        // the following two functions have to be redefined in FirstNode, LastNode, and GenNode
52        virtual Node*   insert(LPoly* lp) = 0;
53        virtual void    get() = 0;
54};
55
56/*
57========================
58subclass GenNode of Node
59========================
60*/
61class GenNode : public Node {
62    private:
63        LPoly*  data;
64        Node*   next;
65    public:
66        GenNode(LPoly* d, Node* n) : data(d), next(n){};
67        ~GenNode() {
68            delete next;
69            delete data;
70        }
71        Node* insert(LPoly* d);
72        void get();
73};
74
75
76/*
77========================
78subclass EndNode of Node
79========================
80*/
81class EndNode : public Node {
82    public:
83        EndNode() {};
84        ~EndNode() {};
85        Node* insert(LPoly* d);
86        void get();
87};
88
89
90/*
91==========================
92subclass FirstNode of Node
93==========================
94*/
95class FirstNode : public Node {
96    private:
97        Node* next;
98    public:
99        FirstNode() {
100            next = new EndNode;
101        }
102        ~FirstNode() {};
103        Node* insert(LPoly* d);
104        void get();
105};
106
107
108/*
109============
110class LpList
111============
112*/
113class LpList {
114    private:
115        FirstNode *start;
116    public:
117        LpList() {
118            start = new FirstNode;
119        }
120        ~LpList() {
121            delete start;
122        }
123        void insert(LPoly* d);
124        void get();
125};
126
127
128
129#endif
130#endif
131
Note: See TracBrowser for help on using the repository browser.