diff --git a/include/INxData.h b/include/INxData.h index 47b5005fdd1b0d8a58fb9ee434dcb856512a794d..ca69f8b2605a43cbab7ea4bf04ba12a858a37f6d 100644 --- a/include/INxData.h +++ b/include/INxData.h @@ -21,17 +21,17 @@ namespace NJGIS public: virtual int isExist(); - virtual int getID(std::string& id) = 0; + virtual const char* getID() = 0; - virtual int getTag(std::string& tag) = 0; + virtual const char* getTag() = 0; - virtual int getGenarationDateTime(std::string& datetime) = 0; + virtual const char* getGenarationDateTime() = 0; - virtual int getType(NJGIS::SERVICE::NjDataType& type) = 0; + virtual NJGIS::SERVICE::NjDataType getType() = 0; - virtual int getSize(int& size) = 0; + virtual int getSize() = 0; - virtual int getValue(std::string& value) = 0; + virtual const char* getValue() = 0; virtual int save(const char* path) = 0; }; diff --git a/include/INxModelServiceRecord.h b/include/INxModelServiceRecord.h index bfe9ba55fc799bc2e9c2d1a2220cc60b31f446c8..f4a038ee3180bf5c958f2bd8bf09027c0b422e9d 100644 --- a/include/INxModelServiceRecord.h +++ b/include/INxModelServiceRecord.h @@ -4,8 +4,9 @@ #include #include -#include "INxUnknown.h" +#include "INxService.h" #include "INxDataConfiguration.h" +#include "INxModelService.h" namespace NJGIS @@ -20,22 +21,24 @@ namespace NJGIS } NjRecordStatus; - class INjModelServiceRecord : public virtual INxUnknown + class INjModelServiceRecord : public virtual INjService { public: - virtual int getID(std::string& id) = 0; + virtual const char* getID() = 0; - virtual int getServiceID(std::string& id) = 0; + virtual const char* getModelServiceID() = 0; - virtual int getStartDatetime(std::string& datetime) = 0; + virtual INjModelService* getModelService() = 0; - virtual int getTimeSpan(int& span) = 0; + virtual const char* getStartDatetime() = 0; - virtual int getInputData(INjDataConfiguration* &input) = 0; + virtual int getTimeSpan() = 0; - virtual int getOutputData(INjDataConfiguration* &output) = 0; + virtual INjDataConfiguration* getInputData() = 0; - virtual int getStatus(NjRecordStatus& status) = 0; + virtual INjDataConfiguration* getOutputData() = 0; + + virtual NjRecordStatus getStatus() = 0; virtual int getRunningInfo(std::string& stardout, std::string& standerr, std::string& invokeerr) = 0; diff --git a/include/INxServiceAccess.h b/include/INxServiceAccess.h index b59c894e33b77b4380b9e86cf6369fee28519277..ca3c4da47c96fd9a28b8a07e243b5aa3e8b02ff7 100644 --- a/include/INxServiceAccess.h +++ b/include/INxServiceAccess.h @@ -2,6 +2,7 @@ #define __NJGIS_INJSERVICEACCESS_H__ #include "INxModelService.h" +#include "INxData.h" #include namespace NJGIS @@ -19,6 +20,9 @@ namespace NJGIS //! get model servcie by name virtual int getModelServicesByName(const char* name, std::vector &list) = 0; + + //! get a data service + virtual NJGIS::SERVICE::INjData* getDataServiceByID(const char* id) = 0; }; } diff --git a/src/NxData.cpp b/src/NxData.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a3dde8884acfea025e7f1c0bde52acde691a27d5 --- /dev/null +++ b/src/NxData.cpp @@ -0,0 +1,42 @@ +#include "NxData.h" + +int NJGIS::SERVICE::NjData::isExist() +{ + return NULL; +} + +const char* NJGIS::SERVICE::NjData::getID() +{ + return NULL; +} + +const char* NJGIS::SERVICE::NjData::getTag() +{ + return NULL; +} + +const char* NJGIS::SERVICE::NjData::getGenarationDateTime() +{ + return NULL; +} + +NJGIS::SERVICE::NjDataType NJGIS::SERVICE::NjData::getType() +{ + return this->_type; +} + +int NJGIS::SERVICE::NjData::getSize() +{ + return NULL; +} + +const char* NJGIS::SERVICE::NjData::getValue() +{ + return NULL; +} + +int NJGIS::SERVICE::NjData::save( const char* path ) +{ + return NULL; +} + diff --git a/src/NxData.h b/src/NxData.h new file mode 100644 index 0000000000000000000000000000000000000000..825a895275e0e078dc8dfc1e898f84bc95ecaa10 --- /dev/null +++ b/src/NxData.h @@ -0,0 +1,47 @@ +#ifndef __NJGIS_NJDATA_H__ +#define __NJGIS_NJDATA_H__ + +#include "../include/INxData.h" +#include "NxService.h" + +namespace NJGIS +{ + namespace SERVICE + { + class NjData : public virtual INjData, public virtual NjService + { + public: + virtual int isExist(); + + virtual const char* getID(); + + virtual const char* getTag(); + + virtual const char* getGenarationDateTime(); + + virtual NJGIS::SERVICE::NjDataType getType(); + + virtual int getSize(); + + virtual const char* getValue(); + + virtual int save( const char* path ); + + private: + std::string _id; + + std::string _tag; + + int _size; + + std::string _genarationDateTime; + + NJGIS::SERVICE::NjDataType _type; + + std::string _value; + + }; + } +} + +#endif \ No newline at end of file diff --git a/src/NxDataFactory.cpp b/src/NxDataFactory.cpp new file mode 100644 index 0000000000000000000000000000000000000000..414625d202c81464bcb785b7ac9b3156ccde096e --- /dev/null +++ b/src/NxDataFactory.cpp @@ -0,0 +1,6 @@ +#include "NxDataFactory.h" + +NJGIS::SERVICE::INjData* NJGIS::SERVICE::NjDataFactory::createDataByJSON( Json::Value jData, const char* ip, int port ) +{ + return NULL; +} \ No newline at end of file diff --git a/src/NxDataFactory.h b/src/NxDataFactory.h new file mode 100644 index 0000000000000000000000000000000000000000..528aec4bec2638606cf248d527399663e09125ec --- /dev/null +++ b/src/NxDataFactory.h @@ -0,0 +1,19 @@ +#ifndef __NJGIS_NJDATAFACTORY_H__ +#define __NJGIS_NJDATAFACTORY_H__ + +#include "../include/INxData.h" +#include "json/json.h" + +namespace NJGIS +{ + namespace SERVICE + { + class NjDataFactory + { + public: + static NJGIS::SERVICE::INjData* createDataByJSON(Json::Value jData, const char* ip, int port); + }; + } +} + +#endif \ No newline at end of file diff --git a/src/NxModelService.cpp b/src/NxModelService.cpp index 943758a229418e9b8a35bfbba59975aea805b6bc..a39a008ab43534f78921b8211d1fe6971519e6c6 100644 --- a/src/NxModelService.cpp +++ b/src/NxModelService.cpp @@ -92,5 +92,6 @@ int NJGIS::SERVICE::NjModelService::invoke( const INjDataConfiguration* config, int NJGIS::SERVICE::NjModelService::refresh() { + //! TODO DX return NULL; } diff --git a/src/NxModelService.h b/src/NxModelService.h index 6d59776677937acbd0fb5bf4600e78652e518aac..bd657fdc97dbc78021382d1d3e6cf00be78ac623 100644 --- a/src/NxModelService.h +++ b/src/NxModelService.h @@ -90,6 +90,7 @@ namespace NJGIS virtual int invoke( const INjDataConfiguration* config, std::string& recordid ); + //! to refresh the information of this model service virtual int refresh(); private: diff --git a/src/NxModelServiceRecord.cpp b/src/NxModelServiceRecord.cpp new file mode 100644 index 0000000000000000000000000000000000000000..baa9dce2c87cfd14d88f21f8061868acf1708353 --- /dev/null +++ b/src/NxModelServiceRecord.cpp @@ -0,0 +1 @@ +#include "INxModelServiceRecord.h" diff --git a/src/NxModelServiceRecord.h b/src/NxModelServiceRecord.h new file mode 100644 index 0000000000000000000000000000000000000000..3ff240c3cba5f99295a26f582503ee1c80677987 --- /dev/null +++ b/src/NxModelServiceRecord.h @@ -0,0 +1,19 @@ +#ifndef __NJGIS_NJMODELSERVICERECORD_H__ +#define __NJGIS_NJMODELSERVICERECORD_H__ + +#include "../include/INxModelServiceRecord.h" +#include "NxService.h" + +namespace NJGIS +{ + namespace SERVICE + { + class NxModelServiceRecord : public virtual INjModelServiceRecord, public virtual NjService + { + public: + + }; + } +} + +#endif \ No newline at end of file diff --git a/src/NxServiceAccess.cpp b/src/NxServiceAccess.cpp index b3e387fed4e8447f8c2d688d84a4791abad0f267..0260f570d3a7b4a86ea1ce98923e0c1f591a3742 100644 --- a/src/NxServiceAccess.cpp +++ b/src/NxServiceAccess.cpp @@ -48,5 +48,12 @@ NJGIS::SERVICE::INjModelService* NJGIS::SERVICE::NjServiceAccess::getModelServic int NJGIS::SERVICE::NjServiceAccess::getModelServicesByName( const char* name, std::vector &list ) { - throw std::exception("The method or operation is not implemented."); -} \ No newline at end of file + //! TODO DX + return NULL: +} + +NJGIS::SERVICE::INjData* NJGIS::SERVICE::NjServiceAccess::getDataServiceByID( const char* id ) +{ + // TODO YL + return NULL: +} diff --git a/src/NxServiceAccess.h b/src/NxServiceAccess.h index a79c9f5b2da4bef3d41ed6a2842b1628c06401e9..d0451f175e2bdd763edeac5fe22ee2fa79269f18 100644 --- a/src/NxServiceAccess.h +++ b/src/NxServiceAccess.h @@ -19,6 +19,9 @@ namespace NJGIS virtual NJGIS::SERVICE::INjModelService* getModelServiceByOID( const char* oid ); virtual int getModelServicesByName( const char* name, std::vector &list ); + + virtual NJGIS::SERVICE::INjData* getDataServiceByID( const char* id ); + }; } }