#pragma once

#include <softbus_api/ExecuteCommand.h>

#include <functional>
#include <string>

struct UA_Server;

namespace softbus::opcua {

using ExecuteCommandHandler = std::function<std::string(const softbus::api::ExecuteCommand&)>;

class UaMethodBinder {
public:
    explicit UaMethodBinder(UA_Server* server);

    bool bindExecuteCommand(ExecuteCommandHandler handler);
    std::string dispatchCommand(const softbus::api::ExecuteCommand& command);

private:
    UA_Server* server_{nullptr};
    ExecuteCommandHandler handler_;
};

} // namespace softbus::opcua
