2 ==================================================================================
4 Copyright (c) 2018-2019 AT&T Intellectual Property.
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
10 http://www.apache.org/licenses/LICENSE-2.0
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 ==================================================================================
21 * Modified: Mar, 2020 (Shraboni Jana)
36 #include <unordered_map>
37 #include "xapp_rmr.hpp"
38 #include "xapp_sdl.hpp"
39 #include "rapidjson/writer.h"
40 #include "rapidjson/document.h"
41 #include "msgs_proc.hpp"
42 #include "subs_mgmt.hpp"
43 #include "xapp_config.hpp"
45 #include "rnib/rnibreader_old.h"
48 using namespace std::placeholders;
49 using namespace rapidjson;
51 using callback_type = std::function< void(rmr_mbuf_t*,bool*) > ;
56 Xapp(XappSettings &, XappRmr &);
62 void start_xapp_receiver(XappMsgHandler &);
65 Xapp(Xapp const &)=delete;
66 Xapp& operator=(Xapp const &) = delete;
68 template<typename FunctionObject>
69 void register_handler(FunctionObject fn){
70 _callbacks.emplace_back(fn);
73 void callback_handler(){
77 void set_rnib_gnblist(void);
79 std::vector<std::string> get_rnib_gnblist(){ return rnib_gnblist; }
82 void startup_subscribe_requests(void );
83 void shutdown_subscribe_deletes(void);
84 void startup_get_policies(void );
88 XappSettings * config_ref;
90 std::mutex *xapp_mutex;
91 std::vector<std::thread> xapp_rcv_thread;
92 std::vector<std::string> rnib_gnblist;
94 std::vector<callback_type> _callbacks;
99 #endif /* SRC_XAPP_HPP_ */