blob: 3751ca68775dbef2e3a6ab9c0b3269c1791c4108 [file] [log] [blame]
anjana_sreekumar@infosys.com991c2062020-01-08 11:42:57 +05301/*
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/msgfactorytemplate.cpp.tt>
13 ******************************************************************************/
14
15#include "gtpV2MsgFactory.h"
16#include "createSessionRequestMsg.h"
17#include "createSessionResponseMsg.h"
18#include "modifyBearerRequestMsg.h"
19#include "modifyBearerResponseMsg.h"
20#include "deleteSessionRequestMsg.h"
21#include "deleteSessionResponseMsg.h"
22#include "releaseAccessBearersRequestMsg.h"
23#include "releaseAccessBearersResponseMsg.h"
24#include "createBearerRequestMsg.h"
25#include "createBearerResponseMsg.h"
26#include "deleteBearerRequestMsg.h"
27#include "deleteBearerResponseMsg.h"
28#include "downlinkDataNotificationMsg.h"
29#include "downlinkDataNotificationAcknowledgeMsg.h"
30#include "downlinkDataNotificationFailureIndicationMsg.h"
31
32static GtpV2MsgFactory gtpV2MsgFactory;
33
34GtpV2MsgFactory::GtpV2MsgFactory()
35{
36 //Create Message Objects
37
38 CreateSessionRequestMsg* createSessionRequestMsg_p = new (CreateSessionRequestMsg);
39 msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(CreateSessionRequestMsgType, createSessionRequestMsg_p));
40
41 CreateSessionResponseMsg* createSessionResponseMsg_p = new (CreateSessionResponseMsg);
42 msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(CreateSessionResponseMsgType, createSessionResponseMsg_p));
43
44 ModifyBearerRequestMsg* modifyBearerRequestMsg_p = new (ModifyBearerRequestMsg);
45 msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(ModifyBearerRequestMsgType, modifyBearerRequestMsg_p));
46
47 ModifyBearerResponseMsg* modifyBearerResponseMsg_p = new (ModifyBearerResponseMsg);
48 msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(ModifyBearerResponseMsgType, modifyBearerResponseMsg_p));
49
50 DeleteSessionRequestMsg* deleteSessionRequestMsg_p = new (DeleteSessionRequestMsg);
51 msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(DeleteSessionRequestMsgType, deleteSessionRequestMsg_p));
52
53 DeleteSessionResponseMsg* deleteSessionResponseMsg_p = new (DeleteSessionResponseMsg);
54 msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(DeleteSessionResponseMsgType, deleteSessionResponseMsg_p));
55
56 ReleaseAccessBearersRequestMsg* releaseAccessBearersRequestMsg_p = new (ReleaseAccessBearersRequestMsg);
57 msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(ReleaseAccessBearersRequestMsgType, releaseAccessBearersRequestMsg_p));
58
59 ReleaseAccessBearersResponseMsg* releaseAccessBearersResponseMsg_p = new (ReleaseAccessBearersResponseMsg);
60 msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(ReleaseAccessBearersResponseMsgType, releaseAccessBearersResponseMsg_p));
61
62 CreateBearerRequestMsg* createBearerRequestMsg_p = new (CreateBearerRequestMsg);
63 msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(CreateBearerRequestMsgType, createBearerRequestMsg_p));
64
65 CreateBearerResponseMsg* createBearerResponseMsg_p = new (CreateBearerResponseMsg);
66 msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(CreateBearerResponseMsgType, createBearerResponseMsg_p));
67
68 DeleteBearerRequestMsg* deleteBearerRequestMsg_p = new (DeleteBearerRequestMsg);
69 msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(DeleteBearerRequestMsgType, deleteBearerRequestMsg_p));
70
71 DeleteBearerResponseMsg* deleteBearerResponseMsg_p = new (DeleteBearerResponseMsg);
72 msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(DeleteBearerResponseMsgType, deleteBearerResponseMsg_p));
73
74 DownlinkDataNotificationMsg* downlinkDataNotificationMsg_p = new (DownlinkDataNotificationMsg);
75 msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(DownlinkDataNotificationMsgType, downlinkDataNotificationMsg_p));
76
77 DownlinkDataNotificationAcknowledgeMsg* downlinkDataNotificationAcknowledgeMsg_p = new (DownlinkDataNotificationAcknowledgeMsg);
78 msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(DownlinkDataNotificationAcknowledgeMsgType, downlinkDataNotificationAcknowledgeMsg_p));
79
80 DownlinkDataNotificationFailureIndicationMsg* downlinkDataNotificationFailureIndicationMsg_p = new (DownlinkDataNotificationFailureIndicationMsg);
81 msgObjectContainer.insert(std::pair<Uint8, GtpV2Message*>(DownlinkDataNotificationFailureIndicationMsgType, downlinkDataNotificationFailureIndicationMsg_p));
82
83
84}
85
86GtpV2MsgFactory::~GtpV2MsgFactory() {
87 // TODO clean up the allocated memory for message objects
88}
89
90GtpV2MsgFactory& GtpV2MsgFactory::getInstance()
91{
92 static GtpV2MsgFactory gtpV2MsgFactory;
93 return gtpV2MsgFactory;
94}
95
96GtpV2Message& GtpV2MsgFactory::getMsgObject(Uint8 msgType)
97{
98 std::map<Uint8, GtpV2Message*>::iterator it;
99 it = msgObjectContainer.find(msgType);
100 return *(it->second);
101}