X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fxapp.hpp;h=1f1e7d04763ea76357777c624f17fc26c9246416;hb=a2f64d55efc2da9611f3cabe11a36370a553c186;hp=680db1b848021a108bdd1346de2b98a26433e132;hpb=b85024cd183a527cd8d61353637850cb6d30cf36;p=ric-app%2Fhw.git diff --git a/src/xapp.hpp b/src/xapp.hpp index 680db1b..1f1e7d0 100644 --- a/src/xapp.hpp +++ b/src/xapp.hpp @@ -1,7 +1,7 @@ /* ================================================================================== - Copyright (c) 2018-2019 AT&T Intellectual Property. + Copyright (c) 2019-2020 AT&T Intellectual Property. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ *//* * xapp.hpp * - * Modified: Mar, 2020 (Shraboni Jana) + * Mar, 2020 (Shraboni Jana) * */ @@ -38,6 +38,8 @@ #include "xapp_sdl.hpp" #include "rapidjson/writer.h" #include "rapidjson/document.h" +#include "rapidjson/error/error.h" + #include "msgs_proc.hpp" #include "subs_mgmt.hpp" #include "xapp_config.hpp" @@ -48,34 +50,33 @@ using namespace std; using namespace std::placeholders; using namespace rapidjson; -using callback_type = std::function< void(rmr_mbuf_t*,bool*) > ; class Xapp{ public: Xapp(XappSettings &, XappRmr &); + ~Xapp(void); - void startup(); + void stop(void); + + void startup(SubscriptionHandler &); void shutdown(void); - void init(void); + void start_xapp_receiver(XappMsgHandler &); + void Run(); + void sdl_data(void); Xapp(Xapp const &)=delete; Xapp& operator=(Xapp const &) = delete; - template - void register_handler(FunctionObject fn){ + void register_handler(XappMsgHandler &fn){ _callbacks.emplace_back(fn); } - void callback_handler(){ - - } - - void set_rnib_gnblist(void); //getters/setters. + void set_rnib_gnblist(void); std::vector get_rnib_gnblist(){ return rnib_gnblist; } private: @@ -86,13 +87,12 @@ private: XappRmr * rmr_ref; XappSettings * config_ref; + SubscriptionHandler *subhandler_ref; std::mutex *xapp_mutex; std::vector xapp_rcv_thread; std::vector rnib_gnblist; - - std::vector _callbacks; - + std::vector _callbacks; };