I just started programming on Ada and I was wondering how to code getters and setters to work with classes attributes.
In fact I am interested in obtaining getters and setters of attributes deadline
, period
and computingTime
of the following package:
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Real_Time; use Ada.Real_Time;
package body pkg_tasks is
task body task_a is
deadline : Time_Span := To_Time_Span(25.0);
period : Time_Span := To_Time_Span(25.0);
computingTime : Time_Span := To_Time_Span(10.0);
startingTime : Time;
begin
entry start do
startingTime := Clock;
while (Clock - startingTime) < computingTime loop
end loop;
New_line;
Put_Line("End of task A");
end start;
end task_a;
end pkg_tasks;