#pragma once

#include <memory>
#include <vector>

#include <QJsonObject>
#include <QString>

#include "core/memory/MemoryPool.h"
#include "message_bus/pipeline/PipelineContext.h"

namespace softbus::core::plugin_system
{

class IProtocolFramerSession
{
public:
    virtual ~IProtocolFramerSession() = default;

    virtual void feedChunk(softbus::message_bus::pipeline::PipelineContext&             in,
                           std::vector<softbus::message_bus::pipeline::PipelineContext>& out) = 0;
    virtual void reset() = 0;
    virtual void shutdown() = 0;
};

class IProtocolFramerPlugin
{
public:
    virtual ~IProtocolFramerPlugin() = default;

    virtual QString pluginId() const = 0;
    virtual bool supports(const QString& protocolHint) const = 0;
    virtual void bindMemoryPool(std::shared_ptr<softbus::core::memory::MemoryPool> pool) = 0;
    virtual std::unique_ptr<IProtocolFramerSession> createFramerSession(const QString&     endpoint,
                                                                         const QJsonObject& params) = 0;
};

} // namespace softbus::core::plugin_system
