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