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"
|
2024-11-27 20:44:36 +01:00
|
|
|
|
2022-02-04 16:25:44 +01:00
|
|
|
#include <memory>
|
2024-11-27 20:44:36 +01:00
|
|
|
#include <optional>
|
|
|
|
#include <wups/storage.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);
|
2020-05-17 20:43:04 +02:00
|
|
|
|
2024-03-24 07:40:58 +01:00
|
|
|
PluginContainer(const PluginContainer &) = delete;
|
|
|
|
|
2024-08-03 17:23:27 +02:00
|
|
|
PluginContainer(PluginContainer &&src);
|
2024-03-24 07:40:58 +01:00
|
|
|
|
2024-08-03 17:23:27 +02: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
|
|
|
|
2024-11-27 20:44:20 +01:00
|
|
|
[[nodiscard]] wups_storage_root_item getStorageRootItem() const;
|
|
|
|
|
|
|
|
void setInitDone(bool val);
|
|
|
|
|
|
|
|
[[nodiscard]] bool isInitDone() const;
|
2023-12-16 12:44:20 +01:00
|
|
|
|
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
|
|
|
|
2024-08-03 17:23:27 +02:00
|
|
|
std::optional<PluginConfigData> mPluginConfigData = std::nullopt;
|
|
|
|
wups_storage_root_item mStorageRootItem = nullptr;
|
|
|
|
bool mInitDone = false;
|
2020-04-29 18:02:36 +02:00
|
|
|
};
|