Switchboard Extension SDK
Loading...
Searching...
No Matches
switchboard::NodeFactory Class Referenceabstract

Creates node instances. More...

#include <NodeFactory.hpp>

Public Member Functions

virtual std::string getNodeTypePrefix ()=0
 Returns the prefix of the node type.
virtual std::vector< std::string > getNodeTypes ()
 Returns the list of node types that can be created by this factory.
virtual NodecreateNode (const std::string &type, const std::map< std::string, std::any > &config)=0
 Creates an Node instance based on type information.

Detailed Description

Creates node instances.

NodeFactory class.

Member Function Documentation

◆ createNode()

virtual Node * switchboard::NodeFactory::createNode ( const std::string & type,
const std::map< std::string, std::any > & config )
pure virtual

Creates an Node instance based on type information.

The returned node instances need to be freed by the user of the NodeFactory.

Parameters
typeThe type of the node.
configConfiguration values for the node.
Returns
A pointer to the created Node instance, or nullptr if the node could not be created.

◆ getNodeTypePrefix()

virtual std::string switchboard::NodeFactory::getNodeTypePrefix ( )
pure virtual

Returns the prefix of the node type.

The prefix is used to identify the node type and it follows the format: <extension name>.<node type>.

Returns
The prefix of the node type.

◆ getNodeTypes()

virtual std::vector< std::string > switchboard::NodeFactory::getNodeTypes ( )
inlinevirtual

Returns the list of node types that can be created by this factory.

The node types are returned as a vector of strings, where each string is the type name of the node.

Returns
A vector of strings containing the node types.

The documentation for this class was generated from the following file: