#pragma once

#include <memory>
#include <vector>

#include <QJsonObject>
#include <QString>

#include "core/models/RawBusMessage.h"
#include "core/memory/MemoryPool.h"

namespace softbus::core::plugin_system
{

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

    virtual void feedChunk(softbus::core::models::RawBusMessage&             in,
                           std::vector<softbus::core::models::RawBusMessage>& out) = 0;
    virtual void reset() = 0;
    virtual void shutdown() = 0;
};

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

    virtual QString pluginId() const = 0;
    virtual softbus::core::models::ProtocolType protocolType() const = 0;
    virtual void bindMemoryPool(std::shared_ptr<softbus::core::memory::MemoryPool> pool) = 0;
    virtual std::unique_ptr<IProtocolFramerSession> createFramerSession(std::uint32_t       endpointHash,
                                                                         const QJsonObject& params) = 0;
};

} // namespace softbus::core::plugin_system
