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 <switchboard/export.h>
11
#include <switchboard_core/NodeTypeInfo.hpp>
12
#include <switchboard_core/Node.hpp>
13
14
#include <any>
15
#include <vector>
16
#include <map>
17
#include <string>
18
#include <memory>
19
20
namespace
switchboard {
21
26
class
SWITCHBOARDSDK_EXPORT
NodeFactory
{
27
public
:
28
32
NodeFactory
();
33
37
virtual
~NodeFactory
();
38
45
virtual
std::string
getNodeTypePrefix
() = 0;
46
53
virtual
std::vector<NodeTypeInfo>
getNodeTypes
();
54
64
virtual
Node
*
createNode
(
const
std::string& type,
const
SBAnyMap& config);
65
66
67
using
NodeCreator = std::function<
Node
*(
const
SBAnyMap&)>;
68
76
void
registerNode
(
const
NodeTypeInfo
& type, NodeCreator creator);
77
78
private
:
79
class
Impl;
80
std::unique_ptr<Impl> pImpl;
81
};
82
83
}
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:15
switchboard::NodeTypeInfo
Definition
NodeTypeInfo.hpp:29
SwitchboardSDK
include
switchboard_core
NodeFactory.hpp
Generated by
1.17.0