-
Notifications
You must be signed in to change notification settings - Fork 3
/
generic_doubly_linked_web-generic_list.adb
210 lines (182 loc) · 6.6 KB
/
generic_doubly_linked_web-generic_list.adb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
-- --
-- package Copyright (c) Dmitry A. Kazakov --
-- Generic_Linked_Web. Luebeck --
-- Generic_List Autumn, 2006 --
-- Implementation --
-- Last revision : 10:35 22 Oct 2011 --
-- --
-- This library is free software; you can redistribute it and/or --
-- modify it under the terms of the GNU General Public License as --
-- published by the Free Software Foundation; either version 2 of --
-- the License, or (at your option) any later version. This library --
-- is distributed in the hope that it will be useful, but WITHOUT --
-- ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- General Public License for more details. You should have --
-- received a copy of the GNU General Public License along with --
-- this library; if not, write to the Free Software Foundation, --
-- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from --
-- this unit, or you link this unit with other files to produce an --
-- executable, this unit does not by itself cause the resulting --
-- executable to be covered by the GNU General Public License. This --
-- exception does not however invalidate any other reasons why the --
-- executable file might be covered by the GNU Public License. --
--____________________________________________________________________--
package body Generic_Doubly_Linked_Web.Generic_List is
procedure Append (Container : in out List; Element : Item) is
begin
Append (Brand, Web (Container), Element);
end Append;
procedure Append
( Container : in out List;
Element : Item;
Source : in out List
) is
begin
Append (Brand, Web (Container), Node (Element), Web (Source));
end Append;
procedure Append
( Container : in out List;
Element : Node;
Source : in out List
) is
begin
Append (Brand, Web (Container), Element, Web (Source));
end Append;
procedure Delete
( Container : in out List;
Element : in out Item
) is
begin
Delete (Brand, Container, Node (Element));
end Delete;
procedure Delete
( Container : in out List;
Element : in out Node
) is
begin
Delete (Brand, Web (Container), Element);
end Delete;
procedure Erase (Container : in out List) is
begin
Erase (Brand, Web (Container));
end Erase;
procedure Insert (Position : Item; Element : Item) is
begin
Insert (Brand, Node (Position), Node (Element));
end Insert;
procedure Insert (Position : Node; Element : Item) is
begin
Insert (Brand, Position, Node (Element));
end Insert;
procedure Insert
( Position : Item;
Element : Item;
Source : in out List
) is
begin
Insert (Brand, Node (Position), Node (Element), Web (Source));
end Insert;
procedure Insert
( Position : Item;
Element : Node;
Source : in out List
) is
begin
Insert (Brand, Node (Position), Element, Web (Source));
end Insert;
procedure Insert
( Position : Node;
Element : Item;
Source : in out List
) is
begin
Insert (Brand, Position, Node (Element), Web (Source));
end Insert;
procedure Insert
( Position : Node;
Element : Node;
Source : in out List
) is
begin
Insert (Brand, Position, Element, Web (Source));
end Insert;
function Is_Empty (Container : List) return Boolean is
begin
return Container = null;
end Is_Empty;
function Is_In (Element : Item) return Boolean is
begin
return Is_In (Brand, Element);
end Is_In;
procedure Merge (Head : in out List; Tail : in out List) is
begin
Merge (Brand, Head, Tail);
end Merge;
function Next (Element : Item) return Item is
begin
return Item (Next (Brand, Element));
end Next;
function Next (Container : List) return Item is
begin
return Item (Next (Brand, Node (Container)));
end Next;
procedure Prepend (Container : in out List; Element : Item) is
begin
Prepend (Brand, Web (Container), Element);
end Prepend;
procedure Prepend
( Container : in out List;
Element : Item;
Source : in out List
) is
begin
Prepend (Brand, Web (Container), Node (Element), Web (Source));
end Prepend;
procedure Prepend
( Container : in out List;
Element : Node;
Source : in out List
) is
begin
Prepend (Brand, Web (Container), Element, Web (Source));
end Prepend;
function Previous (Element : Item) return Item is
begin
return Item (Previous (Brand, Element));
end Previous;
function Previous (Container : List) return Item is
begin
return Item (Previous (Brand, Node (Container)));
end Previous;
procedure Remove
( Container : in out List;
Element : Item
) is
begin
Remove (Brand, Web (Container), Element);
end Remove;
procedure Remove
( Container : in out List;
Element : Node
) is
begin
Remove (Brand, Web (Container), Element);
end Remove;
procedure Take
( Container : in out List;
Element : out Item
) is
begin
Take (Brand, Web (Container), Element);
end Take;
procedure Take
( Container : in out List;
Element : out Node
) is
begin
Take (Brand, Web (Container), Element);
end Take;
end Generic_Doubly_Linked_Web.Generic_List;