2025-09-30 14:56:47 -04:00
|
|
|
#ifndef LOGOS_API_H
|
|
|
|
|
#define LOGOS_API_H
|
|
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
#include <QString>
|
|
|
|
|
#include <QHash>
|
2026-04-16 12:34:22 -04:00
|
|
|
#include <string>
|
2026-02-25 18:13:43 +04:00
|
|
|
#include "logos_types.h"
|
2025-09-30 14:56:47 -04:00
|
|
|
|
|
|
|
|
class LogosAPIClient;
|
|
|
|
|
class LogosAPIProvider;
|
|
|
|
|
class TokenManager;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief LogosAPI provides a unified interface to the Logos SDK
|
|
|
|
|
*
|
|
|
|
|
* This class initializes and keeps instances of the client provider and token manager.
|
|
|
|
|
*/
|
|
|
|
|
class LogosAPI : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
/**
|
|
|
|
|
* @brief Construct a new LogosAPI instance
|
|
|
|
|
* @param module_name The name of this module
|
|
|
|
|
* @param parent Parent QObject
|
|
|
|
|
*/
|
|
|
|
|
explicit LogosAPI(const QString& module_name, QObject *parent = nullptr);
|
2026-04-16 12:34:22 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Construct a new LogosAPI instance (const char* overload — resolves ambiguity)
|
|
|
|
|
*/
|
|
|
|
|
explicit LogosAPI(const char* module_name, QObject *parent = nullptr)
|
|
|
|
|
: LogosAPI(QString(module_name), parent) {}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Construct a new LogosAPI instance (std::string overload)
|
|
|
|
|
*/
|
|
|
|
|
explicit LogosAPI(const std::string& module_name, QObject *parent = nullptr);
|
2025-09-30 14:56:47 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Destructor
|
|
|
|
|
*/
|
|
|
|
|
~LogosAPI();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get the client provider instance
|
|
|
|
|
* @return LogosAPIProvider* Pointer to the provider
|
|
|
|
|
*/
|
|
|
|
|
LogosAPIProvider* getProvider() const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get the client instance for communicating with a module
|
|
|
|
|
* @param target_module The module to communicate with
|
|
|
|
|
* @return LogosAPIClient* Pointer to the client
|
|
|
|
|
*/
|
|
|
|
|
LogosAPIClient* getClient(const QString& target_module) const;
|
|
|
|
|
|
2026-04-16 12:34:22 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Get the client instance — const char* overload (resolves ambiguity)
|
|
|
|
|
*/
|
|
|
|
|
LogosAPIClient* getClient(const char* target_module) const
|
|
|
|
|
{ return getClient(QString(target_module)); }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get the client instance for communicating with a module (std::string overload)
|
|
|
|
|
*/
|
|
|
|
|
LogosAPIClient* getClient(const std::string& target_module) const;
|
|
|
|
|
|
2025-09-30 14:56:47 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Get the token manager instance
|
|
|
|
|
* @return TokenManager* Pointer to the token manager
|
|
|
|
|
*/
|
|
|
|
|
TokenManager* getTokenManager() const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QString m_module_name;
|
|
|
|
|
LogosAPIProvider* m_provider;
|
|
|
|
|
mutable QHash<QString, LogosAPIClient*> m_clients; // Cache of clients per target module
|
|
|
|
|
TokenManager* m_token_manager;
|
|
|
|
|
};
|
|
|
|
|
|
2026-02-25 18:13:43 +04:00
|
|
|
#endif // LOGOS_API_H
|