0.2.0
Loading...
Searching...
No Matches
NodeManager.hpp File Reference

Manages all Nodes. More...

Go to the source code of this file.

Functions

void NAV::NodeManager::AddLink (ax::NodeEditor::LinkId linkId)
 Adds the link.
 
void NAV::NodeManager::AddNode (Node *node)
 Add the provided node object to the list of nodes.
 
void NAV::NodeManager::ClearAllNodeQueues ()
 Clears all nodes queues.
 
template<typename T , typename = std::enable_if_t<std::is_base_of_v<Node, T>>>
InputPinNAV::NodeManager::CreateInputPin (Node *node, const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier, void(T::*notifyFunc)(const InsTime &, size_t), int idx=-1)
 Create an Input Pin object.
 
InputPinNAV::NodeManager::CreateInputPin (Node *node, const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier={}, InputPin::Callback callback=static_cast< InputPin::FlowFirableCallbackFunc >(nullptr), InputPin::FlowFirableCheckFunc firable=nullptr, int priority=0, int idx=-1)
 Create an Input Pin object.
 
template<typename T , typename = std::enable_if_t<std::is_base_of_v<Node, T>>>
InputPinNAV::NodeManager::CreateInputPin (Node *node, const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier={}, void(T::*callback)(InputPin::NodeDataQueue &, size_t)=nullptr, InputPin::FlowFirableCheckFunc firable=nullptr, int priority=0, int idx=-1)
 Create an Input Pin object.
 
OutputPinNAV::NodeManager::CreateOutputPin (Node *node, const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier, OutputPin::PinData data=static_cast< void * >(nullptr), int idx=-1)
 Create an Output Pin object.
 
template<typename T , typename = std::enable_if_t<std::is_base_of_v<Node, T>>>
OutputPinNAV::NodeManager::CreateOutputPin (Node *node, const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier, std::shared_ptr< const NAV::NodeData >(T::*peekPollDataFunc)(size_t, bool)=nullptr, int idx=-1)
 Create an Output Pin object for Flow Pins.
 
template<typename T , typename = std::enable_if_t<std::is_base_of_v<Node, T>>>
OutputPinNAV::NodeManager::CreateOutputPin (Node *node, const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier, std::shared_ptr< const NAV::NodeData >(T::*pollDataFunc)()=nullptr, int idx=-1)
 Create an Output Pin object for Flow Pins.
 
void NAV::NodeManager::DeleteAllNodes ()
 Delete all nodes.
 
bool NAV::NodeManager::DeleteInputPin (InputPin &pin)
 Deletes the input pin. Invalidates the pin reference given.
 
bool NAV::NodeManager::DeleteNode (ax::NodeEditor::NodeId nodeId)
 Delete the node provided by id.
 
bool NAV::NodeManager::DeleteOutputPin (OutputPin &pin)
 Deletes the output pin. Invalidates the pin reference given.
 
void NAV::NodeManager::DisableAllCallbacks ()
 Disables all Node callbacks.
 
void NAV::NodeManager::EnableAllCallbacks ()
 Enables all Node callbacks.
 
InputPinNAV::NodeManager::FindInputPin (ax::NodeEditor::PinId id)
 Finds the Pin for the PinId.
 
NodeNAV::NodeManager::FindNode (ax::NodeEditor::NodeId id)
 Finds the Node for the NodeId.
 
OutputPinNAV::NodeManager::FindOutputPin (ax::NodeEditor::PinId id)
 Finds the Pin for the PinId.
 
ax::NodeEditor::LinkId NAV::NodeManager::GetNextLinkId ()
 Generates a new link id.
 
ax::NodeEditor::NodeId NAV::NodeManager::GetNextNodeId ()
 Generates a new node id.
 
ax::NodeEditor::PinId NAV::NodeManager::GetNextPinId ()
 Generates a new pin id.
 
bool NAV::NodeManager::InitializeAllNodes ()
 Initializes all nodes.
 
void NAV::NodeManager::InitializeAllNodesAsync ()
 Initializes all nodes in a separate thread.
 
const std::vector< Node * > & NAV::NodeManager::m_Nodes ()
 List of all registered Nodes.
 
void NAV::NodeManager::UpdateNode (Node *node)
 Update the provided node object.
 

Variables

bool NAV::NodeManager::showFlowWhenInvokingCallbacks
 Flag if invokeCallbacks triggers a GUI Flow event.
 
bool NAV::NodeManager::showFlowWhenNotifyingValueChange
 Flag if notifyOutputValueChanged & notifyInputValueChanged triggers a GUI Flow event.
 

Detailed Description

Manages all Nodes.

Author
T. Topp (topp@.nosp@m.ins..nosp@m.uni-s.nosp@m.tutt.nosp@m.gart..nosp@m.de)
Date
2020-12-14

Function Documentation

◆ AddLink()

void NAV::NodeManager::AddLink ( ax::NodeEditor::LinkId linkId)

Adds the link.

Parameters
[in]linkIdUnique Id of the link

◆ AddNode()

void NAV::NodeManager::AddNode ( Node * node)

Add the provided node object to the list of nodes.

Parameters
[in]nodeNode object to add to the list

◆ CreateInputPin() [1/3]

template<typename T , typename = std::enable_if_t<std::is_base_of_v<Node, T>>>
InputPin * NAV::NodeManager::CreateInputPin ( Node * node,
const char * name,
Pin::Type pinType,
const std::vector< std::string > & dataIdentifier,
void(T::*)(const InsTime &, size_t) notifyFunc,
int idx = -1 )

Create an Input Pin object.

Template Parameters
TNode Class where the function is member of
Parameters
[in]nodeNode to register the Pin for
[in]nameDisplay name of the Pin
[in]pinTypeType of the pin
[in]dataIdentifierIdentifier of the data which is represented by the pin
[in]notifyFuncFunction to call when the data is updated
[in]idxIndex where to put the new pin (-1 means at the end)
Returns
Pointer to the created pin

◆ CreateInputPin() [2/3]

InputPin * NAV::NodeManager::CreateInputPin ( Node * node,
const char * name,
Pin::Type pinType,
const std::vector< std::string > & dataIdentifier = {},
InputPin::Callback callback = static_cast< InputPin::FlowFirableCallbackFunc >(nullptr),
InputPin::FlowFirableCheckFunc firable = nullptr,
int priority = 0,
int idx = -1 )

Create an Input Pin object.

Parameters
[in]nodeNode to register the Pin for
[in]nameDisplay name of the Pin
[in]pinTypeType of the pin
[in]dataIdentifierIdentifier of the data which is represented by the pin
[in]callbackCallback to register with the pin
[in]firableFunction to check whether the callback is firable
[in]priorityPriority when checking firable condition related to other pins (higher priority gets triggered first)
[in]idxIndex where to put the new pin (-1 means at the end)
Returns
Pointer to the created pin

◆ CreateInputPin() [3/3]

template<typename T , typename = std::enable_if_t<std::is_base_of_v<Node, T>>>
InputPin * NAV::NodeManager::CreateInputPin ( Node * node,
const char * name,
Pin::Type pinType,
const std::vector< std::string > & dataIdentifier = {},
void(T::*)(InputPin::NodeDataQueue &, size_t) callback = nullptr,
InputPin::FlowFirableCheckFunc firable = nullptr,
int priority = 0,
int idx = -1 )

Create an Input Pin object.

Template Parameters
TNode Class where the function is member of
Parameters
[in]nodeNode to register the Pin for
[in]nameDisplay name of the Pin
[in]pinTypeType of the pin
[in]dataIdentifierIdentifier of the data which is represented by the pin
[in]callbackFlow firable callback function to register with the pin
[in]firableFunction to check whether the callback is firable
[in]priorityPriority when checking firable condition related to other pins (higher priority gets triggered first)
[in]idxIndex where to put the new pin (-1 means at the end)
Returns
Pointer to the created pin

◆ CreateOutputPin() [1/3]

OutputPin * NAV::NodeManager::CreateOutputPin ( Node * node,
const char * name,
Pin::Type pinType,
const std::vector< std::string > & dataIdentifier,
OutputPin::PinData data = static_cast< void * >(nullptr),
int idx = -1 )

Create an Output Pin object.

Parameters
[in]nodeNode to register the Pin for
[in]nameDisplay name of the Pin
[in]pinTypeType of the pin
[in]dataIdentifierIdentifier of the data which is represented by the pin
[in]dataPointer to data which is represented by the pin
[in]idxIndex where to put the new pin (-1 means at the end)
Returns
Pointer to the created pin

◆ CreateOutputPin() [2/3]

template<typename T , typename = std::enable_if_t<std::is_base_of_v<Node, T>>>
OutputPin * NAV::NodeManager::CreateOutputPin ( Node * node,
const char * name,
Pin::Type pinType,
const std::vector< std::string > & dataIdentifier,
std::shared_ptr< const NAV::NodeData >(T::*)(size_t, bool) peekPollDataFunc = nullptr,
int idx = -1 )

Create an Output Pin object for Flow Pins.

Template Parameters
TClass where the function is member of
Parameters
[in]nodeNode to register the Pin for
[in]nameDisplay name of the Pin
[in]pinTypeType of the pin
[in]dataIdentifierIdentifier of the data which is represented by the pin
[in]peekPollDataFuncFunction to poll for data on this pin
[in]idxIndex where to put the new pin (-1 means at the end)
Returns
Pointer to the created pin

◆ CreateOutputPin() [3/3]

template<typename T , typename = std::enable_if_t<std::is_base_of_v<Node, T>>>
OutputPin * NAV::NodeManager::CreateOutputPin ( Node * node,
const char * name,
Pin::Type pinType,
const std::vector< std::string > & dataIdentifier,
std::shared_ptr< const NAV::NodeData >(T::*)() pollDataFunc = nullptr,
int idx = -1 )

Create an Output Pin object for Flow Pins.

Template Parameters
TClass where the function is member of
Parameters
[in]nodeNode to register the Pin for
[in]nameDisplay name of the Pin
[in]pinTypeType of the pin
[in]dataIdentifierIdentifier of the data which is represented by the pin
[in]pollDataFuncFunction to poll for data on this pin
[in]idxIndex where to put the new pin (-1 means at the end)
Returns
Pointer to the created pin

◆ DeleteInputPin()

bool NAV::NodeManager::DeleteInputPin ( InputPin & pin)

Deletes the input pin. Invalidates the pin reference given.

Parameters
[in,out]pinInput Pin to delete
Returns
True if the pin was delete

◆ DeleteNode()

bool NAV::NodeManager::DeleteNode ( ax::NodeEditor::NodeId nodeId)

Delete the node provided by id.

Parameters
[in]nodeIdUnique Id of the Node to delete
Returns
True if delete was successful, false if NodeId does not exist

◆ DeleteOutputPin()

bool NAV::NodeManager::DeleteOutputPin ( OutputPin & pin)

Deletes the output pin. Invalidates the pin reference given.

Parameters
[in,out]pinOutput Pin to delete
Returns
True if the pin was delete

◆ FindInputPin()

InputPin * NAV::NodeManager::FindInputPin ( ax::NodeEditor::PinId id)

Finds the Pin for the PinId.

Parameters
[in]idUnique Id of the Pin to search for
Returns
Pointer to the pin or nullptr if the PinId does not exist

◆ FindNode()

Node * NAV::NodeManager::FindNode ( ax::NodeEditor::NodeId id)

Finds the Node for the NodeId.

Parameters
[in]idUnique Id of the Node to search for
Returns
Pointer to the node or nullptr if the NodeId does not exist

◆ FindOutputPin()

OutputPin * NAV::NodeManager::FindOutputPin ( ax::NodeEditor::PinId id)

Finds the Pin for the PinId.

Parameters
[in]idUnique Id of the Pin to search for
Returns
Pointer to the pin or nullptr if the PinId does not exist

◆ InitializeAllNodes()

bool NAV::NodeManager::InitializeAllNodes ( )

Initializes all nodes.

Returns
Returns false if one of the nodes could not initialize

◆ UpdateNode()

void NAV::NodeManager::UpdateNode ( Node * node)

Update the provided node object.

Parameters
[in]nodeNode object to add to the list