functional-dag
|
Internal node to take data from parent and run children. More...
#include <dag_fanout_impl.hpp>
Public Member Functions | |
dag_fanout_node (const _dag_context &_context) | |
This node uses data computed from the previous node to fan-out to it's children. | |
~dag_fanout_node () | |
Standard deconstructor. | |
void | fan_out (Type *_data) |
Function to do it's job. | |
void | print (string _indent) |
Printing function | |
template<typename In , typename Out > | |
bool | add_node_to_subdag (_internal_dag_node< In, Out, IDType > *_node_to_add, const IDType _onto, const IDType _parent_id) |
Recursively adds a node to children. | |
Internal node to take data from parent and run children.
Every node when generating output will send it's output to the nodes children. All child nodes run with the output data being immutable.
|
inline |
This node uses data computed from the previous node to fan-out to it's children.
This node specifically fans data out and makes sure the children can't modify the data as well as cleaning up the data on the heap when finished
_context | The shared state between the nodes |
|
inline |
Recursively adds a node to children.
This function will check whether the node attaches to the parent of this fan-out. If so, then it becomes a child of the parent function. If it did not attach to parent node, then it will recursively check its children until it finds it. If the parent isn't found, it will return false.
_node_to_add | The node to add |
_onto | The ID of the parent the node wants to attach to |
_parent_id | The current ID of this nodes parent |
|
inline |
Function to do it's job.
This function will take data from the parent node and execute the subsequent functions with the data. After the subsequent nodes have been run, it deletes the data. The nodes will run on their own threads in the event that run_single_threaded is off. Otherwise, this function will block until the children are finished in a depth-first way.
_data | Data from the parent node |
|
inline |
Printing function
This will print recursively to the logging stream the identity of the nodes. This can help ensure the dag was constructed correctly
_indent | The parents indent context |