Code Review
/
ric-app
/
hw.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Release push 1.0.2
[ric-app/hw.git]
/
src
/
xapp.hpp
diff --git
a/src/xapp.hpp
b/src/xapp.hpp
index
bcfff5b
..
1f1e7d0
100644
(file)
--- a/
src/xapp.hpp
+++ b/
src/xapp.hpp
@@
-1,7
+1,7
@@
/*
==================================================================================
/*
==================================================================================
- Copyright (c) 201
8-2019
AT&T Intellectual Property.
+ Copyright (c) 201
9-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.
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
*
*//*
* xapp.hpp
*
- * M
odified: M
ar, 2020 (Shraboni Jana)
+ * Mar, 2020 (Shraboni Jana)
*
*/
*
*/
@@
-32,46
+32,67
@@
#include <memory>
#include <csignal>
#include <stdio.h>
#include <memory>
#include <csignal>
#include <stdio.h>
+#include <pthread.h>
+#include <unordered_map>
#include "xapp_rmr.hpp"
#include "xapp_sdl.hpp"
#include "rapidjson/writer.h"
#include "xapp_rmr.hpp"
#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"
#include "msgs_proc.hpp"
#include "subs_mgmt.hpp"
#include "xapp_config.hpp"
-//#include "rnib/rnibreader.h"
-
-
+extern "C" {
+#include "rnib/rnibreader.h"
+}
using namespace std;
using namespace std::placeholders;
using namespace std;
using namespace std::placeholders;
+using namespace rapidjson;
+
class Xapp{
public:
Xapp(XappSettings &, XappRmr &);
class Xapp{
public:
Xapp(XappSettings &, XappRmr &);
- Xapp(XappSettings &, XappRmr &, XappSDL &);
+
~Xapp(void);
~Xapp(void);
- void startup();
+ void stop(void);
+
+ void startup(SubscriptionHandler &);
void shutdown(void);
void shutdown(void);
- void start_xapp_receiver();
+ void start_xapp_receiver(XappMsgHandler &);
+ void Run();
+
+ void sdl_data(void);
Xapp(Xapp const &)=delete;
Xapp& operator=(Xapp const &) = delete;
Xapp(Xapp const &)=delete;
Xapp& operator=(Xapp const &) = delete;
+ void register_handler(XappMsgHandler &fn){
+ _callbacks.emplace_back(fn);
+ }
+
+ //getters/setters.
+ void set_rnib_gnblist(void);
+ std::vector<std::string> get_rnib_gnblist(){ return rnib_gnblist; }
+
private:
void startup_subscribe_requests(void );
void shutdown_subscribe_deletes(void);
void startup_get_policies(void );
private:
void startup_subscribe_requests(void );
void shutdown_subscribe_deletes(void);
void startup_get_policies(void );
- void sdl_data(void);
- void rnib_data(void);
+
XappRmr * rmr_ref;
XappSettings * config_ref;
XappRmr * rmr_ref;
XappSettings * config_ref;
- XappSDL *sdl_ref = NULL;
+ SubscriptionHandler *subhandler_ref;
+
std::mutex *xapp_mutex;
std::vector<std::thread> xapp_rcv_thread;
std::mutex *xapp_mutex;
std::vector<std::thread> xapp_rcv_thread;
+ std::vector<std::string> rnib_gnblist;
+ std::vector<XappMsgHandler> _callbacks;
};
};