//
// Created by Balazs Kiss on 2025. 02. 23..
//

#pragma once

#include <switchboard/export.h>
#include <switchboard_core/SwitchboardObject.hpp>

#include <map>
#include <any>

namespace switchboard {

class SWITCHBOARDSDK_EXPORT Node : public SwitchboardObject {
public:

    /**
     * @brief Node constructor.
     *
     * @param numberOfInputs The number of inputs for the node.
     * @param numberOfOutputs The number of outputs for the node.
     */
    Node(uint numberOfInputs, uint numberOfOutputs);

    /**
     * @brief Gets the type of the node.
     *
     * @returns The type of the node.
     */
    const std::string& getType() const;

    /**
     * @brief Gets the number of inputs for the node.
     *
     * @returns The number of inputs for the node.
     */
    unsigned int getNumberOfInputs() const;

    /**
     * @brief Gets the number of outputs for the node.
     *
     * @returns The number of outputs for the node.
     */
    unsigned int getNumberOfOutputs() const;

    // MARK: Overridden methods

    Result<SBAny> getValue(const std::string &key) override;
    Result<void> setValue(const std::string &key, const SBAny &value) override;
    Result<SBAny> callAction(const std::string& actionName, const SBAnyMap& params) override;

protected:
    /// @brief The type of the node.
    std::string type;

    /// @brief The number of inputs (audio buses) for the node.
    unsigned int numberOfInputs;

    /// @brief The number of outputs (audio buses) for the node.
    unsigned int numberOfOutputs;

    /// @brief The title of the node that can be displayed in the UI.
    std::string title;
};

}
