2020-04-29 18:02:36 +02:00
|
|
|
/****************************************************************************
|
2022-05-14 14:00:20 +02:00
|
|
|
* Copyright (C) 2020 Maschell
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
****************************************************************************/
|
2020-04-29 18:02:36 +02:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-12-16 17:36:57 +01:00
|
|
|
#include "PluginConfigData.h"
|
2020-04-29 18:02:36 +02:00
|
|
|
#include "PluginData.h"
|
2024-08-03 17:23:27 +02:00
|
|
|
#include "PluginLinkInformation.h"
|
2022-02-04 16:25:44 +01:00
|
|
|
#include "PluginMetaInformation.h"
|
2023-12-16 12:44:20 +01:00
|
|
|
#include "utils/storage/StorageUtils.h"
|
2022-02-04 16:25:44 +01:00
|
|
|
#include <memory>
|
2022-05-14 14:00:20 +02:00
|
|
|
#include <utility>
|
2023-12-16 17:36:57 +01:00
|
|
|
#include <wups/config_api.h>
|
2020-04-29 18:02:36 +02:00
|
|
|
|
|
|
|
class PluginContainer {
|
|
|
|
public:
|
2024-08-03 17:23:27 +02:00
|
|
|
PluginContainer(PluginMetaInformation metaInformation, std::optional<PluginLinkInformation> pluginLinkInformation, std::shared_ptr<PluginData> pluginData);
|
2024-03-24 07:40:58 +01:00
|
|
|
|
|
|
|
PluginContainer(const PluginContainer &) = delete;
|
|
|
|
|
2024-03-24 07:50:30 +01:00
|
|
|
PluginContainer(PluginContainer &&src);
|
2024-03-24 07:40:58 +01:00
|
|
|
|
2024-03-24 07:50:30 +01:00
|
|
|
PluginContainer &operator=(PluginContainer &&src);
|
2024-03-24 07:40:58 +01:00
|
|
|
|
2024-03-24 07:50:30 +01:00
|
|
|
[[nodiscard]] const PluginMetaInformation &getMetaInformation() const;
|
2024-03-24 07:40:58 +01:00
|
|
|
|
2024-08-03 17:23:27 +02:00
|
|
|
[[nodiscard]] const PluginLinkInformation *getPluginLinkInformation() const;
|
|
|
|
|
|
|
|
[[nodiscard]] PluginLinkInformation *getPluginLinkInformation();
|
2020-04-29 18:02:36 +02:00
|
|
|
|
2024-03-24 07:50:30 +01:00
|
|
|
[[nodiscard]] std::shared_ptr<PluginData> getPluginDataCopy() const;
|
2020-04-29 18:02:36 +02:00
|
|
|
|
2024-08-03 17:23:27 +02:00
|
|
|
[[nodiscard]] bool isPluginLinkedAndLoaded() const;
|
|
|
|
|
2024-03-24 07:50:30 +01:00
|
|
|
[[nodiscard]] uint32_t getHandle() const;
|
2020-04-29 18:02:36 +02:00
|
|
|
|
2024-03-24 07:50:30 +01:00
|
|
|
[[nodiscard]] const std::optional<PluginConfigData> &getConfigData() const;
|
2023-12-16 17:36:57 +01:00
|
|
|
|
2024-03-24 07:50:30 +01:00
|
|
|
void setConfigData(const PluginConfigData &pluginConfigData);
|
2023-12-16 17:36:57 +01:00
|
|
|
|
2024-03-24 07:50:30 +01:00
|
|
|
WUPSStorageError OpenStorage();
|
2023-12-16 12:44:20 +01:00
|
|
|
|
2024-03-24 07:50:30 +01:00
|
|
|
WUPSStorageError CloseStorage();
|
2023-12-16 12:44:20 +01:00
|
|
|
|
|
|
|
[[nodiscard]] wups_storage_root_item getStorageRootItem() const {
|
|
|
|
return storageRootItem;
|
|
|
|
}
|
|
|
|
|
2023-11-04 15:32:45 +01:00
|
|
|
private:
|
2024-03-24 07:40:58 +01:00
|
|
|
PluginMetaInformation mMetaInformation;
|
2024-08-03 17:23:27 +02:00
|
|
|
std::optional<PluginLinkInformation> mPluginLinkInformation;
|
2024-03-24 07:40:58 +01:00
|
|
|
std::shared_ptr<PluginData> mPluginData;
|
2023-12-16 12:44:20 +01:00
|
|
|
|
2023-12-16 17:36:57 +01:00
|
|
|
std::optional<PluginConfigData> mPluginConfigData;
|
2023-12-16 12:44:20 +01:00
|
|
|
wups_storage_root_item storageRootItem = nullptr;
|
2020-04-29 18:02:36 +02:00
|
|
|
};
|