The main DAG function that encapulates generation and mapping of the data across the DAG.
More...
|
| | dag (const IDType &_id, dag_source< OriginType > *_lsource, const _dag_context &_context, bool _startThread) |
| | Constructor of the DAG.
|
| |
| | ~dag () |
| | Default deconstructor.
|
| |
| const IDType & | get_id () |
| | Simple getter for the ID of the DAG itself.
|
| |
| void | manual_pump (const unique_ptr< OriginType > _raw_dat) |
| | Manually pumps some data across the children of the DAG.
|
| |
| bool | dag_contains (const IDType &_id) |
| | Checks whether this DAG contains a specific ID.
|
| |
| template<typename In, typename Out> |
| expected< IDType, error_codes > | add_filter (IDType _newID, dag_node< In, Out > *_new_filter, IDType _on_node) |
| | Adds a new function to the DAG.
|
| |
|
void | print () |
| | Simple print function to print the ID of this DAG and it's children.
|
| |
| void | push_once () |
| | Runs the generator and begins propagating the data to it's children.
|
| |
template<typename OriginType, typename IDType>
class fn_dag::dag< OriginType, IDType >
The main DAG function that encapulates generation and mapping of the data across the DAG.
The DAG calls the source generator to generate some data. That data is then propagated to it's children and across the entire DAG. The DAG stops propagating across the children of any node of the DAG if the previous parent returns nullptr. Otherwise, this runs either multithreaded or single threaded and can be manually manipulated (i.e. skip the generator) by turning it off and manually calling the manual_pump function.
template<typename OriginType, typename IDType>
template<typename In, typename Out>
Adds a new function to the DAG.
Since the generator already exists, this function recursively calls itself with the parents nodes type and, in a strongly typed way, attaches a child to the parent to process the data output by the parent node.
- Parameters
-
| _newID | The ID of the new function |
| _new_filter | The mapping function itself to pass along |
| _on_node | The ID of the parent to attach the function to. |
- Returns
- A parent ID if successfully added to the dag. Otherwise an error code.