#pragma once

#include <softbus_bus/Bus.h>
#include <softbus_core/plugin/PluginLoader.h>
#include <softbus_opcua/UaModelBinder.h>
#include <softbus_registry/PointRegistry.h>

namespace softbus::pipeline {

class PipelineEngine {
public:
    PipelineEngine(softbus::core::PluginLoader* plugin,
                   softbus::opcua::UaModelBinder* binder,
                   softbus::registry::PointRegistry* registry);

    void attachBus(softbus::bus::Bus* bus);
    void process(const softbus::core::RawPacket& packet);

private:
    void onBusMessage(const softbus::bus::BusMessage& message);
    void publishDataPoint(const softbus::core::DOMMessage& message,
                          const softbus::registry::PointTableEntry& entry);

    softbus::core::PluginLoader* plugin_{nullptr};
    softbus::opcua::UaModelBinder* binder_{nullptr};
    softbus::registry::PointRegistry* registry_{nullptr};
    softbus::bus::Bus* bus_{nullptr};
    softbus::bus::Bus::SubscriptionId rawSub_{0};
};

} // namespace softbus::pipeline
