anjana_sreekumar@infosys.com | 991c206 | 2020-01-08 11:42:57 +0530 | [diff] [blame^] | 1 | [%- DataStore = templateIn %] |
| 2 | [%- USE String %] |
| 3 | [%- MACRO CLASSNAME(str) BLOCK %] |
| 4 | [%- className = String.new %] |
| 5 | [%- strList = String.new(str).split("_") %] |
| 6 | [%- FOREACH str = strList %] |
| 7 | [%- token = className.append(String.new(str).capital.text()) %] |
| 8 | [%- END %] |
| 9 | [%- className %] |
| 10 | [%- END %] |
| 11 | [%- MACRO REF(str) BLOCK %] |
| 12 | [%- primTypeList = [ "int", "short", "uint8_t", "uint16_t", "uint32_t", "unsigned int", "unsigned char", "unsigned short", "bool" ] %] |
| 13 | [%- reference = String.new %] |
| 14 | [%- reference = '&' %] |
| 15 | [%- FOREACH type = primTypeList %] |
| 16 | [%- IF str == type %] |
| 17 | [%- reference = '' %] |
| 18 | [%- END %] |
| 19 | [%- END %] |
| 20 | [%- reference %] |
| 21 | [%- END %] |
| 22 | /* |
| 23 | * Copyright 2019-present, Infosys Limited. |
| 24 | * |
| 25 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 26 | * you may not use this file except in compliance with the License. |
| 27 | * You may obtain a copy of the License at |
| 28 | * |
| 29 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 30 | * Unless required by applicable law or agreed to in writing, software |
| 31 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 32 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 33 | * See the License for the specific language governing permissions and |
| 34 | * limitations under the License. |
| 35 | */ |
| 36 | #ifndef DGM_BLOCKSTRUCTURES_H |
| 37 | #define DGM_BLOCKSTRUCTURES_H |
| 38 | /************************************** |
| 39 | * |
| 40 | * This is an auto generated file. |
| 41 | * Please do not edit this file. |
| 42 | * All edits to be made through template source file |
| 43 | * <TOP-DIR/scripts/SMCodeGen/templates/ctxtManagerTmpls/dataBlocks.h.tt> |
| 44 | ***************************************/ |
| 45 | #include "permDataBlock.h" |
| 46 | #include "tempDataBlock.h" |
| 47 | #include "structs.h" |
| 48 | |
| 49 | namespace mme |
| 50 | { |
| 51 | [%- FOREACH DataGroup = DataStore.DataGroups %] |
| 52 | [%- FOREACH DataBlock = DataGroup.DataBlocks %] |
| 53 | [%- dataBlockClassName = CLASSNAME(DataBlock.BlockName) %] |
| 54 | class [% dataBlockClassName %]; |
| 55 | [%- END %] |
| 56 | [%- END %] |
| 57 | |
| 58 | [%- FOREACH DataGroup = DataStore.DataGroups %] |
| 59 | [%- FOREACH DataBlock = DataGroup.DataBlocks %] |
| 60 | [%- dataBlockClassName = CLASSNAME(DataBlock.BlockName) %] |
| 61 | class [% dataBlockClassName %]:public SM::[% IF DataBlock.BlockType == 'Permanent' %]PermDataBlock[% ELSE %]TempDataBlock[%- END %] |
| 62 | { |
| 63 | public: |
| 64 | |
| 65 | /**************************************** |
| 66 | * [% dataBlockClassName %] |
| 67 | * constructor |
| 68 | ****************************************/ |
| 69 | [% dataBlockClassName %](); |
| 70 | |
| 71 | /**************************************** |
| 72 | * ~[% dataBlockClassName %] |
| 73 | * destructor |
| 74 | ****************************************/ |
| 75 | ~[% dataBlockClassName %](); |
| 76 | |
| 77 | [%- FOREACH Data = DataBlock.Data %] |
| 78 | /**************************************** |
| 79 | * set[% Data.Name %] |
| 80 | * set [% Data.Name %] to [% dataBlockClassName %] |
| 81 | ****************************************/ |
| 82 | void set[% Data.Name %]( const [% Data.Type %][% REF(Data.Type) %] [% Data.Name %]_i ); |
| 83 | |
| 84 | /**************************************** |
| 85 | * get[% Data.Name %] |
| 86 | * get [% Data.Name %] from [% dataBlockClassName %] |
| 87 | ****************************************/ |
| 88 | const [% Data.Type %][% REF(Data.Type) %] get[% Data.Name %]()const; |
| 89 | [% END %] |
| 90 | |
| 91 | [%- FOREACH Child = DataBlock.Children %] |
| 92 | /**************************************** |
| 93 | * set[% Child %] |
| 94 | * set [% Child %] to [% dataBlockClassName %] |
| 95 | ****************************************/ |
| 96 | void set[% Child %]( [% Child %]* [% Child %]p ) ; |
| 97 | |
| 98 | /**************************************** |
| 99 | * get[% Child %] |
| 100 | * get [% Child %] to [% dataBlockClassName %] |
| 101 | ****************************************/ |
| 102 | [% Child %]* get[% Child %](); |
| 103 | [% END %] |
| 104 | |
| 105 | private: |
| 106 | |
| 107 | [%- FOREACH Data = DataBlock.Data %] |
| 108 | [%- DataName = CLASSNAME(Data.Name) %] |
| 109 | // DataName |
| 110 | [% Data.Type %] [% Data.Name %]_m; |
| 111 | [% END %] |
| 112 | |
| 113 | [%- FOREACH Child = DataBlock.Children %] |
| 114 | // [% Child %] |
| 115 | [% Child %]* [% Child %]_mp; |
| 116 | [% END %] |
| 117 | }; |
| 118 | [% END %] |
| 119 | [% END %] |
| 120 | } // mme |
| 121 | #endif |