blob: dd6c455683709ee7d3adafcc59e0cf34d8409eb4 [file] [log] [blame]
anjana_sreekumar@infosys.com991c2062020-01-08 11:42:57 +05301[%- stateList = [] %]
2[%- eventList = [] %]
3[%- actionList = [] %]
4[%- FOREACH ProcedureList = TemplateInputVar %]
5 [%- FOREACH Procedure = ProcedureList %]
6 [%- FOREACH State = Procedure.States %]
7 [%- stateList.push(State.Name) %]
8 [%- FOREACH Event = State.Events %]
9 [%- eventList.push(Event.Name) %]
10 [%- actionList = actionList.merge(Event.Actions) %]
11 [%- END %]
12 [%- END %]
13 [%- END %]
14[%- END %]
15[%- stateList = stateList.unique.sort %]
16[%- eventList = eventList.unique.sort %]
17[%- actionList = actionList.unique.sort -%]
18/*
19 * Copyright 2019-present, Infosys Limited.
20 *
21 * Licensed under the Apache License, Version 2.0 (the "License");
22 * you may not use this file except in compliance with the License.
23 * You may obtain a copy of the License at
24 *
25 * http://www.apache.org/licenses/LICENSE-2.0
26 * Unless required by applicable law or agreed to in writing, software
27 * distributed under the License is distributed on an "AS IS" BASIS,
28 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29 * See the License for the specific language governing permissions and
30 * limitations under the License.
31 */
32
33#ifndef SM_ENUMS_H
34#define SM_ENUMS_H
35/**************************************
36 *
37 * This is an auto generated file.
38 * Please do not edit this file.
39 * All edits to be made through template source file
40 * <TOP-DIR/scripts/SMCodeGen/templates/stateMachineTmpls/enum.tt>
41 **************************************/
42
43enum State_e
44{
45 [%- FOREACH state = stateList%]
46 [% state %],[% END %]
47 END_STATE
48};
49
50static constexpr const char* States[] =
51{
52 [%- FOREACH state = stateList%]
53 "[% state %]",[%END%]
54 "END_STATE"
55};
56
57enum Event_e
58{
59 [%- FOREACH event = eventList%]
60 [% event %],[%END%]
61 END_EVENT
62};
63
64static constexpr const char* Events[] =
65{
66 [%- FOREACH event = eventList%]
67 "[% event %]",[%END%]
68 "END_EVENT"
69};
70
71enum Action_e
72{
73 [%- FOREACH actions = actionList%]
74 [% actions %],[% END %]
75 END_ACTION
76};
77
78static constexpr const char* Actions[] =
79{
80 [%- FOREACH action = actionList%]
81 "[% action %]",[%END%]
82 "END_ACTION"
83};
84
85#endif