summaryrefslogtreecommitdiff
path: root/src/candidates.ads
diff options
context:
space:
mode:
Diffstat (limited to 'src/candidates.ads')
-rw-r--r--src/candidates.ads12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/candidates.ads b/src/candidates.ads
index 548d03a..c0c310f 100644
--- a/src/candidates.ads
+++ b/src/candidates.ads
@@ -20,7 +20,9 @@ package Candidates is
type Candidate is private;
- -- this is restricted to 255 values for memory conservation reasons
+ -- This is restricted to 255 values for memory conservation reasons.
+ -- Should fit into a single byte each when Pragma Pack is applied
+ -- to an array of them.
type CandidateID is new Positive range 1 .. 255;
@@ -31,17 +33,25 @@ package Candidates is
No_Candidate : constant Extended_CandidateID := Extended_CandidateID'First;
+ -- The lack of getters/setters is intentional, to ensure that election
+ -- code cannot change Candidate data once initally read.
+
+
+ -- Returns the Candidate's fields in csv format for logging purposes.
function To_String
(Input_Candidate : in Candidate;
Delimiter : in Character := ',')
return String;
+ -- Returns field labels corresponding to the field order
+ -- used in To_String. Used for logging purposes.
function Candidate_Header
(Delimiter : in Character := ',')
return String;
+ -- Used for verbose console messages about a particular Candidate.
function Name_And_Party
(Input_Candidate : in Candidate)
return String;