Commit bae34edf authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

create nf_client inst

parent 0aae2894
...@@ -44,6 +44,8 @@ using namespace Pistache::Http::Mime; ...@@ -44,6 +44,8 @@ using namespace Pistache::Http::Mime;
using namespace oai::nrf::app; using namespace oai::nrf::app;
using json = nlohmann::json; using json = nlohmann::json;
extern nrf_client *nrf_client_inst;
// To read content of the response from NF // To read content of the response from NF
static std::size_t callback(const char *in, std::size_t size, std::size_t num, static std::size_t callback(const char *in, std::size_t size, std::size_t num,
std::string *out) { std::string *out) {
......
...@@ -42,7 +42,7 @@ namespace app { ...@@ -42,7 +42,7 @@ namespace app {
class nrf_client { class nrf_client {
private: private:
public: public:
nrf_client(); nrf_client(){};
nrf_client(nrf_client const &) = delete; nrf_client(nrf_client const &) = delete;
void operator=(nrf_client const &) = delete; void operator=(nrf_client const &) = delete;
...@@ -74,6 +74,5 @@ class nrf_client { ...@@ -74,6 +74,5 @@ class nrf_client {
}; };
} // namespace app } // namespace app
} // namespace nrf } // namespace nrf
} // namespace oai } // namespace oai
#endif /* FILE_NRF_CLIENT_HPP_SEEN */ #endif /* FILE_NRF_CLIENT_HPP_SEEN */
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "options.hpp" #include "options.hpp"
#include "pid_file.hpp" #include "pid_file.hpp"
#include "logger.hpp" #include "logger.hpp"
#include "nrf_client.hpp"
#include "pistache/endpoint.h" #include "pistache/endpoint.h"
#include "pistache/http.h" #include "pistache/http.h"
...@@ -36,6 +37,7 @@ using namespace util; ...@@ -36,6 +37,7 @@ using namespace util;
using namespace std; using namespace std;
nrf_app *nrf_app_inst = nullptr; nrf_app *nrf_app_inst = nullptr;
nrf_client *nrf_client_inst = nullptr;
nrf_config nrf_cfg; nrf_config nrf_cfg;
NRFApiServer *api_server = nullptr; NRFApiServer *api_server = nullptr;
...@@ -92,6 +94,9 @@ if ( !Options::parse( argc, argv ) ) ...@@ -92,6 +94,9 @@ if ( !Options::parse( argc, argv ) )
// NRF application layer // NRF application layer
nrf_app_inst = new nrf_app(Options::getlibconfigConfig(), ev); nrf_app_inst = new nrf_app(Options::getlibconfigConfig(), ev);
// NRF client
nrf_client_inst = new nrf_client();
//Task Manager //Task Manager
task_manager tm(ev); task_manager tm(ev);
std::thread task_manager_thread(&task_manager::run, &tm); std::thread task_manager_thread(&task_manager::run, &tm);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment