Atoms Crowd  7.0.0
AtomsGraph::NodeFactory Class Reference

Node factory. More...

#include <NodeFactory.h>

Public Types

typedef Node *(* creatorFn) ()
 

Public Member Functions

template<class T >
T * createNode (const std::string &typeName)
 Creates a new node. More...
 
NodecreateNode (const std::string &typeName)
 Creates a new node. More...
 
void registerNode (const std::string &name, creatorFn funct)
 Registers a node type. More...
 
void deregisterNode (const std::string &name)
 Deregisters a node type. More...
 
std::vector< std::string > getRegisteredNodes ()
 Gets a list of all the node type registered.
 
bool isRegistered (const std::string &name)
 Checks if a node type is registered.
 

Static Public Member Functions

static NodeFactoryinstance ()
 Singleton access.
 

Detailed Description

Node factory.

Class used to create node inside a NetworkManager. Every new node type must be registered in this factory.

Member Function Documentation

◆ createNode() [1/2]

template<class T >
T * AtomsGraph::NodeFactory::createNode ( const std::string &  typeName)

Creates a new node.

Parameters
typeNameNode type name

◆ createNode() [2/2]

Node* AtomsGraph::NodeFactory::createNode ( const std::string &  typeName)

Creates a new node.

Parameters
typeNameNode type name

◆ deregisterNode()

void AtomsGraph::NodeFactory::deregisterNode ( const std::string &  name)

Deregisters a node type.

Parameters
nameNode type name

◆ registerNode()

void AtomsGraph::NodeFactory::registerNode ( const std::string &  name,
creatorFn  funct 
)

Registers a node type.

Parameters
nameNode type name
functNode create function

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