#pragma once

#include <memory>

#include "core/memory/MemoryPool.h"
#include "message_bus/ingress/IIngressPort.h"

namespace softbus::message_bus::pipeline { class PipelineEngine; }

namespace softbus::message_bus::ingress
{

class DriverIngressAdapter : public IIngressPort
{
public:
    DriverIngressAdapter(std::shared_ptr<softbus::core::memory::MemoryPool> pool,
                         softbus::message_bus::pipeline::PipelineEngine* engine);

    bool push(softbus::message_bus::pipeline::PipelineContext ctx) override;
    void reportError(const QString& endpoint, const QString& error) override;

    softbus::core::memory::MemoryPool& pool() const { return *m_pool; }

private:
    std::shared_ptr<softbus::core::memory::MemoryPool> m_pool;
    softbus::message_bus::pipeline::PipelineEngine* m_engine{nullptr};
};

} // namespace softbus::message_bus::ingress
