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