Atoms Crowd  4.1.0
AtomsGraph::NetworkManager Class Reference

Network manager class. More...

#include <NetworkManager.h>

Public Member Functions

 NetworkManager ()
 Constructor.
 
 ~NetworkManager ()
 Destructor.
 
 NetworkManager (const NetworkManager &other)
 Copy constructor.
 
NetworkManageroperator= (const NetworkManager &other)
 Assign operator.
 
NodecreateNode (const std::string &typeName, const std::string &name)
 Creates a node inside this graph. More...
 
bool renameNode (const std::string &name, const std::string &newName)
 Renames a node inside this graph. More...
 
void addNode (Node *node, const std::string &name)
 Adds a node to the graph. More...
 
void deleteNode (const std::string &name)
 Deletes a node. More...
 
bool connectAttr (const std::string &sourceNode, const std::string &sourceAttribute, const std::string &destinationNode, const std::string &destinationAttribute)
 Connects two nodes.
 
bool disconnectAttr (const std::string &sourceNode, const std::string &sourceAttribute, const std::string &destinationNode, const std::string &destinationAttribute)
 Disconnects two nodes.
 
NodegetNode (const std::string &name)
 Gets the node with the given name. More...
 
template<class T >
T * getNode (const std::string &name)
 Gets the node with the given name. More...
 
std::vector< Node * > getAllNodes ()
 Gets all nodes of the graph.
 
std::vector< std::string > getNodeNames ()
 Gets all node names of the graph.
 
void computeNode (const std::string &nodeName, const AtomsGraph::ComputeData *computeData, bool multithread=false, bool useNetworkCache=false)
 Evaluates a node and the incoming graph. More...
 
NetworkManager clone () const
 Clones the graph.
 
void cleanNetwork ()
 Deletes all the nodes.
 
void cacheNodeNetwork (const std::string &nodeName)
 Cache nodes order. More...
 
void clearNodeNetworkCache (const std::string &nodeName)
 Clear a cache.
 
void clearNodeNetworkCaches ()
 Clear all caches.
 
void reset ()
 Reset the network without deleting the node cached.
 
void clearNodeCache ()
 Clear the node cache removing all the nodes that are not in use.
 
void setAllNodeDirty ()
 Set all nodes as dirty.
 

Protected Member Functions

std::string getUniqueName (const std::string &name)
 Generates an unique node name.
 

Detailed Description

Network manager class.

Member Function Documentation

◆ addNode()

void AtomsGraph::NetworkManager::addNode ( Node node,
const std::string &  name 
)

Adds a node to the graph.

Parameters
nodeNode
nameNode name

◆ cacheNodeNetwork()

void AtomsGraph::NetworkManager::cacheNodeNetwork ( const std::string &  nodeName)

Cache nodes order.

The computation order of the nodes is cached starting from a specific node. The cache is later used to compute the graph without traversing the graph connection. This improve the performance when a node is computed multiple times

Parameters
nodeNameNode name

◆ computeNode()

void AtomsGraph::NetworkManager::computeNode ( const std::string &  nodeName,
const AtomsGraph::ComputeData computeData,
bool  multithread = false,
bool  useNetworkCache = false 
)

Evaluates a node and the incoming graph.

Parameters
nodeNameNode name
multithreadEvaluate the graph using multiple threads

◆ createNode()

Node* AtomsGraph::NetworkManager::createNode ( const std::string &  typeName,
const std::string &  name 
)

Creates a node inside this graph.

Parameters
typeNameNode type
nameNode name
Returns
New node created

◆ deleteNode()

void AtomsGraph::NetworkManager::deleteNode ( const std::string &  name)

Deletes a node.

Parameters
nameNode name

◆ getNode() [1/2]

Node* AtomsGraph::NetworkManager::getNode ( const std::string &  name)

Gets the node with the given name.

Parameters
nameNode name

◆ getNode() [2/2]

template<class T >
T * AtomsGraph::NetworkManager::getNode ( const std::string &  name)

Gets the node with the given name.

Parameters
nameNode name

◆ renameNode()

bool AtomsGraph::NetworkManager::renameNode ( const std::string &  name,
const std::string &  newName 
)

Renames a node inside this graph.

Parameters
nameOld name
newNameNew name

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