mirror of
https://github.com/logos-storage/logos-storage-app-skeleton.git
synced 2026-06-14 04:19:25 +00:00
40 lines
1.0 KiB
C++
40 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include <QString>
|
|
#include <memory>
|
|
|
|
#include "logos_api.h"
|
|
|
|
// Logos manages the lifecycle of the Logos Core and its plugins.
|
|
// It handles initialization and cleanup of the Logos SDK.
|
|
//
|
|
// Usage:
|
|
// Logos logos(pluginsDir);
|
|
// if (!logos.init()) { return 1; }
|
|
//
|
|
// StorageModule storage(logos.api());
|
|
// LogosResult result = storage.version();
|
|
//
|
|
// // cleanup() is called automatically in destructor
|
|
class Logos {
|
|
public:
|
|
explicit Logos(const QString& pluginsDir);
|
|
~Logos();
|
|
|
|
// Initialize the Logos Core: set plugins directory, start, and load required plugins.
|
|
// Returns true on success.
|
|
bool init();
|
|
|
|
// Cleanup the Logos Core. Called automatically in destructor.
|
|
void cleanup();
|
|
|
|
// Access to the LogosAPI instance for use with module APIs (e.g. StorageModule).
|
|
// Returns nullptr if init() has not been called successfully.
|
|
LogosAPI* api() const;
|
|
|
|
private:
|
|
QString m_pluginsDir;
|
|
bool m_initialized = false;
|
|
std::unique_ptr<LogosAPI> m_api;
|
|
};
|