anjana_sreekumar@infosys.com | 991c206 | 2020-01-08 11:42:57 +0530 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2019-present Infosys Limited |
| 3 | * |
| 4 | * SPDX-License-Identifier: Apache-2.0 |
| 5 | */ |
| 6 | |
| 7 | /****************************************************************************** |
| 8 | * |
| 9 | * This is an auto generated file. |
| 10 | * Please do not edit this file. |
| 11 | * All edits to be made through template source file |
| 12 | * <TOP-DIR/scripts/GtpV2StackCodeGen/tts/grpietemplate.cpp.tt> |
| 13 | ******************************************************************************/ |
| 14 | #include "[% tempdata.fileName %].h" |
| 15 | #include "gtpV2GrpIeDataTypes.h" |
| 16 | #include "manual/gtpV2GroupedIe.h" |
| 17 | [%fileList =tempdata.fileName -%] |
| 18 | |
| 19 | [% FOREACH inst IN tempdata.$fileList -%] |
| 20 | #include "[% inst.fileName %].h" |
| 21 | [% END -%] |
| 22 | |
| 23 | [% tempdata.className %]::[% tempdata.className %]() |
| 24 | { |
| 25 | ieType = [% tempdata.className %]Type; |
| 26 | |
| 27 | [% FOREACH inst IN tempdata.$fileList -%] |
| 28 | [% inst.className %]* [% inst.fileName %]_p = new ([% inst.className %]); |
| 29 | insertGroupedIeObject([% inst.msgType %], [% inst.instance %], [% inst.fileName %]_p); |
| 30 | [% END -%] |
| 31 | } |
| 32 | |
| 33 | [% tempdata.className %]::~[% tempdata.className %]() { |
| 34 | // TODO Auto-generated destructor stub |
| 35 | } |
| 36 | |
| 37 | GtpV2GroupedIe& [% tempdata.className %]::getGroupedIe(Uint8 msgType, Uint8 instance) |
| 38 | { |
| 39 | std::map<Uint16, GtpV2GroupedIe*>::iterator it; |
| 40 | Uint16 key = msgType; |
| 41 | key = (key << 8) + instance; |
| 42 | it = groupedIeObjectContainer.find(key); |
| 43 | return *(it->second); |
| 44 | } |
| 45 | |
| 46 | void [% tempdata.className %]::insertGroupedIeObject(Uint8 msgType, Uint8 instance, GtpV2GroupedIe* grpIe_p) |
| 47 | { |
| 48 | |
| 49 | Uint16 key = msgType; |
| 50 | key = (key << 8) + instance; |
| 51 | |
| 52 | groupedIeObjectContainer.insert(std::pair<Uint16, GtpV2GroupedIe*>(key, grpIe_p)); |
| 53 | |
| 54 | } |