Switchboard Extension SDK
Toggle main menu visibility
Loading...
Searching...
No Matches
NodeFactory.hpp
1
//
2
// NodeFactory.hpp
3
// SwitchboardSDK
4
//
5
// Created by Balazs Kiss on 2023. 07. 05..
6
//
7
8
#pragma once
9
10
#include <any>
11
#include <map>
12
#include <memory>
13
#include <string>
14
#include <switchboard/export.h>
15
#include <switchboard_core/Node.hpp>
16
#include <switchboard_core/NodeTypeInfo.hpp>
17
#include <vector>
18
19
namespace
switchboard {
20
25
class
SWITCHBOARDSDK_EXPORT
NodeFactory
{
26
public
:
30
NodeFactory
();
31
35
virtual
~NodeFactory
();
36
43
virtual
std::string
getNodeTypePrefix
() = 0;
44
51
virtual
std::vector<NodeTypeInfo>
getNodeTypes
();
52
62
virtual
Node
*
createNode
(
const
std::string& type,
const
SBAnyMap& config);
63
64
using
NodeCreator = std::function<
Node
*(
const
SBAnyMap&)>;
65
73
void
registerNode
(
const
NodeTypeInfo
& type, NodeCreator creator);
74
75
private
:
76
class
Impl;
77
std::unique_ptr<Impl> pImpl;
78
};
79
80
}
switchboard::NodeFactory::getNodeTypes
virtual std::vector< NodeTypeInfo > getNodeTypes()
Returns the list of node types that can be created by this factory.
switchboard::NodeFactory::~NodeFactory
virtual ~NodeFactory()
NodeFactory destructor.
switchboard::NodeFactory::createNode
virtual Node * createNode(const std::string &type, const SBAnyMap &config)
Creates an Node instance based on type information.
switchboard::NodeFactory::NodeFactory
NodeFactory()
NodeFactory constructor.
switchboard::NodeFactory::getNodeTypePrefix
virtual std::string getNodeTypePrefix()=0
Returns the prefix of the node type.
switchboard::NodeFactory::registerNode
void registerNode(const NodeTypeInfo &type, NodeCreator creator)
Registers a node type with the factory.
switchboard::Node
Definition
Node.hpp:14
switchboard::NodeTypeInfo
Definition
NodeTypeInfo.hpp:29
SwitchboardSDK
include
switchboard_core
NodeFactory.hpp
Generated by
1.18.0