/** @file * @author Edouard DUPIN * @copyright 2016, Edouard DUPIN, all right reserved * @license APACHE v2.0 (see license file) */ #pragma once #include #include #include #include #include #include namespace jus { class RemoteProcessCall { protected: std::vector m_listFunction; protected: std::string m_description; public: void setDescription(const std::string& _desc); const std::string& getDescription() const; protected: std::string m_version; public: void setVersion(const std::string& _desc); const std::string& getVersion() const; protected: std::vector> m_authors; public: void addAuthor(const std::string& _name, const std::string& _email); const std::vector>& getAuthors() const; public: void setLastFuncDesc(const std::string& _desc); void setFuncDesc(const std::string& _funcName, const std::string& _desc); void addLastFuncParam(const std::string& _name, const std::string& _desc); void setFuncParam(const std::string& _funcName, int32_t _idParam, const std::string& _name, const std::string& _desc); public: template void advertise(const std::string& _name, JUS_RETURN_VALUE (*_func)(JUS_FUNC_ARGS_TYPE... _args), const std::string& _desc = "") { for (auto &it : m_listFunction) { if (it == nullptr) { continue; } if (it->getName() == _name) { JUS_ERROR("Advertise function already bind .. ==> can not be done...: '" << _name << "'"); return; } } AbstractFunction* tmp = createAbstractFunctionDirect(_name, _desc, _func); m_listFunction.push_back(tmp); } }; }