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

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