16#include <condition_variable>
18#include "functional_dag/dag_interface.hpp"
19#include "functional_dag/impl/dag_fanout_impl.hpp"
20#include "functional_dag/core/dag_utils.hpp"
26 template<
typename Out,
typename IDType>
class dag_fanout_node;
33 template <
class Type,
class IDType>
34 class _abstract_internal_dag_node {
37 virtual ~_abstract_internal_dag_node() =
default;
39 virtual IDType get_id() = 0;
41 virtual void run_filter(
const Type *_data) = 0;
43 virtual void print(
string _plus) = 0;
47 template<
typename In,
typename Out,
typename IDType>
48 class _internal_dag_node :
public _abstract_internal_dag_node<In, IDType> {
49 friend class dag_fanout_node<In, IDType>;
52 dag_node<In,Out> *m_node_hook;
53 const IDType m_node_id;
54 dag_fanout_node<Out, IDType> *m_child;
67 _internal_dag_node(IDType _node_id, dag_node<In,Out> *_node,
const fn_dag::_dag_context &_context) :
70 m_child(new dag_fanout_node<Out, IDType>(_context)),
74 ~_internal_dag_node() {
86 void run_filter(
const In *_data) {
87 Out *data_out = m_node_hook->update(_data);
88 if(!g_context.filter_off && data_out !=
nullptr)
89 m_child->fan_out(data_out);
98 void print(
string _indent_str) {
99 *g_context.log << m_node_id << std::endl;
100 m_child->
print(_indent_str);
The main DAG function that encapulates generation and mapping of the data across the DAG.
Definition dag_impl.hpp:59
void print()
Simple print function to print the ID of this DAG and it's children.
Definition dag_impl.hpp:148