#pragma once

#include <optional>
#include <vector>

#include "devices/DeviceTypes.h"
#include "device_bus/monitor/DeviceEvent.h"

namespace softbus::device_bus::registry
{

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

    virtual void registerDevice(const softbus::devices::DeviceInfo& info) = 0;
    virtual void unregisterDevice(int id) = 0;

    virtual std::optional<softbus::devices::DeviceInfo> findById(int id) const = 0;
    virtual std::vector<softbus::devices::DeviceInfo> listDevices() const = 0;

    // Monitor-driven registry APIs
    virtual bool upsertFromMonitorEvent(const softbus::device_bus::monitor::DeviceEvent& ev) = 0;
    virtual bool markOfflineFromMonitorEvent(const softbus::device_bus::monitor::DeviceEvent& ev) = 0;
};

} // namespace softbus::device_bus::registry

