#pragma once

#include <memory>

#include <QString>

#include "core/models/RawBusMessage.h"
#include "message_bus/pipeline/protocol/ProtocolEnvelope.h"

namespace softbus::core::plugin_system
{

class IProtocolSession
{
public:
    virtual ~IProtocolSession() = default;
    virtual bool parse(const softbus::core::models::RawBusMessage&                    ctx,
                       softbus::message_bus::pipeline::protocol::ProtocolEnvelope& out) = 0;
    virtual void reset() = 0;
};

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

    virtual QString pluginId() const = 0;
    virtual softbus::core::models::ProtocolType protocolType() const = 0;
    virtual std::unique_ptr<IProtocolSession> createSession() = 0;
};

} // namespace softbus::core::plugin_system
