Commit c1b6a44f authored by Maxime Perrotin's avatar Maxime Perrotin

Add iterator for unsigned integer

parent ca099f01
with ASN1_Iterators.SimpleTypes,
with Interfaces;
use Interfaces;
Min: Interfaces.Unsigned_64;
Max: Interfaces.Unsigned_64;
package ASN1_Iterators.Generic_Unsigned_Integer is
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);
package Integer_type is new SimpleTypes(Element => Interfaces.Unsigned_64,
Elem_Init => Elem_Init,
Has_Elem => Has_Elem,
Elem_First => Elem_First,
Elem_Next => Elem_Next);
package It is new Generic_Basic (P => Integer_type);
subtype Instance is It.Basic_ASN1_Iterator;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment