summaryrefslogtreecommitdiff
path: root/src/bundles-containers.ads
blob: 136102679e1190625b3b611f4e24f9e77297af99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41


with

    Ada.Containers.Vectors;


generic
    Min_Valid : Candidates.CandidateID;
    Max_Valid : Candidates.CandidateID;
    Num_Threads : Positive := 2;
package Bundles.Containers is


    package Bundle_Vectors is new Ada.Containers.Vectors
           (Index_Type   => Positive,
            Element_Type => Bundle);
    subtype Bundle_Vector is Bundle_Vectors.Vector;


    subtype Valid_CandidateID is Candidates.CandidateID range Min_Valid .. Max_Valid;
    type Bundle_Collection is array (Valid_CandidateID) of Bundle_Vector;


    procedure Read_Bundles
           (Filename : in     String;
            Result   :    out Bundle_Collection);


    --  Current implementation slightly faster, but not worth it.
    --  Probably needs to be reworked to read in the entire file at once for decent
    --  increase in speed, but that would involve approx doubling memory usage,
    --  which is unacceptable.
    procedure Read_Bundles_Threaded
           (Filename : in     String;
            Result   :    out Bundle_Collection);


end Bundles.Containers;