2 # ==================================================================================
3 # Copyright (c) 2020 HCL Technologies Limited.
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
9 # http://www.apache.org/licenses/LICENSE-2.0
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 # ==================================================================================
31 #include <unordered_map>
32 #include "xapp_rmr.hpp"
33 #include "xapp_sdl.hpp"
34 #include "rapidjson/writer.h"
35 #include "rapidjson/document.h"
36 #include "rapidjson/error/error.h"
38 #include "msgs_proc.hpp"
39 #include "subs_mgmt.hpp"
40 #include "xapp_config.hpp"
42 #include "rnib/rnibreader.h"
45 using namespace std::placeholders;
46 using namespace rapidjson;
52 Xapp(XappSettings &, XappRmr &);
58 void startup(SubscriptionHandler &);
61 void start_xapp_receiver(XappMsgHandler &);
64 //void sdl_data(void);
66 Xapp(Xapp const &)=delete;
67 Xapp& operator=(Xapp const &) = delete;
69 void register_handler(XappMsgHandler &fn){
70 _callbacks.emplace_back(fn);
74 void set_rnib_gnblist(void);
75 std::vector<std::string> get_rnib_gnblist(){ return rnib_gnblist; }
78 void startup_subscribe_requests(void );
79 void shutdown_subscribe_deletes(void);
80 void startup_get_policies(void );
84 XappSettings * config_ref;
85 SubscriptionHandler *subhandler_ref;
87 std::mutex *xapp_mutex;
88 std::vector<std::thread> xapp_rcv_thread;
89 std::vector<std::string> rnib_gnblist;
90 std::vector<XappMsgHandler> _callbacks;
94 #endif /* SRC_XAPP_HPP_ */