diff options
Diffstat (limited to 'src/bundles.ads')
-rw-r--r-- | src/bundles.ads | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/src/bundles.ads b/src/bundles.ads index db6565d..a58a232 100644 --- a/src/bundles.ads +++ b/src/bundles.ads @@ -1,10 +1,9 @@ with Preferences; -with Candidates; +with Candidates.Containers; with Rationals; -with Ada.Containers.Ordered_Maps; -with Ada.Containers.Vectors; +private with Ada.Containers.Vectors; generic @@ -18,21 +17,6 @@ package Bundles is Empty_Bundle : constant Bundle; - package Bundle_Vectors is new Ada.Containers.Vectors with - (Index_Type => Positive, - Element_Type => Bundle); - - - package Bundle_Maps is new Ada.Containers.Ordered_Maps - (Key_Type => Candidates.CandidateID, - Element_Type => Bundle_Vectors.Vector); - - - procedure Read_Bundles - (Filename : in String; - Result : out Bundle_Maps.Map); - - procedure Add (To : in out Bundle; Item : in Given_Prefs.Preference_Array); @@ -41,7 +25,7 @@ package Bundles is procedure Transfer (This : in out Bundle; From, To : in Candidates.CandidateID; - Excluded : in Candidates.CandidateID_Vector; + Excluded : in Candidates.Containers.CandidateID_Set; Value : in Rationals.Fraction; Result : out Bundle); @@ -56,6 +40,11 @@ package Bundles is return Natural; + function "<" + (Left, Right : in Bundle) + return Boolean; + + private @@ -73,12 +62,20 @@ private Element_Type => Paper_Lot); + use type Paper_Vectors.Vector; + + type Bundle is record Papers : Paper_Vectors.Vector := Paper_Vectors.Empty_Vector; Worth : Rationals.Fraction := 1 / 1; end record; + Empty_Bundle : constant Bundle := + (Papers => Paper_Vectors.Empty_Vector, + Worth => 1 / 1); + + end Bundles; |