diff --git a/src/NxRunningLogFactory.cpp b/src/NxRunningLogFactory.cpp new file mode 100644 index 0000000000000000000000000000000000000000..89e1cd2b5c80e419bb40190ac78d573c80fe4428 --- /dev/null +++ b/src/NxRunningLogFactory.cpp @@ -0,0 +1,16 @@ +#include "NxRunningLogFactory.h" +#include "NxRunningLog.h" + +NJGIS::SERVICE::INjRunningLog* NJGIS::SERVICE::NJRunningLogFactory::createRunningLogByJSON(Json::Value &JLog, const char* ip, int port){ + + std::string type = JLog["Type"].asString(); + std::string state = JLog["State"].asString(); + std::string event = JLog["Event"].asString(); + int flag = JLog["Flag"].asInt(); + std::string message = JLog["Message"].asString(); + std::string datetime = JLog["Datetime"].asString(); + + INjRunningLog* pRl = new NjRunningLog(type.c_str(),state.c_str(),event.c_str(),flag,message.c_str(),datetime.c_str(),ip,port); + + return pRl; +} diff --git a/src/NxRunningLogFactory.h b/src/NxRunningLogFactory.h new file mode 100644 index 0000000000000000000000000000000000000000..da328ddadf57fbc8bf5bc0c4373f3a5455912149 --- /dev/null +++ b/src/NxRunningLogFactory.h @@ -0,0 +1,21 @@ +#ifndef __NJGIS_NJRUNNINGLOGFACTORY_H_ +#define __NJGIS_NJRUNNINGLOGFACTORY_H_ + +#include "json/json.h" +#include "../include/INxRunningLog.h" + +namespace NJGIS +{ + namespace SERVICE + { + class NJRunningLogFactory + { + public: + static INjRunningLog* createRunningLogByJSON(Json::Value &jLog, const char* ip, int port); + protected: + private: + }; + } +} + +#endif