blob: 5ecde817b0113051da99df72a6e5172906325968 [file] [log] [blame]
/*
* Copyright 2019-present Infosys Limited  
*   
* SPDX-License-Identifier: Apache-2.0    
*/
/******************************************************************************
*
* This is an auto generated file.
* Please do not edit this file.
* All edits to be made through template source file
* <TOP-DIR/scripts/GtpV2StackCodeGen/tts/iefactorytemplate.cpp.tt>
******************************************************************************/
#include <map>
#include "gtpV2IeFactory.h"
#include "manual/gtpV2Ie.h"
#include "gtpV2GrpIeDataTypes.h"
[% FOREACH ie IN tempdata.ieList -%]
#include "[% ie.ieFileName %].h"
[% END -%]
GtpV2IeFactory::GtpV2IeFactory()
{
//Create Message Objects
[% FOREACH ie IN tempdata.ieList -%]
[% ie.className %]* [% ie.ieFileName %]_p = new ([% ie.className %]);
ieObjectContainer.insert(std::pair<Uint8, GtpV2Ie*>([% ie.className %]Type, [% ie.ieFileName %]_p));
[% END -%]
}
GtpV2IeFactory::~GtpV2IeFactory() {
// TODO clean up the allocated memory for message objects
}
GtpV2IeFactory& GtpV2IeFactory::getInstance()
{
static GtpV2IeFactory gtpV2IeFactory;
return gtpV2IeFactory;
}
GtpV2Ie& GtpV2IeFactory::getIeObject(Uint8 ieType)
{
std::map<Uint8, GtpV2Ie*>::iterator it;
it = ieObjectContainer.find(ieType);
return *(it->second);
}