asn1_iterators-generic_unsigned_integer.ads 923 Bytes
Newer Older
1 2 3 4 5 6 7
with ASN1_Iterators.SimpleTypes,
     ASN1_Iterators.Generic_Basic;

with Interfaces;
use Interfaces;

generic
Maxime Perrotin's avatar
Maxime Perrotin committed
8 9
   Min : Interfaces.Unsigned_64;
   Max : Interfaces.Unsigned_64;
10
package ASN1_Iterators.Generic_Unsigned_Integer is
Maxime Perrotin's avatar
Maxime Perrotin committed
11 12 13 14 15 16
   function Elem_Init return Interfaces.Unsigned_64 is (Min);
   function Has_Elem (Value : Interfaces.Unsigned_64) return Boolean is
      (Value <= Max);
   function Elem_First return Interfaces.Unsigned_64 is (Min);
   function Elem_Next (Value : Interfaces.Unsigned_64)
     return Interfaces.Unsigned_64 is (Value + 1);
17

Maxime Perrotin's avatar
Maxime Perrotin committed
18 19 20 21 22 23
   package Unsigned_Type is new SimpleTypes
      (Sort       => Interfaces.Unsigned_64,
       Elem_Init  => Elem_Init,
       Has_Elem   => Has_Elem,
       Elem_First => Elem_First,
       Elem_Next  => Elem_Next);
24

Maxime Perrotin's avatar
Maxime Perrotin committed
25
   package It is new Generic_Basic (P => Unsigned_Type);
26

Maxime Perrotin's avatar
Maxime Perrotin committed
27 28
   subtype Instance is It.Basic_ASN1_Iterator;
end ASN1_Iterators.Generic_Unsigned_Integer;