anjana_sreekumar@infosys.com | 991c206 | 2020-01-08 11:42:57 +0530 | [diff] [blame^] | 1 | [%- State = TemplateInputVar %] |
| 2 | [%- USE String %] |
| 3 | [%- MACRO CLASSNAME(str) BLOCK %] |
| 4 | [%- className = String.new %] |
| 5 | [%- strList = String.new(str).lower.split("_") %] |
| 6 | [%- FOREACH str = strList %] |
| 7 | [%- token = className.append(String.new(str).capital.text()) %] |
| 8 | [%- END %] |
| 9 | [%- className %] |
| 10 | [%- END %] |
| 11 | [%- MACRO FILENAME(str) BLOCK %] |
| 12 | [%- fileName = String.new %] |
| 13 | [%- str = CLASSNAME(str) %] |
| 14 | [%- fileName = fileName.append(str.substr(0,1)).lower %] |
| 15 | [%- fileName = fileName.append(str.substr(1)) %] |
| 16 | [%- fileName %] |
| 17 | [%- END %] |
| 18 | [%- stateClassName = CLASSNAME(State.Name) -%] |
| 19 | /* |
| 20 | * Copyright 2019-present, Infosys Limited. |
| 21 | * |
| 22 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 23 | * you may not use this file except in compliance with the License. |
| 24 | * You may obtain a copy of the License at |
| 25 | * |
| 26 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 27 | * Unless required by applicable law or agreed to in writing, software |
| 28 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 29 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 30 | * See the License for the specific language governing permissions and |
| 31 | * limitations under the License. |
| 32 | */ |
| 33 | |
| 34 | /****************************************************** |
| 35 | * [% FILENAME(State.Name) %].h |
| 36 | * This is an auto generated file. |
| 37 | * Please do not edit this file. |
| 38 | * All edits to be made through template source file |
| 39 | * <TOP-DIR/scripts/SMCodeGen/templates/stateMachineTmpls/state.h.tt> |
| 40 | ******************************************************/ |
| 41 | |
| 42 | #ifndef __[% stateClassName %]__ |
| 43 | #define __[% stateClassName %]__ |
| 44 | |
| 45 | #include "state.h" |
| 46 | |
| 47 | namespace mme { |
| 48 | |
| 49 | class [% stateClassName %] : public SM::State |
| 50 | { |
| 51 | public: |
| 52 | /****************************************** |
| 53 | * Instance |
| 54 | * Creates static instance for the state |
| 55 | *******************************************/ |
| 56 | static [% stateClassName %]* Instance(); |
| 57 | |
| 58 | /**************************************** |
| 59 | * [% stateClassName %] |
| 60 | * Destructor |
| 61 | ****************************************/ |
| 62 | ~[% stateClassName %](); |
| 63 | |
| 64 | /****************************************** |
| 65 | * initialize |
| 66 | * Initializes action handlers for the state |
| 67 | * and next state |
| 68 | ******************************************/ |
| 69 | void initialize(); |
| 70 | |
| 71 | private: |
| 72 | /**************************************** |
| 73 | * [% stateClassName %] |
| 74 | * Private constructor |
| 75 | ****************************************/ |
| 76 | [% stateClassName %](); |
| 77 | }; |
| 78 | }; |
| 79 | #endif // __[% stateClassName %]__ |