functional-dag
|
The DAG manager manages all of the dags created by the user. More...
#include <filter_sys.hpp>
Public Member Functions | |
dag_manager () | |
Default constructor. | |
~dag_manager () | |
Default deconstructor. | |
template<typename In , typename Out > | |
void | add_node (IDType _id, dag_node< In, Out > *_new_filter, IDType _onto) |
Implementation to template funcs must be visible to link correctly. | |
bool | manager_contains_id (IDType _id) |
Containment function for checking presence. | |
void | set_indention_string (string _new_indent_str) |
Indentation delimiter. | |
void | set_logging_stream (std::ostream *_new_stream) |
Set a logging stream to print to. | |
void | run_single_threaded (bool _is_single_threaded) |
Sets whether to run the DAGs on the same thread. | |
template<typename Out > | |
dag< Out, IDType > * | add_dag (IDType _id, dag_source< Out > *_new_filter, bool _startImmediately) |
Starts a new DAG with a given source of data out. | |
void | print_all_dags () |
Print all of the trees for verification purposes. | |
void | stahp () |
Stops all of the DAGs from generating data out. | |
void | clear () |
Clears all of the DAGs out of the "forest" of DAGs. | |
Public Attributes | |
vector< _dag_base< IDType > * > | m_all_dags |
All of the DAGs the manager maintains. | |
The DAG manager manages all of the dags created by the user.
Think of it like a forest of trees.
The dag manager is the main interfaces that users should interact with. You should be able to create new root nodes (sources) and add leaves along the way (nodes).
|
inline |
Default constructor.
Begins in the "on" state and in multi-threaded mode.
|
inline |
Starts a new DAG with a given source of data out.
This begins a new dag (tree) that must generate output data sequentially.
_id | The DAGs name |
_new_filter | The generator function. |
_startImmediately | Whether or not to begin generating data on a loop immediately. |
|
inline |
Implementation to template funcs must be visible to link correctly.
Use this function to add a lambda function onto a parent.
_id | The node's name for later referencing |
_new_filter | The lambda function to run fromt he parent |
_onto | The node ID of the parent to attach the lambda function on to. |
|
inline |
Clears all of the DAGs out of the "forest" of DAGs.
This doesn't stop the nodes, this simply clears out the tracked DAGs so if you need to stop the DAGs and maintain the pointers manually, feel free to do so.
|
inline |
Containment function for checking presence.
This function simply looks for an ID on all dags
_id | The ID to check for |
|
inline |
Print all of the trees for verification purposes.
Simply prints all of the dags and their nodes to the given output stream. Defaults to std::cout.
|
inline |
Sets whether to run the DAGs on the same thread.
Setter that will let all new nodes be created on separate threads or on the same thread as it was called on.
This has unsafe behavior when set during a single dags construction. This can be set between each dags creation, however.
_is_single_threaded | Whether or not new nodes and source nodes are on same node. |
|
inline |
Indentation delimiter.
Setter for the print function to set the identation spaces between nodes when printing the dags.
_new_indent_str | The new indentation string. These are concatenated. |
|
inline |
Set a logging stream to print to.
Logging is complicated. As long as the user conforms to a std::ostream then they can override the printout stream to print elsewhere like a file or another interleaved stream instead of std::cout.
_new_stream | The new stream to print to for debug messaging. |
|
inline |
Stops all of the DAGs from generating data out.
Stops all of the DAGs from generating data out. Fair warning, sometimes it takes a second for the nodes to complete.