From 52d39102d951a4c4c20378d37be468edf00981eb Mon Sep 17 00:00:00 2001 From: FritzFlorian Date: Tue, 9 Jul 2019 16:43:55 +0200 Subject: [PATCH] Restructure to allow a clean interface for end users. We need some tricks in template programming to have a clean user facing API while internally using our classes with more capabilities. --- lib/pls/include/pls/dataflow/internal/inputs.h | 29 +++++++++++++++++++++++++++++ lib/pls/include/pls/dataflow/internal/outputs.h | 29 +++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 lib/pls/include/pls/dataflow/internal/inputs.h create mode 100644 lib/pls/include/pls/dataflow/internal/outputs.h diff --git a/lib/pls/include/pls/dataflow/internal/inputs.h b/lib/pls/include/pls/dataflow/internal/inputs.h new file mode 100644 index 0000000..feece2e --- /dev/null +++ b/lib/pls/include/pls/dataflow/internal/inputs.h @@ -0,0 +1,29 @@ + +#ifndef PLS_DATAFLOW_INTERNAL_INPUTS_H_ +#define PLS_DATAFLOW_INTERNAL_INPUTS_H_ + +#include + +#include "input.h" + +namespace pls { +namespace dataflow { +namespace internal { + +template +class inputs { + using values_type = std::tuple...>; + values_type values_; + + public: + template + typename std::tuple_element::type &get() { + return std::get(values_); + } +}; + +} +} +} + +#endif //PLS_DATAFLOW_INTERNAL_INPUTS_H_ diff --git a/lib/pls/include/pls/dataflow/internal/outputs.h b/lib/pls/include/pls/dataflow/internal/outputs.h new file mode 100644 index 0000000..1004aba --- /dev/null +++ b/lib/pls/include/pls/dataflow/internal/outputs.h @@ -0,0 +1,29 @@ + +#ifndef PLS_DATAFLOW_INTERNAL_OUTPUTS_H_ +#define PLS_DATAFLOW_INTERNAL_OUTPUTS_H_ + +#include + +#include "output.h" + +namespace pls { +namespace dataflow { +namespace internal { + +template +class outputs { + using values_type = std::tuple...>; + values_type values_; + + public: + template + typename std::tuple_element::type &get() { + return std::get(values_); + } +}; + +} +} +} + +#endif //PLS_DATAFLOW_INTERNAL_OUTPUTS_H_ -- libgit2 0.26.0