File: /home/oboss/Users/gec/sources/Basic_Services/Control_Structures/cyclic_task.ads
1 --% Compilation Unit: Cyclic_Task
2 --
3 --% Category: Generic Package Declaration
4 --
5 --% Release: $Name: $
6 --
7 --% Version: $Revision: 2.0 $
8 --
9 --% Author: $Author: gec $
10 --
11 --% Revision Log:
12 -- $Log: cyclic_task.ads,v $
13 -- Revision 2.0 2003/04/04 08:49:58 gec
14 -- Initial release of source files serving as baseline for OBOSS-III project.
15 --
16 -- Revision 1.1.1.1 2003/04/04 08:13:01 gec
17 -- Imported using TkCVS
18 --
19 --
20 --
21 --% Project: OBOSS
22 --
23 --% Copyright (C) 2003 by Terma A/S
24 -- Proprietary and intellectual rights of Terma A/S, Denmark,
25 -- are involved in the subject-matter of this material and
26 -- all manufacturing, reproduction, use, disclosure, and
27 -- sales rights pertaining to such subject-matter are
28 -- expressly reserved. This material is submitted for a
29 -- specific purpose as agreed, and the recipient by
30 -- accepting this material agrees that this material will
31 -- not be used, copied, or reproduced in whole or in part
32 -- nor its contents revealed in any manner or to any person,
33 -- except to meet the purpose for which it was submitted and
34 -- subject to the terms of the agreement.
35 --
36 --% Target Dependencies:
37 -- None
38 --% Compiler Dependencies:
39 -- None
40
41 --~-----------------------------------------------------------------------------
42
43 with Task_Priority_Control;
44 with Mission_Parameters;
45
46 generic
47
48 --% Generic Parameter Constraints:
49 --> Cyclic_Operation - Must never propagate an exception out of the call.
50
51 -- My_Application_ID is application ID for associated application process.
52 -- Used for generation of event reports in case of unhandled exceptions
53 --+ propagated out of Cyclic_Operation
54 My_Application_ID : in Mission_Parameters.APID;
55
56 -- Priority and stack size of cyclic object performing parameter monitoring
57 Cyclic_Task_Priority : in Task_Priority_Control.Active_Task_Priority;
58 Cyclic_Task_Stack_Size : in Natural;
59
60 -- Priority of protected object controlling the state of the cyclic object
61 -- A default value was assigned to avoid ecessive updates in the existing
62 --+ baseline.
63 -- This should be rectified.
64 Controller_Task_Priority
65 : in Task_Priority_Control.Passive_Task_Priority :=
66 Task_Priority_Control.Passive_Task_Priority'Last;
67
68 -- Period of cyclic task by which Cyclic_Operation is executed.
69 Cyclic_Task_Period : in Integer;
70
71 -- Initial state for cyclic task
72 -- Predicate indicating whether cyclic task should initially be started.
73 -- If false, then the task is initially stopped.
74 -- If true, then the task is initially started.
75 Is_Initially_Started : in Boolean := True;
76
77 -- Operation to be executed by cyclic task.
78 with procedure Cyclic_Operation;
79
80 package Cyclic_Task is
81
82 -- Raised in response to Start and Stop operations if the transisiton is
83 --+ impossible due to the current state of the cyclic task
84 Illegal_State_Transition : exception;
85
86 -- Enumeration indicating the current state of the cyclic task.
87 type Cyclic_Task_State is
88 (Started,
89 Stopped);
90
91 --% Subprogram:
92 -- Start the cyclic task.
93 --% Parameter Constraints:
94 --> None
95 --% Exceptions Raised:
96 --> Illegal_State_Transition - Raised if cyclic task is currently
97 --+ started
98 procedure Start;
99
100 --% Subprogram:
101 -- Stop the cyclic task.
102 --% Parameter Constraints:
103 --> None
104 --% Exceptions Raised:
105 --> Illegal_State_Transition - Raised if cyclic task is currently
106 --+ stopped
107 procedure Stop;
108
109 --% Subprogram:
110 -- Provides the current state of the cyclic task.
111 --% Parameter Constraints:
112 --> None
113 --% Exceptions Raised:
114 --> None
115
116 function Current_State
117 return Cyclic_Task_State;
118
119 end Cyclic_Task;
120
121 --~-----------------------------------------------------------------------------
122