From 09349f1b58e916b0c58c8b776639fc57c9c904f7 Mon Sep 17 00:00:00 2001 From: FritzFlorian Date: Thu, 11 Jul 2019 18:35:14 +0200 Subject: [PATCH] Basic flow of data through the system. The data can now flow into a graph, follow its path on inptus/outputs and be fetched from the graph after execution. Currently graphs are executed synchronous. --- lib/pls/include/pls/dataflow/input.h | 26 ++++++++++++++++++++++++++ lib/pls/include/pls/dataflow/output.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 lib/pls/include/pls/dataflow/input.h create mode 100644 lib/pls/include/pls/dataflow/output.h diff --git a/lib/pls/include/pls/dataflow/input.h b/lib/pls/include/pls/dataflow/input.h new file mode 100644 index 0000000..700bcec --- /dev/null +++ b/lib/pls/include/pls/dataflow/input.h @@ -0,0 +1,26 @@ + +#ifndef PLS_DATAFLOW_INPUT_H_ +#define PLS_DATAFLOW_INPUT_H_ + +#include "pls/dataflow/internal/input.h" + +namespace pls { +namespace dataflow { + +template +class input { + template + friend + class output; + + using internal_type = internal::input; + internal_type &internal_input_; + + public: + explicit input(internal_type &internal_input) : internal_input_{internal_input} {}; +}; + +} +} + +#endif //PLS_DATAFLOW_INPUT_H_ diff --git a/lib/pls/include/pls/dataflow/output.h b/lib/pls/include/pls/dataflow/output.h new file mode 100644 index 0000000..6988ab9 --- /dev/null +++ b/lib/pls/include/pls/dataflow/output.h @@ -0,0 +1,28 @@ + +#ifndef PLS_DATAFLOW_OUTPUT_H_ +#define PLS_DATAFLOW_OUTPUT_H_ + +#include "input.h" + +#include "pls/dataflow/internal/output.h" + +namespace pls { +namespace dataflow { + +template +class output { + using internal_type = internal::output; + internal_type &internal_output_; + + public: + explicit output(internal_type &internal_output) : internal_output_{internal_output} {}; + + void operator>>(const input &input) { + internal_output_.connect(input.internal_input_); + } +}; + +} +} + +#endif //PLS_DATAFLOW_OUTPUT_H_ -- libgit2 0.26.0