fieker-DuValspielwiese
Last change
on this file since d894371 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 | ======================= |
---|
21 | linked lists for LPolys |
---|
22 | ======================= |
---|
23 | ======================= |
---|
24 | */ |
---|
25 | |
---|
26 | |
---|
27 | |
---|
28 | |
---|
29 | |
---|
30 | |
---|
31 | |
---|
32 | /* |
---|
33 | ================= |
---|
34 | classes in a list |
---|
35 | ================= |
---|
36 | */ |
---|
37 | class Node; |
---|
38 | class FirstNode; |
---|
39 | class LastNode; |
---|
40 | class GenNode; |
---|
41 | class LpList; |
---|
42 | |
---|
43 | /* |
---|
44 | =================== |
---|
45 | abstract Node class |
---|
46 | =================== |
---|
47 | */ |
---|
48 | class 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 | ======================== |
---|
59 | subclass GenNode of Node |
---|
60 | ======================== |
---|
61 | */ |
---|
62 | class 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 | ======================== |
---|
79 | subclass EndNode of Node |
---|
80 | ======================== |
---|
81 | */ |
---|
82 | class EndNode : public Node { |
---|
83 | public: |
---|
84 | EndNode() {}; |
---|
85 | ~EndNode() {}; |
---|
86 | Node* insert(LPoly* d); |
---|
87 | void get(); |
---|
88 | }; |
---|
89 | |
---|
90 | |
---|
91 | /* |
---|
92 | ========================== |
---|
93 | subclass FirstNode of Node |
---|
94 | ========================== |
---|
95 | */ |
---|
96 | class 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 | ============ |
---|
111 | class LpList |
---|
112 | ============ |
---|
113 | */ |
---|
114 | class 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.