13#include <functional_dag/error_codes.h>
15#include <functional_dag/dag_interface.hpp>
16#include <functional_dag/impl/dag_impl.hpp>
28template <
typename IDType>
31 _dag_context m_context;
40 m_context.filter_off =
false;
41 m_context.run_single_threaded =
false;
47 m_context.filter_off =
true;
59 template <
typename In,
typename Out>
60 [[nodiscard]] expected<IDType, error_codes>
add_node(
62 if (_new_filter !=
nullptr) {
64 if ((*t)->dag_contains(_onto) || (*t)->get_id() == _onto) {
66 return tptr->
add_filter(_id, _new_filter, _onto);
87 if ((*t)->dag_contains(_id) || (*t)->get_id() == _id)
return true;
100 m_context.indent_str = _new_indent_str;
125 m_context.run_single_threaded = _is_single_threaded;
140 template <
typename Out>
143 if (_new_filter !=
nullptr) {
158 *m_context.log << endl;
159 *m_context.log <<
"------------DAG Forest-----------\n";
162 *m_context.log <<
"---------------------------------\n";
170 void stahp() { m_context.filter_off =
true; }
void run_single_threaded(const bool _is_single_threaded)
Sets whether to run the DAGs on the same thread.
Definition filter_sys.hpp:124
bool manager_contains_id(IDType _id)
Containment function for checking presence.
Definition filter_sys.hpp:85
void set_logging_stream(ostream *_new_stream)
Set a logging stream to print to.
Definition filter_sys.hpp:111
void print_all_dags()
Print all of the trees for verification purposes.
Definition filter_sys.hpp:157
void clear()
Clears all of the DAGs out of the "forest" of DAGs.
Definition filter_sys.hpp:178
expected< IDType, error_codes > add_node(IDType _id, dag_node< In, Out > *_new_filter, const IDType &_onto)
This function adds a node to the graph.
Definition filter_sys.hpp:60
expected< dag< Out, IDType > *, error_codes > add_dag(IDType _id, dag_source< Out > *_new_filter, bool _startImmediately)
Starts a new DAG with a given source of data out.
Definition filter_sys.hpp:141
dag_manager()
Default constructor.
Definition filter_sys.hpp:39
~dag_manager()
Default deconstructor.
Definition filter_sys.hpp:46
vector< _dag_base< IDType > * > m_all_dags
All of the DAGs the manager maintains.
Definition filter_sys.hpp:35
void set_indention_string(string _new_indent_str)
Indentation delimiter.
Definition filter_sys.hpp:99
void stahp()
Stops all of the DAGs from generating data out.
Definition filter_sys.hpp:170
Interface for all external "mapping" lambdas.
Definition dag_interface.hpp:42
Interface for all external generator lambdas.
Definition dag_interface.hpp:22
The main DAG function that encapulates generation and mapping of the data across the DAG.
Definition dag_impl.hpp:63
expected< IDType, error_codes > add_filter(IDType _newID, dag_node< In, Out > *_new_filter, IDType _on_node)
Adds a new function to the DAG.
Definition dag_impl.hpp:144
Definition guid_generated.h:16
error_codes
Error codes used by the functional dag.
Definition error_codes.h:19
@ NULL_PTR_ERROR
The node you are trying to add is null.
Definition error_codes.h:22
@ PARENT_NOT_FOUND
The parent of the node you are attaching to the dag was not found.
Definition error_codes.h:20