| [%- stateList = [] %] |
| [%- eventList = [] %] |
| [%- actionList = [] %] |
| [%- FOREACH ProcedureList = TemplateInputVar %] |
| [%- FOREACH Procedure = ProcedureList %] |
| [%- FOREACH State = Procedure.States %] |
| [%- stateList.push(State.Name) %] |
| [%- FOREACH Event = State.Events %] |
| [%- eventList.push(Event.Name) %] |
| [%- actionList = actionList.merge(Event.Actions) %] |
| [%- END %] |
| [%- END %] |
| [%- END %] |
| [%- END %] |
| [%- stateList = stateList.unique.sort %] |
| [%- eventList = eventList.unique.sort %] |
| [%- actionList = actionList.unique.sort -%] |
| /* |
| * Copyright 2019-present, Infosys Limited. |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| #ifndef SM_ENUMS_H |
| #define SM_ENUMS_H |
| /************************************** |
| * |
| * This is an auto generated file. |
| * Please do not edit this file. |
| * All edits to be made through template source file |
| * <TOP-DIR/scripts/SMCodeGen/templates/stateMachineTmpls/enum.tt> |
| **************************************/ |
| |
| enum State_e |
| { |
| [%- FOREACH state = stateList%] |
| [% state %],[% END %] |
| END_STATE |
| }; |
| |
| static constexpr const char* States[] = |
| { |
| [%- FOREACH state = stateList%] |
| "[% state %]",[%END%] |
| "END_STATE" |
| }; |
| |
| enum Event_e |
| { |
| [%- FOREACH event = eventList%] |
| [% event %],[%END%] |
| END_EVENT |
| }; |
| |
| static constexpr const char* Events[] = |
| { |
| [%- FOREACH event = eventList%] |
| "[% event %]",[%END%] |
| "END_EVENT" |
| }; |
| |
| enum Action_e |
| { |
| [%- FOREACH actions = actionList%] |
| [% actions %],[% END %] |
| END_ACTION |
| }; |
| |
| static constexpr const char* Actions[] = |
| { |
| [%- FOREACH action = actionList%] |
| "[% action %]",[%END%] |
| "END_ACTION" |
| }; |
| |
| #endif |