plugify 1.0.0.0
Loading...
Searching...
No Matches
plugify.hpp
1#pragma once
2
3#include <cstdint>
4#include <filesystem>
5#include <memory>
6#include <span>
7
8#include "config.hpp"
9#include "version.hpp"
10
11#include <plugify_export.h>
12
13namespace plugify {
14 class ILogger;
15 class IPlugifyProvider;
16 class IPluginManager;
17 class IPackageManager;
18 enum class Severity;
19
27 class IPlugify {
28 public:
29 virtual ~IPlugify() = default;
30
36 virtual bool Initialize(const std::filesystem::path& rootDir = {}) = 0;
37
41 virtual void Terminate() = 0;
42
47 virtual bool IsInitialized() const = 0;
48
53 virtual void Update() = 0;
54
60 virtual void SetLogger(std::shared_ptr<ILogger> logger) = 0;
61
67 virtual void Log(std::string_view msg, Severity severity) = 0;
68
78 virtual bool AddRepository(std::string_view repository) = 0;
79
84 virtual std::weak_ptr<IPlugifyProvider> GetProvider() const = 0;
85
90 virtual std::weak_ptr<IPluginManager> GetPluginManager() const = 0;
91
96 virtual std::weak_ptr<IPackageManager> GetPackageManager() const = 0;
97
102 virtual const Config& GetConfig() const = 0;
103
108 virtual plg::version GetVersion() const = 0;
109 };
110
115 PLUGIFY_API std::shared_ptr<IPlugify> MakePlugify();
116} // namespace plugify
Interface for the Plugify system.
Definition plugify.hpp:27
virtual plg::version GetVersion() const =0
Get the version information of the Plugify system.
virtual bool AddRepository(std::string_view repository)=0
Add a repository to the config.
virtual void SetLogger(std::shared_ptr< ILogger > logger)=0
Set the logger for the Plugify system.
virtual std::weak_ptr< IPlugifyProvider > GetProvider() const =0
Get a weak pointer to the Plugify provider.
virtual void Log(std::string_view msg, Severity severity)=0
Log a message with the specified severity level.
virtual bool IsInitialized() const =0
Check if the Plugify system is initialized.
virtual void Terminate()=0
Terminate the Plugify system.
virtual void Update()=0
Update the Plugify system. @noreturn.
virtual std::weak_ptr< IPackageManager > GetPackageManager() const =0
Get a weak pointer to the Package Manager.
virtual std::weak_ptr< IPluginManager > GetPluginManager() const =0
Get a weak pointer to the Plugin Manager.
virtual const Config & GetConfig() const =0
Get the configuration of the Plugify system.
virtual bool Initialize(const std::filesystem::path &rootDir={})=0
Initialize the Plugify system.
Represents configuration settings for a program.
Definition config.hpp:14