32 lines
1008 B
C++
32 lines
1008 B
C++
#pragma once
|
|
|
|
#include <memory>
|
|
|
|
#include <QHash>
|
|
#include <QString>
|
|
|
|
#include "core/plugin_system/IProtocolFramerPlugin.h"
|
|
#include "core/plugin_system/IProtocolPlugin.h"
|
|
|
|
namespace softbus::core::plugin_system
|
|
{
|
|
|
|
class PluginManager
|
|
{
|
|
public:
|
|
PluginManager() = default;
|
|
|
|
void registerProtocolPlugin(std::shared_ptr<IProtocolPlugin> plugin);
|
|
std::shared_ptr<IProtocolPlugin> selectProtocolPlugin(const QString& protocolHint) const;
|
|
void unregisterProtocolPlugin(const QString& pluginId);
|
|
void registerProtocolFramerPlugin(std::shared_ptr<IProtocolFramerPlugin> plugin);
|
|
std::shared_ptr<IProtocolFramerPlugin> selectProtocolFramerPlugin(const QString& protocolHint) const;
|
|
void unregisterProtocolFramerPlugin(const QString& pluginId);
|
|
|
|
private:
|
|
QHash<QString, std::shared_ptr<IProtocolPlugin>> m_protocolPlugins;
|
|
QHash<QString, std::shared_ptr<IProtocolFramerPlugin>> m_protocolFramerPlugins;
|
|
};
|
|
|
|
} // namespace softbus::core::plugin_system
|