Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | constant_indefinite_ordered_maps: add a Rank cursor primitive |
|---|---|
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
e76c115feff0c1e99c973ab5410f1580 |
| User & Date: | nat 2017-06-20 21:40:53.728 |
Context
|
2017-06-21
| ||
| 19:51 | constant_indefinite_ordered_map_tests: test the new Rank primitive check-in: d01e18ba8f user: nat tags: trunk | |
|
2017-06-20
| ||
| 21:40 | constant_indefinite_ordered_maps: add a Rank cursor primitive check-in: e76c115fef user: nat tags: trunk | |
|
2017-06-19
| ||
| 21:20 | s_expressions-parsers-tests: add a test for Close_Current_List primitive check-in: 38b822e5a1 user: nat tags: trunk | |
Changes
Changes to src/natools-constant_indefinite_ordered_maps.adb.
1 | 1 2 3 4 5 6 7 8 9 | - + | ------------------------------------------------------------------------------ |
| ︙ | |||
330 331 332 333 334 335 336 337 338 339 340 341 342 343 | 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | + + + + + + + + + |
Accessor : constant Backend_Refs.Accessor := Position.Backend.Query;
begin
Process.all
(Accessor.Data.Nodes (Position.Index).Key.all,
Accessor.Data.Nodes (Position.Index).Element.all);
end Query_Element;
function Rank (Position : Cursor) return Ada.Containers.Count_Type is
begin
case Position.Is_Empty is
when True => return 0;
when False => return Position.Index;
end case;
end Rank;
-----------------------------
-- Non-Standard Operations --
-----------------------------
function Create (Source : Unsafe_Maps.Map) return Constant_Map is
|
| ︙ |
Changes to src/natools-constant_indefinite_ordered_maps.ads.
1 | 1 2 3 4 5 6 7 8 9 | - + | ------------------------------------------------------------------------------ |
| ︙ | |||
106 107 108 109 110 111 112 113 114 115 116 117 118 119 | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | + + + + |
with Pre => Has_Element (Left) or else raise Constraint_Error;
function ">" (Left : Cursor; Right : Key_Type) return Boolean
with Pre => Has_Element (Left) or else raise Constraint_Error;
function "<" (Left : Key_Type; Right : Cursor) return Boolean
with Pre => Has_Element (Right) or else raise Constraint_Error;
function ">" (Left : Key_Type; Right : Cursor) return Boolean
with Pre => Has_Element (Right) or else raise Constraint_Error;
function Rank (Position : Cursor) return Ada.Containers.Count_Type;
-- Return 1-based numeric position of the element designated by Position
-- or zero when Position is empty.
package Map_Iterator_Interfaces is new Ada.Iterator_Interfaces
(Cursor, Has_Element);
type Constant_Map is tagged private;
|
| ︙ |