asn1_iterators-generic_enumerated.ads 920 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
   type Sort is (<>);  --  a discrete type, such as enumerated
9 10
package ASN1_Iterators.Generic_Enumerated is

Maxime Perrotin's avatar
Maxime Perrotin committed
11
   function Elem_Init return Sort;
12

Maxime Perrotin's avatar
Maxime Perrotin committed
13 14 15
   function Has_Elem (Value : Sort)   return Boolean;
   function Elem_First                return Sort is (Sort'First);
   function Elem_Next  (Value : Sort) return Sort;
16

Maxime Perrotin's avatar
Maxime Perrotin committed
17 18 19 20 21
   package Discrete_Type is new SimpleTypes (Sort       => Sort,
                                             Elem_Init  => Elem_Init,
                                             Has_Elem   => Has_Elem,
                                             Elem_First => Elem_First,
                                             Elem_Next  => Elem_Next);
22

Maxime Perrotin's avatar
Maxime Perrotin committed
23
   package It is new Generic_Basic (P => Discrete_Type);
24

Maxime Perrotin's avatar
Maxime Perrotin committed
25 26
   subtype Instance is It.Basic_ASN1_Iterator;
end ASN1_Iterators.Generic_Enumerated;