asn1_iterators-generic_integer.ads 881 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
with ASN1_Iterators.SimpleTypes,
     ASN1_Iterators.Generic_Basic;

with Interfaces;
use Interfaces;

generic
    Min: Interfaces.Integer_64;
    Max: Interfaces.Integer_64;
package ASN1_Iterators.Generic_Integer is
    function Elem_Init return Interfaces.Integer_64 is (Min);
    function Has_Elem(Value: Interfaces.Integer_64) return Boolean is
        (Value <= Max);
    function Elem_First return Interfaces.Integer_64 is (Min);
    function Elem_Next(Value: Interfaces.Integer_64) return Interfaces.Integer_64 is
        (Value + 1);

18 19 20 21 22 23
    package Signed_Integer is new SimpleTypes
       (Sort       => Interfaces.Integer_64,
        Elem_Init  => Elem_Init,
        Has_Elem   => Has_Elem,
        Elem_First => Elem_First,
        Elem_Next  => Elem_Next);
24

25
    package It is new Generic_Basic (P => Signed_Integer);
26 27 28

    subtype Instance is It.Basic_ASN1_Iterator;
end;