From be9b26ad909dfe973e3ef7756afae6a2b42a41d5 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Sat, 18 Feb 2017 20:46:50 +1100 Subject: Commented the Candidates packages better --- src/candidates.ads | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/candidates.ads') 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; -- cgit