Natools

Diff
Login

Differences From Artifact [d509c86522]:

To Artifact [e2501f2237]:


568
569
570
571
572
573
574


















575
576
577
578
579
580
581

   function Iterate (Container : in Constant_Map; Start : in Cursor)
     return Map_Iterator_Interfaces.Reversible_Iterator'Class is
   begin
      return Iterator'(Backend => Container.Backend, Start => Start);
   end Iterate;




















   function Last (Container : Constant_Map) return Cursor is
   begin
      if Container.Is_Empty then
         return No_Element;
      else
         return (Is_Empty => False,







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599

   function Iterate (Container : in Constant_Map; Start : in Cursor)
     return Map_Iterator_Interfaces.Reversible_Iterator'Class is
   begin
      return Iterator'(Backend => Container.Backend, Start => Start);
   end Iterate;


   function Iterate (Container : in Constant_Map; First, Last : in Cursor)
     return Map_Iterator_Interfaces.Reversible_Iterator'Class is
   begin
      if Is_Empty (Container)
        or else not Has_Element (First)
        or else not Has_Element (Last)
        or else First > Last
      then
         return Iterator'(Backend => Backend_Refs.Null_Immutable_Reference,
           Start => No_Element);
      else
         return Range_Iterator'(Backend => Container.Backend,
                                First_Position => First,
                                Last_Position => Last);
      end if;
   end Iterate;


   function Last (Container : Constant_Map) return Cursor is
   begin
      if Container.Is_Empty then
         return No_Element;
      else
         return (Is_Empty => False,
724
725
726
727
728
729
730




































731
      else
         return (Is_Empty => False,
            Backend => Object.Backend,
            Index => Object.Backend.Query.Data.Size);
      end if;
   end Last;





































end Natools.Constant_Indefinite_Ordered_Maps;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
      else
         return (Is_Empty => False,
            Backend => Object.Backend,
            Index => Object.Backend.Query.Data.Size);
      end if;
   end Last;


   overriding function First (Object : Range_Iterator) return Cursor is
   begin
      return Object.First_Position;
   end First;


   overriding function Last  (Object : Range_Iterator) return Cursor is
   begin
      return Object.Last_Position;
   end Last;


   overriding function Next
     (Object   : Range_Iterator;
      Position : Cursor) return Cursor is
   begin
      if Has_Element (Position) and then Position < Object.Last_Position then
         return Next (Position);
      else
         return No_Element;
      end if;
   end Next;


   overriding function Previous
     (Object   : Range_Iterator;
      Position : Cursor) return Cursor is
   begin
      if Has_Element (Position) and then Position > Object.First_Position then
         return Previous (Position);
      else
         return No_Element;
      end if;
   end Previous;

end Natools.Constant_Indefinite_Ordered_Maps;