summaryrefslogtreecommitdiff
path: root/src/candidates.ads
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2017-02-18 20:46:50 +1100
committerJed Barber <jjbarber@y7mail.com>2017-02-18 20:46:50 +1100
commitbe9b26ad909dfe973e3ef7756afae6a2b42a41d5 (patch)
tree0fc583dc2ba72a744e0a5ec29950624d20a6179c /src/candidates.ads
parentf20b3a198cd51d9742e6575beac7dd74b8b6b715 (diff)
Commented the Candidates packages better
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;