MME2 changes - Propped commits from openmme/paging branch. Added scripts
for code gen
Change-Id: Ie55032217232214ac8544ca76ea34335205329e4
diff --git a/scripts/GtpV2StackCodeGen/tts/iefactorytemplate.cpp.tt b/scripts/GtpV2StackCodeGen/tts/iefactorytemplate.cpp.tt
new file mode 100644
index 0000000..5ecde81
--- /dev/null
+++ b/scripts/GtpV2StackCodeGen/tts/iefactorytemplate.cpp.tt
@@ -0,0 +1,49 @@
+/*
+ * 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);
+}
\ No newline at end of file