| [%- DataBlock = TemplateInputVar %] |
| [%- USE String %] |
| [%- MACRO CLASSNAME(str) BLOCK %] |
| [%- className = String.new %] |
| [%- strList = String.new(str).split("_") %] |
| [%- FOREACH str = strList %] |
| [%- token = className.append(String.new(str).capital.text()) %] |
| [%- END %] |
| [%- className = className.append("Manager") %] |
| [%- className %] |
| [%- END %] |
| [%- MACRO FILENAME(str) BLOCK %] |
| [%- fileName = String.new %] |
| [%- str = CLASSNAME(str) %] |
| [%- fileName = fileName.append(str.substr(0,1)).lower %] |
| [%- fileName = fileName.append(str.substr(1)) %] |
| [%- fileName %] |
| [%- END %] |
| [%- poolMgrClassName = CLASSNAME(DataBlock.BlockName) -%] |
| /* |
| * 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 __[% poolMgrClassName %]__ |
| #define __[% poolMgrClassName %]__ |
| /****************************************************** |
| * [% FILENAME(DataBlock.BlockName) %].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/ctxtManagerTmpls/blockPoolManager.h.tt> |
| ***************************************/ |
| #include "memPoolManager.h" |
| |
| namespace mme |
| { |
| class [%DataBlock.BlockName%]; |
| class [%poolMgrClassName%] |
| { |
| public: |
| /**************************************** |
| * [% poolMgrClassName %] |
| * constructor |
| ****************************************/ |
| [%poolMgrClassName%](int numOfBlocks); |
| |
| /**************************************** |
| * [% poolMgrClassName %] |
| * Destructor |
| ****************************************/ |
| ~[%poolMgrClassName%](); |
| |
| /****************************************** |
| * allocate[% DataBlock.BlockName %] |
| * allocate [% DataBlock.BlockName %] data block |
| ******************************************/ |
| [% DataBlock.BlockName %]* allocate[% DataBlock.BlockName %](); |
| |
| /****************************************** |
| * deallocate[% DataBlock.BlockName %] |
| * deallocate a [% DataBlock.BlockName %] data block |
| ******************************************/ |
| void deallocate[% DataBlock.BlockName %]([% DataBlock.BlockName %]* [% DataBlock.BlockName %]p ); |
| |
| private: |
| cmn::memPool::MemPoolManager<[% DataBlock.BlockName %]> poolManager_m; |
| }; |
| }; |
| |
| #endif |
| |
| |