annotate gcc/ada/libgnat/a-cbmutr.ads @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ------------------------------------------------------------------------------
kono
parents:
diff changeset
2 -- --
kono
parents:
diff changeset
3 -- GNAT LIBRARY COMPONENTS --
kono
parents:
diff changeset
4 -- --
kono
parents:
diff changeset
5 -- ADA.CONTAINERS.BOUNDED_MULTIWAY_TREES --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
kono
parents:
diff changeset
9 -- Copyright (C) 2014-2017, Free Software Foundation, Inc. --
kono
parents:
diff changeset
10 -- --
kono
parents:
diff changeset
11 -- This specification is derived from the Ada Reference Manual for use with --
kono
parents:
diff changeset
12 -- GNAT. The copyright notice above, and the license provisions that follow --
kono
parents:
diff changeset
13 -- apply solely to the contents of the part following the private keyword. --
kono
parents:
diff changeset
14 -- --
kono
parents:
diff changeset
15 -- GNAT is free software; you can redistribute it and/or modify it under --
kono
parents:
diff changeset
16 -- terms of the GNU General Public License as published by the Free Soft- --
kono
parents:
diff changeset
17 -- ware Foundation; either version 3, or (at your option) any later ver- --
kono
parents:
diff changeset
18 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
kono
parents:
diff changeset
19 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
kono
parents:
diff changeset
20 -- or FITNESS FOR A PARTICULAR PURPOSE. --
kono
parents:
diff changeset
21 -- --
kono
parents:
diff changeset
22 -- As a special exception under Section 7 of GPL version 3, you are granted --
kono
parents:
diff changeset
23 -- additional permissions described in the GCC Runtime Library Exception, --
kono
parents:
diff changeset
24 -- version 3.1, as published by the Free Software Foundation. --
kono
parents:
diff changeset
25 -- --
kono
parents:
diff changeset
26 -- You should have received a copy of the GNU General Public License and --
kono
parents:
diff changeset
27 -- a copy of the GCC Runtime Library Exception along with this program; --
kono
parents:
diff changeset
28 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
kono
parents:
diff changeset
29 -- <http://www.gnu.org/licenses/>. --
kono
parents:
diff changeset
30 -- --
kono
parents:
diff changeset
31 -- This unit was originally developed by Matthew J Heaney. --
kono
parents:
diff changeset
32 ------------------------------------------------------------------------------
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 with Ada.Iterator_Interfaces;
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 with Ada.Containers.Helpers;
kono
parents:
diff changeset
37 private with Ada.Streams;
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 generic
kono
parents:
diff changeset
40 type Element_Type is private;
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 with function "=" (Left, Right : Element_Type) return Boolean is <>;
kono
parents:
diff changeset
43
kono
parents:
diff changeset
44 package Ada.Containers.Bounded_Multiway_Trees is
kono
parents:
diff changeset
45 pragma Annotate (CodePeer, Skip_Analysis);
kono
parents:
diff changeset
46 pragma Pure;
kono
parents:
diff changeset
47 pragma Remote_Types;
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 type Tree (Capacity : Count_Type) is tagged private
kono
parents:
diff changeset
50 with Constant_Indexing => Constant_Reference,
kono
parents:
diff changeset
51 Variable_Indexing => Reference,
kono
parents:
diff changeset
52 Default_Iterator => Iterate,
kono
parents:
diff changeset
53 Iterator_Element => Element_Type;
kono
parents:
diff changeset
54 pragma Preelaborable_Initialization (Tree);
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 type Cursor is private;
kono
parents:
diff changeset
57 pragma Preelaborable_Initialization (Cursor);
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 Empty_Tree : constant Tree;
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 No_Element : constant Cursor;
kono
parents:
diff changeset
62 function Has_Element (Position : Cursor) return Boolean;
kono
parents:
diff changeset
63
kono
parents:
diff changeset
64 package Tree_Iterator_Interfaces is new
kono
parents:
diff changeset
65 Ada.Iterator_Interfaces (Cursor, Has_Element);
kono
parents:
diff changeset
66
kono
parents:
diff changeset
67 function Equal_Subtree
kono
parents:
diff changeset
68 (Left_Position : Cursor;
kono
parents:
diff changeset
69 Right_Position : Cursor) return Boolean;
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 function "=" (Left, Right : Tree) return Boolean;
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73 function Is_Empty (Container : Tree) return Boolean;
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 function Node_Count (Container : Tree) return Count_Type;
kono
parents:
diff changeset
76
kono
parents:
diff changeset
77 function Subtree_Node_Count (Position : Cursor) return Count_Type;
kono
parents:
diff changeset
78
kono
parents:
diff changeset
79 function Depth (Position : Cursor) return Count_Type;
kono
parents:
diff changeset
80
kono
parents:
diff changeset
81 function Is_Root (Position : Cursor) return Boolean;
kono
parents:
diff changeset
82
kono
parents:
diff changeset
83 function Is_Leaf (Position : Cursor) return Boolean;
kono
parents:
diff changeset
84
kono
parents:
diff changeset
85 function Root (Container : Tree) return Cursor;
kono
parents:
diff changeset
86
kono
parents:
diff changeset
87 procedure Clear (Container : in out Tree);
kono
parents:
diff changeset
88
kono
parents:
diff changeset
89 function Element (Position : Cursor) return Element_Type;
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 procedure Replace_Element
kono
parents:
diff changeset
92 (Container : in out Tree;
kono
parents:
diff changeset
93 Position : Cursor;
kono
parents:
diff changeset
94 New_Item : Element_Type);
kono
parents:
diff changeset
95
kono
parents:
diff changeset
96 procedure Query_Element
kono
parents:
diff changeset
97 (Position : Cursor;
kono
parents:
diff changeset
98 Process : not null access procedure (Element : Element_Type));
kono
parents:
diff changeset
99
kono
parents:
diff changeset
100 procedure Update_Element
kono
parents:
diff changeset
101 (Container : in out Tree;
kono
parents:
diff changeset
102 Position : Cursor;
kono
parents:
diff changeset
103 Process : not null access procedure (Element : in out Element_Type));
kono
parents:
diff changeset
104
kono
parents:
diff changeset
105 type Constant_Reference_Type
kono
parents:
diff changeset
106 (Element : not null access constant Element_Type) is private
kono
parents:
diff changeset
107 with Implicit_Dereference => Element;
kono
parents:
diff changeset
108
kono
parents:
diff changeset
109 type Reference_Type
kono
parents:
diff changeset
110 (Element : not null access Element_Type) is private
kono
parents:
diff changeset
111 with Implicit_Dereference => Element;
kono
parents:
diff changeset
112
kono
parents:
diff changeset
113 function Constant_Reference
kono
parents:
diff changeset
114 (Container : aliased Tree;
kono
parents:
diff changeset
115 Position : Cursor) return Constant_Reference_Type;
kono
parents:
diff changeset
116
kono
parents:
diff changeset
117 function Reference
kono
parents:
diff changeset
118 (Container : aliased in out Tree;
kono
parents:
diff changeset
119 Position : Cursor) return Reference_Type;
kono
parents:
diff changeset
120
kono
parents:
diff changeset
121 procedure Assign (Target : in out Tree; Source : Tree);
kono
parents:
diff changeset
122
kono
parents:
diff changeset
123 function Copy (Source : Tree; Capacity : Count_Type := 0) return Tree;
kono
parents:
diff changeset
124
kono
parents:
diff changeset
125 procedure Move (Target : in out Tree; Source : in out Tree);
kono
parents:
diff changeset
126
kono
parents:
diff changeset
127 procedure Delete_Leaf
kono
parents:
diff changeset
128 (Container : in out Tree;
kono
parents:
diff changeset
129 Position : in out Cursor);
kono
parents:
diff changeset
130
kono
parents:
diff changeset
131 procedure Delete_Subtree
kono
parents:
diff changeset
132 (Container : in out Tree;
kono
parents:
diff changeset
133 Position : in out Cursor);
kono
parents:
diff changeset
134
kono
parents:
diff changeset
135 procedure Swap
kono
parents:
diff changeset
136 (Container : in out Tree;
kono
parents:
diff changeset
137 I, J : Cursor);
kono
parents:
diff changeset
138
kono
parents:
diff changeset
139 function Find
kono
parents:
diff changeset
140 (Container : Tree;
kono
parents:
diff changeset
141 Item : Element_Type) return Cursor;
kono
parents:
diff changeset
142
kono
parents:
diff changeset
143 function Find_In_Subtree
kono
parents:
diff changeset
144 (Position : Cursor;
kono
parents:
diff changeset
145 Item : Element_Type) return Cursor;
kono
parents:
diff changeset
146
kono
parents:
diff changeset
147 function Ancestor_Find
kono
parents:
diff changeset
148 (Position : Cursor;
kono
parents:
diff changeset
149 Item : Element_Type) return Cursor;
kono
parents:
diff changeset
150
kono
parents:
diff changeset
151 function Contains
kono
parents:
diff changeset
152 (Container : Tree;
kono
parents:
diff changeset
153 Item : Element_Type) return Boolean;
kono
parents:
diff changeset
154
kono
parents:
diff changeset
155 procedure Iterate
kono
parents:
diff changeset
156 (Container : Tree;
kono
parents:
diff changeset
157 Process : not null access procedure (Position : Cursor));
kono
parents:
diff changeset
158
kono
parents:
diff changeset
159 procedure Iterate_Subtree
kono
parents:
diff changeset
160 (Position : Cursor;
kono
parents:
diff changeset
161 Process : not null access procedure (Position : Cursor));
kono
parents:
diff changeset
162
kono
parents:
diff changeset
163 function Iterate (Container : Tree)
kono
parents:
diff changeset
164 return Tree_Iterator_Interfaces.Forward_Iterator'Class;
kono
parents:
diff changeset
165
kono
parents:
diff changeset
166 function Iterate_Subtree (Position : Cursor)
kono
parents:
diff changeset
167 return Tree_Iterator_Interfaces.Forward_Iterator'Class;
kono
parents:
diff changeset
168
kono
parents:
diff changeset
169 function Iterate_Children
kono
parents:
diff changeset
170 (Container : Tree;
kono
parents:
diff changeset
171 Parent : Cursor)
kono
parents:
diff changeset
172 return Tree_Iterator_Interfaces.Reversible_Iterator'Class;
kono
parents:
diff changeset
173
kono
parents:
diff changeset
174 function Child_Count (Parent : Cursor) return Count_Type;
kono
parents:
diff changeset
175
kono
parents:
diff changeset
176 function Child_Depth (Parent, Child : Cursor) return Count_Type;
kono
parents:
diff changeset
177
kono
parents:
diff changeset
178 procedure Insert_Child
kono
parents:
diff changeset
179 (Container : in out Tree;
kono
parents:
diff changeset
180 Parent : Cursor;
kono
parents:
diff changeset
181 Before : Cursor;
kono
parents:
diff changeset
182 New_Item : Element_Type;
kono
parents:
diff changeset
183 Count : Count_Type := 1);
kono
parents:
diff changeset
184
kono
parents:
diff changeset
185 procedure Insert_Child
kono
parents:
diff changeset
186 (Container : in out Tree;
kono
parents:
diff changeset
187 Parent : Cursor;
kono
parents:
diff changeset
188 Before : Cursor;
kono
parents:
diff changeset
189 New_Item : Element_Type;
kono
parents:
diff changeset
190 Position : out Cursor;
kono
parents:
diff changeset
191 Count : Count_Type := 1);
kono
parents:
diff changeset
192
kono
parents:
diff changeset
193 procedure Insert_Child
kono
parents:
diff changeset
194 (Container : in out Tree;
kono
parents:
diff changeset
195 Parent : Cursor;
kono
parents:
diff changeset
196 Before : Cursor;
kono
parents:
diff changeset
197 Position : out Cursor;
kono
parents:
diff changeset
198 Count : Count_Type := 1);
kono
parents:
diff changeset
199
kono
parents:
diff changeset
200 procedure Prepend_Child
kono
parents:
diff changeset
201 (Container : in out Tree;
kono
parents:
diff changeset
202 Parent : Cursor;
kono
parents:
diff changeset
203 New_Item : Element_Type;
kono
parents:
diff changeset
204 Count : Count_Type := 1);
kono
parents:
diff changeset
205
kono
parents:
diff changeset
206 procedure Append_Child
kono
parents:
diff changeset
207 (Container : in out Tree;
kono
parents:
diff changeset
208 Parent : Cursor;
kono
parents:
diff changeset
209 New_Item : Element_Type;
kono
parents:
diff changeset
210 Count : Count_Type := 1);
kono
parents:
diff changeset
211
kono
parents:
diff changeset
212 procedure Delete_Children
kono
parents:
diff changeset
213 (Container : in out Tree;
kono
parents:
diff changeset
214 Parent : Cursor);
kono
parents:
diff changeset
215
kono
parents:
diff changeset
216 procedure Copy_Subtree
kono
parents:
diff changeset
217 (Target : in out Tree;
kono
parents:
diff changeset
218 Parent : Cursor;
kono
parents:
diff changeset
219 Before : Cursor;
kono
parents:
diff changeset
220 Source : Cursor);
kono
parents:
diff changeset
221
kono
parents:
diff changeset
222 procedure Splice_Subtree
kono
parents:
diff changeset
223 (Target : in out Tree;
kono
parents:
diff changeset
224 Parent : Cursor;
kono
parents:
diff changeset
225 Before : Cursor;
kono
parents:
diff changeset
226 Source : in out Tree;
kono
parents:
diff changeset
227 Position : in out Cursor);
kono
parents:
diff changeset
228
kono
parents:
diff changeset
229 procedure Splice_Subtree
kono
parents:
diff changeset
230 (Container : in out Tree;
kono
parents:
diff changeset
231 Parent : Cursor;
kono
parents:
diff changeset
232 Before : Cursor;
kono
parents:
diff changeset
233 Position : Cursor);
kono
parents:
diff changeset
234
kono
parents:
diff changeset
235 procedure Splice_Children
kono
parents:
diff changeset
236 (Target : in out Tree;
kono
parents:
diff changeset
237 Target_Parent : Cursor;
kono
parents:
diff changeset
238 Before : Cursor;
kono
parents:
diff changeset
239 Source : in out Tree;
kono
parents:
diff changeset
240 Source_Parent : Cursor);
kono
parents:
diff changeset
241
kono
parents:
diff changeset
242 procedure Splice_Children
kono
parents:
diff changeset
243 (Container : in out Tree;
kono
parents:
diff changeset
244 Target_Parent : Cursor;
kono
parents:
diff changeset
245 Before : Cursor;
kono
parents:
diff changeset
246 Source_Parent : Cursor);
kono
parents:
diff changeset
247
kono
parents:
diff changeset
248 function Parent (Position : Cursor) return Cursor;
kono
parents:
diff changeset
249
kono
parents:
diff changeset
250 function First_Child (Parent : Cursor) return Cursor;
kono
parents:
diff changeset
251
kono
parents:
diff changeset
252 function First_Child_Element (Parent : Cursor) return Element_Type;
kono
parents:
diff changeset
253
kono
parents:
diff changeset
254 function Last_Child (Parent : Cursor) return Cursor;
kono
parents:
diff changeset
255
kono
parents:
diff changeset
256 function Last_Child_Element (Parent : Cursor) return Element_Type;
kono
parents:
diff changeset
257
kono
parents:
diff changeset
258 function Next_Sibling (Position : Cursor) return Cursor;
kono
parents:
diff changeset
259
kono
parents:
diff changeset
260 function Previous_Sibling (Position : Cursor) return Cursor;
kono
parents:
diff changeset
261
kono
parents:
diff changeset
262 procedure Next_Sibling (Position : in out Cursor);
kono
parents:
diff changeset
263
kono
parents:
diff changeset
264 procedure Previous_Sibling (Position : in out Cursor);
kono
parents:
diff changeset
265
kono
parents:
diff changeset
266 procedure Iterate_Children
kono
parents:
diff changeset
267 (Parent : Cursor;
kono
parents:
diff changeset
268 Process : not null access procedure (Position : Cursor));
kono
parents:
diff changeset
269
kono
parents:
diff changeset
270 procedure Reverse_Iterate_Children
kono
parents:
diff changeset
271 (Parent : Cursor;
kono
parents:
diff changeset
272 Process : not null access procedure (Position : Cursor));
kono
parents:
diff changeset
273
kono
parents:
diff changeset
274 private
kono
parents:
diff changeset
275
kono
parents:
diff changeset
276 use Ada.Containers.Helpers;
kono
parents:
diff changeset
277 package Implementation is new Generic_Implementation;
kono
parents:
diff changeset
278 use Implementation;
kono
parents:
diff changeset
279
kono
parents:
diff changeset
280 use Ada.Streams;
kono
parents:
diff changeset
281
kono
parents:
diff changeset
282 No_Node : constant Count_Type'Base := -1;
kono
parents:
diff changeset
283 -- Need to document all global declarations such as this ???
kono
parents:
diff changeset
284
kono
parents:
diff changeset
285 -- Following decls also need much more documentation ???
kono
parents:
diff changeset
286
kono
parents:
diff changeset
287 type Children_Type is record
kono
parents:
diff changeset
288 First : Count_Type'Base;
kono
parents:
diff changeset
289 Last : Count_Type'Base;
kono
parents:
diff changeset
290 end record;
kono
parents:
diff changeset
291
kono
parents:
diff changeset
292 type Tree_Node_Type is record
kono
parents:
diff changeset
293 Parent : Count_Type'Base;
kono
parents:
diff changeset
294 Prev : Count_Type'Base;
kono
parents:
diff changeset
295 Next : Count_Type'Base;
kono
parents:
diff changeset
296 Children : Children_Type;
kono
parents:
diff changeset
297 end record;
kono
parents:
diff changeset
298
kono
parents:
diff changeset
299 type Tree_Node_Array is array (Count_Type range <>) of Tree_Node_Type;
kono
parents:
diff changeset
300 type Element_Array is array (Count_Type range <>) of aliased Element_Type;
kono
parents:
diff changeset
301
kono
parents:
diff changeset
302 type Tree (Capacity : Count_Type) is tagged record
kono
parents:
diff changeset
303 Nodes : Tree_Node_Array (0 .. Capacity) := (others => <>);
kono
parents:
diff changeset
304 Elements : Element_Array (1 .. Capacity) := (others => <>);
kono
parents:
diff changeset
305 Free : Count_Type'Base := No_Node;
kono
parents:
diff changeset
306 TC : aliased Tamper_Counts;
kono
parents:
diff changeset
307 Count : Count_Type := 0;
kono
parents:
diff changeset
308 end record;
kono
parents:
diff changeset
309
kono
parents:
diff changeset
310 procedure Write
kono
parents:
diff changeset
311 (Stream : not null access Root_Stream_Type'Class;
kono
parents:
diff changeset
312 Container : Tree);
kono
parents:
diff changeset
313
kono
parents:
diff changeset
314 for Tree'Write use Write;
kono
parents:
diff changeset
315
kono
parents:
diff changeset
316 procedure Read
kono
parents:
diff changeset
317 (Stream : not null access Root_Stream_Type'Class;
kono
parents:
diff changeset
318 Container : out Tree);
kono
parents:
diff changeset
319
kono
parents:
diff changeset
320 for Tree'Read use Read;
kono
parents:
diff changeset
321
kono
parents:
diff changeset
322 type Tree_Access is access all Tree;
kono
parents:
diff changeset
323 for Tree_Access'Storage_Size use 0;
kono
parents:
diff changeset
324
kono
parents:
diff changeset
325 type Cursor is record
kono
parents:
diff changeset
326 Container : Tree_Access;
kono
parents:
diff changeset
327 Node : Count_Type'Base := No_Node;
kono
parents:
diff changeset
328 end record;
kono
parents:
diff changeset
329
kono
parents:
diff changeset
330 procedure Read
kono
parents:
diff changeset
331 (Stream : not null access Root_Stream_Type'Class;
kono
parents:
diff changeset
332 Position : out Cursor);
kono
parents:
diff changeset
333 for Cursor'Read use Read;
kono
parents:
diff changeset
334
kono
parents:
diff changeset
335 procedure Write
kono
parents:
diff changeset
336 (Stream : not null access Root_Stream_Type'Class;
kono
parents:
diff changeset
337 Position : Cursor);
kono
parents:
diff changeset
338 for Cursor'Write use Write;
kono
parents:
diff changeset
339
kono
parents:
diff changeset
340 subtype Reference_Control_Type is Implementation.Reference_Control_Type;
kono
parents:
diff changeset
341 -- It is necessary to rename this here, so that the compiler can find it
kono
parents:
diff changeset
342
kono
parents:
diff changeset
343 type Constant_Reference_Type
kono
parents:
diff changeset
344 (Element : not null access constant Element_Type) is
kono
parents:
diff changeset
345 record
kono
parents:
diff changeset
346 Control : Reference_Control_Type :=
kono
parents:
diff changeset
347 raise Program_Error with "uninitialized reference";
kono
parents:
diff changeset
348 -- The RM says, "The default initialization of an object of
kono
parents:
diff changeset
349 -- type Constant_Reference_Type or Reference_Type propagates
kono
parents:
diff changeset
350 -- Program_Error."
kono
parents:
diff changeset
351 end record;
kono
parents:
diff changeset
352
kono
parents:
diff changeset
353 procedure Write
kono
parents:
diff changeset
354 (Stream : not null access Root_Stream_Type'Class;
kono
parents:
diff changeset
355 Item : Constant_Reference_Type);
kono
parents:
diff changeset
356 for Constant_Reference_Type'Write use Write;
kono
parents:
diff changeset
357
kono
parents:
diff changeset
358 procedure Read
kono
parents:
diff changeset
359 (Stream : not null access Root_Stream_Type'Class;
kono
parents:
diff changeset
360 Item : out Constant_Reference_Type);
kono
parents:
diff changeset
361 for Constant_Reference_Type'Read use Read;
kono
parents:
diff changeset
362
kono
parents:
diff changeset
363 type Reference_Type
kono
parents:
diff changeset
364 (Element : not null access Element_Type) is
kono
parents:
diff changeset
365 record
kono
parents:
diff changeset
366 Control : Reference_Control_Type :=
kono
parents:
diff changeset
367 raise Program_Error with "uninitialized reference";
kono
parents:
diff changeset
368 -- The RM says, "The default initialization of an object of
kono
parents:
diff changeset
369 -- type Constant_Reference_Type or Reference_Type propagates
kono
parents:
diff changeset
370 -- Program_Error."
kono
parents:
diff changeset
371 end record;
kono
parents:
diff changeset
372
kono
parents:
diff changeset
373 procedure Write
kono
parents:
diff changeset
374 (Stream : not null access Root_Stream_Type'Class;
kono
parents:
diff changeset
375 Item : Reference_Type);
kono
parents:
diff changeset
376 for Reference_Type'Write use Write;
kono
parents:
diff changeset
377
kono
parents:
diff changeset
378 procedure Read
kono
parents:
diff changeset
379 (Stream : not null access Root_Stream_Type'Class;
kono
parents:
diff changeset
380 Item : out Reference_Type);
kono
parents:
diff changeset
381 for Reference_Type'Read use Read;
kono
parents:
diff changeset
382
kono
parents:
diff changeset
383 -- Three operations are used to optimize in the expansion of "for ... of"
kono
parents:
diff changeset
384 -- loops: the Next(Cursor) procedure in the visible part, and the following
kono
parents:
diff changeset
385 -- Pseudo_Reference and Get_Element_Access functions. See Exp_Ch5 for
kono
parents:
diff changeset
386 -- details.
kono
parents:
diff changeset
387
kono
parents:
diff changeset
388 function Pseudo_Reference
kono
parents:
diff changeset
389 (Container : aliased Tree'Class) return Reference_Control_Type;
kono
parents:
diff changeset
390 pragma Inline (Pseudo_Reference);
kono
parents:
diff changeset
391 -- Creates an object of type Reference_Control_Type pointing to the
kono
parents:
diff changeset
392 -- container, and increments the Lock. Finalization of this object will
kono
parents:
diff changeset
393 -- decrement the Lock.
kono
parents:
diff changeset
394
kono
parents:
diff changeset
395 type Element_Access is access all Element_Type with
kono
parents:
diff changeset
396 Storage_Size => 0;
kono
parents:
diff changeset
397
kono
parents:
diff changeset
398 function Get_Element_Access
kono
parents:
diff changeset
399 (Position : Cursor) return not null Element_Access;
kono
parents:
diff changeset
400 -- Returns a pointer to the element designated by Position.
kono
parents:
diff changeset
401
kono
parents:
diff changeset
402 Empty_Tree : constant Tree := (Capacity => 0, others => <>);
kono
parents:
diff changeset
403
kono
parents:
diff changeset
404 No_Element : constant Cursor := Cursor'(others => <>);
kono
parents:
diff changeset
405
kono
parents:
diff changeset
406 end Ada.Containers.Bounded_Multiway_Trees;