Switchboard Extension SDK
Loading...
Searching...
No Matches
Node.hpp
1//
2// Created by Balazs Kiss on 2025. 02. 23..
3//
4
5#pragma once
6
7#include "SwitchboardObject.hpp"
8
9#include <map>
10#include <any>
11
12namespace switchboard {
13
14class Node : public SwitchboardObject {
15public:
16
23 Node(const uint numberOfInputs, const uint numberOfOutputs);
24
26 std::string name;
27
33 const std::string& getType() const;
34
40 unsigned int getNumberOfInputs() const;
41
47 unsigned int getNumberOfOutputs() const;
48
49 // MARK: Overridden methods
50
51 Result<std::any> getValue(const std::string &key) override;
52 Result<void> setValue(const std::string &key, const std::any &value) override;
53 Result<std::any> callAction(const std::string& actionName, const std::map<std::string, std::any>& params) override;
54
55protected:
56 std::string type;
57 unsigned int numberOfInputs;
58 unsigned int numberOfOutputs;
59};
60
61}
Result< std::any > callAction(const std::string &actionName, const std::map< std::string, std::any > &params) override
Calls an action on the object.
Result< void > setValue(const std::string &key, const std::any &value) override
Sets a value on the object.
Node(const uint numberOfInputs, const uint numberOfOutputs)
Node constructor.
Result< std::any > getValue(const std::string &key) override
Gets a value from the object.
std::string name
The name of the node.
Definition Node.hpp:26
const std::string & getType() const
Gets the type of the node.
unsigned int getNumberOfInputs() const
Gets the number of inputs for the node.
unsigned int getNumberOfOutputs() const
Gets the number of outputs for the node.