Rollback
[ric-app/hw.git] / src / xapp-asn / e2sm / e2sm_subscription.hpp
1 /*
2 ==================================================================================
3
4         Copyright (c) 2019-2020 AT&T Intellectual Property.
5
6    Licensed under the Apache License, Version 2.0 (the "License");
7    you may not use this file except in compliance with the License.
8    You may obtain a copy of the License at
9
10        http://www.apache.org/licenses/LICENSE-2.0
11
12    Unless required by applicable law or agreed to in writing, software
13    distributed under the License is distributed on an "AS IS" BASIS,
14    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15    See the License for the specific language governing permissions and
16    limitations under the License.
17 ==================================================================================
18 */
19 /*
20  * e2sm_control.cc
21  *
22  *  Created on: Apr 30, 2020
23  *      Author: Shraboni Jana
24  */
25 /* Classes to handle E2 service model based on e2sm-HelloWorld-v001.asn */
26 #ifndef E2SM_
27 #define E2SM_
28
29
30 #include <sstream>
31 #include <e2sm_helpers.hpp>
32 #include <mdclog/mdclog.h>
33 #include <vector>
34
35 #include <E2SM-HelloWorld-EventTriggerDefinition.h>
36 #include <E2SM-HelloWorld-ActionDefinition.h>
37 #include <E2SM-HelloWorld-EventTriggerDefinition-Format1.h>
38 #include <E2SM-HelloWorld-ActionDefinition-Format1.h>
39 #include <HW-TriggerNature.h>
40 #include <RANparameter-Item.h>
41
42 /* builder class for E2SM event trigger definition */
43
44 class e2sm_subscription {
45 public:
46         e2sm_subscription(void);
47   ~e2sm_subscription(void);
48
49   bool set_fields(E2SM_HelloWorld_EventTriggerDefinition_t *, e2sm_subscription_helper &);
50   bool set_fields(E2SM_HelloWorld_ActionDefinition_t *, e2sm_subscription_helper &);
51
52   bool encode_event_trigger(unsigned char *, size_t *, e2sm_subscription_helper &);
53   bool encode_action_defn(unsigned char*, size_t *, e2sm_subscription_helper &);
54
55
56   std::string  get_error (void) const {return error_string ;};
57
58 private:
59
60   E2SM_HelloWorld_EventTriggerDefinition_t * event_trigger; // used for encoding
61   E2SM_HelloWorld_ActionDefinition_t* action_defn;
62   E2SM_HelloWorld_EventTriggerDefinition_Format1_t event_fmt1;
63   E2SM_HelloWorld_ActionDefinition_Format1_t actn_fmt1;
64   RANparameter_Item_t *ran_param;
65
66
67   size_t errbuf_len;
68   char errbuf[128];
69   std::string error_string;
70 };
71
72
73
74 #endif