diff --git a/dataflow_cpp/include/embb/dataflow/internal/process.h b/dataflow_cpp/include/embb/dataflow/internal/process.h index 4f5bc3f..e6f001a 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/process.h +++ b/dataflow_cpp/include/embb/dataflow/internal/process.h @@ -102,8 +102,9 @@ class Process< Slices, Serial, Inputs, } template - void operator >> (T & target) { + T & operator >> (T & target) { GetOutput<0>() >> target.template GetInput<0>(); + return target; } virtual void OnClock(int clock) { diff --git a/dataflow_cpp/include/embb/dataflow/internal/select.h b/dataflow_cpp/include/embb/dataflow/internal/select.h index f3a499f..e184e2b 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/select.h +++ b/dataflow_cpp/include/embb/dataflow/internal/select.h @@ -105,8 +105,9 @@ class Select } template - void operator >> (T & target) { + T & operator >> (T & target) { GetOutput<0>() >> target.template GetInput<0>(); + return target; } virtual void OnClock(int clock) { diff --git a/dataflow_cpp/include/embb/dataflow/internal/source.h b/dataflow_cpp/include/embb/dataflow/internal/source.h index af9de28..b6a0f6f 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/source.h +++ b/dataflow_cpp/include/embb/dataflow/internal/source.h @@ -83,8 +83,9 @@ class Source< Slices, Outputs > } template - void operator >> (T & target) { + T & operator >> (T & target) { GetOutput<0>() >> target.template GetInput<0>(); + return target; } private: diff --git a/dataflow_cpp/include/embb/dataflow/internal/switch.h b/dataflow_cpp/include/embb/dataflow/internal/switch.h index 3bf36ee..0015ad9 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/switch.h +++ b/dataflow_cpp/include/embb/dataflow/internal/switch.h @@ -103,8 +103,9 @@ class Switch } template - void operator >> (T & target) { + T & operator >> (T & target) { GetOutput<0>() >> target.template GetInput<0>(); + return target; } virtual void OnClock(int clock) { diff --git a/dataflow_cpp/test/dataflow_cpp_test_simple.cc b/dataflow_cpp/test/dataflow_cpp_test_simple.cc index 9babf09..3b41973 100644 --- a/dataflow_cpp/test/dataflow_cpp_test_simple.cc +++ b/dataflow_cpp/test/dataflow_cpp_test_simple.cc @@ -188,11 +188,14 @@ void SimpleTest::TestBasic() { source.GetOutput<0>() >> sw.GetInput<1>(); - source.GetOutput<0>() >> pred.GetInput<0>(); - pred.GetOutput<0>() >> sw.GetInput<0>(); + // connection chain representing the commented single connections below + source >> pred >> sw >> filter; + + //source.GetOutput<0>() >> pred.GetInput<0>(); + //pred.GetOutput<0>() >> sw.GetInput<0>(); pred.GetOutput<0>() >> sel.GetInput<0>(); - sw.GetOutput<0>() >> filter.GetInput<0>(); + //sw.GetOutput<0>() >> filter.GetInput<0>(); filter.GetOutput<0>() >> sel.GetInput<1>(); constant.GetOutput<0>() >> mult.GetInput<0>(); diff --git a/doc/examples/dataflow/dataflow_connect-snippet.h b/doc/examples/dataflow/dataflow_connect-snippet.h index 6660f53..7c7537e 100644 --- a/doc/examples/dataflow/dataflow_connect-snippet.h +++ b/doc/examples/dataflow/dataflow_connect-snippet.h @@ -1,2 +1 @@ - read >> replace; - replace >> write; + read >> replace >> write;