#pragma once

#include <QHash>
#include <QSharedPointer>
#include <QString>
#include <vector>

#include "message_bus/egress/IEgressPort.h"

namespace softbus::devices::physical { class SerialDevice; }

namespace softbus::message_bus::egress
{

class EgressRouter : public IEgressPort
{
public:
    EgressRouter() = default;
    ~EgressRouter() override = default;

    void bindSerialDevice(const QString& endpoint,
                          const QSharedPointer<softbus::devices::physical::SerialDevice>& device);
    void unbindSerialDevice(const QString& endpoint);
    bool send(const softbus::message_bus::pipeline::PipelineContext& ctx) override;

private:
    QHash<QString, QSharedPointer<softbus::devices::physical::SerialDevice>> m_serialByEndpoint;
};

} // namespace softbus::message_bus::egress
