27 lines
657 B
C++
27 lines
657 B
C++
#pragma once
|
|
|
|
#include <a8/singleton.h>
|
|
|
|
class JsonDataMgr : public a8::Singleton<JsonDataMgr>
|
|
{
|
|
private:
|
|
JsonDataMgr() {};
|
|
friend class a8::Singleton<JsonDataMgr>;
|
|
|
|
public:
|
|
void Init();
|
|
void UnInit();
|
|
|
|
std::shared_ptr<a8::XObject> GetConf();
|
|
std::shared_ptr<a8::XObject> GetMasterServerClusterConf();
|
|
bool GetNodeHost(int node_id, std::string& host);
|
|
|
|
private:
|
|
std::string work_path_ = "../config";
|
|
a8::XObject wsproxyserver_cluster_json_;
|
|
a8::XObject masterserver_cluster_json_;
|
|
std::mutex* node_host_mutex_ = nullptr;
|
|
a8::XObject routing_tables_json_;
|
|
std::map<int, std::string> node_host_hash_;
|
|
};
|