From ccbc4ffe2a72e425a3ca5a68aa4c35dc2009f576 2017-12-11 09:29:38 From: Alexandre Leroux Date: 2017-12-11 09:29:38 Subject: [PATCH] Creates AMDAServer class AmdaServer class declares an AMDA server. Implementations will return server name and server url --- diff --git a/plugins/amda/include/AmdaServer.h b/plugins/amda/include/AmdaServer.h new file mode 100644 index 0000000..9c6c0f1 --- /dev/null +++ b/plugins/amda/include/AmdaServer.h @@ -0,0 +1,28 @@ +#ifndef SCIQLOP_AMDASERVER_H +#define SCIQLOP_AMDASERVER_H + +#include + +#include + +Q_DECLARE_LOGGING_CATEGORY(LOG_AmdaServer) + +/** + * @brief The AmdaServer class represents the server used to retrieve AMDA data (singleton). + * + * The server instance is initialized at compile time, as defined by the AMDA_SERVER value. + */ +class AmdaServer { +public: + /// @return the unique instance of the AMDA server + static AmdaServer &instance(); + + virtual ~AmdaServer() noexcept = default; + + /// @return the name of the server + virtual QString name() const = 0; + /// @return the url of the server (used to retrieve data) + virtual QString url() const = 0; +}; + +#endif // SCIQLOP_AMDASERVER_H diff --git a/plugins/amda/meson.build b/plugins/amda/meson.build index 7f2e2c3..4ce7c5e 100644 --- a/plugins/amda/meson.build +++ b/plugins/amda/meson.build @@ -11,7 +11,8 @@ amdaplugin_sources = [ 'src/AmdaProvider.cpp', 'src/AmdaResultParser.cpp', 'src/AmdaResultParserDefs.cpp', - 'src/AmdaResultParserHelper.cpp' + 'src/AmdaResultParserHelper.cpp', + 'src/AmdaServer.cpp' ] amdaplugin_ui_files = [] diff --git a/plugins/amda/src/AmdaServer.cpp b/plugins/amda/src/AmdaServer.cpp new file mode 100644 index 0000000..09aca3f --- /dev/null +++ b/plugins/amda/src/AmdaServer.cpp @@ -0,0 +1,8 @@ +#include "AmdaServer.h" + +Q_LOGGING_CATEGORY(LOG_AmdaServer, "AmdaServer") + +AmdaServer &AmdaServer::instance() +{ + /// @todo ALX +}