private with Ada.Strings.Unbounded; private with Ada.Containers.Vectors; package Candidates is type State_Name is (ACT, NT, TAS, SA, WA, VIC, QLD, NSW); type Candidate is private; type CandidateID is new Positive; function To_String (Input_Candidate : in Candidate; Delimiter : in Character := ',') return String; type Candidate_Vector is private; type CandidateID_Vector is private; procedure Read_Candidates (Filename : in String; State : in State_Name; Candidate_List : out Candidate_Vector); function First (Candidate_List : in Candidate_Vector) return CandidateID; function Last (Candidate_List : in Candidate_Vector) return CandidateID; function Lookup (Candidate_List : in Candidate_Vector; Index : in CandidateID) return Candidate; function First (CandidateID_List : in CandidateID_Vector) return Positive; function Last (CandidateID_List : in CandidateID_Vector) return Positive; function Lookup (CandidateID_List : in CandidateID_Vector; Index : in Positive) return CandidateID; type Above_Line_Ballot is private; type Below_Line_Ballot is private; procedure Generate_Ballots (Candidate_List : in Candidate_Vector; Above_Ballot : out Above_Line_Ballot; Below_Ballot : out Below_Line_Ballot); function First (Above_Ballot : in Above_Line_Ballot) return Positive; function Last (Above_Ballot : in Above_Line_Ballot) return Positive; function Lookup (Above_Ballot : in Above_Line_Ballot; Index : in Positive) return CandidateID_Vector; function First (Below_Ballot : in Below_Line_Ballot) return Positive; function Last (Below_Ballot : in Below_Line_Ballot) return Positive; function Lookup (Below_Ballot : in Below_Line_Ballot; Index : in Positive) return CandidateID; private package SU renames Ada.Strings.Unbounded; type Candidate is record First_Name : SU.Unbounded_String; Last_Name : SU.Unbounded_String; Group : SU.Unbounded_String; Group_Rank : SU.Unbounded_String; Party : SU.Unbounded_String; end record; package Candidate_Vectors is new Ada.Containers.Vectors (Index_Type => CandidateID, Element_Type => Candidate); type Candidate_Vector is record Vec : Candidate_Vectors.Vector; end record; package CandidateID_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => CandidateID); type CandidateID_Vector is record Vec : CandidateID_Vectors.Vector; end record; package Above_Line_Ballots is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => CandidateID_Vector); type Above_Line_Ballot is record Vec : Above_Line_Ballots.Vector; end record; type Below_Line_Ballot is record Vec : CandidateID_Vectors.Vector; end record; end Candidates;