Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compose and decompose for std::vector types of Inputs and Outputs #19

Open
bebuch opened this issue Aug 3, 2017 · 0 comments
Open

Compose and decompose for std::vector types of Inputs and Outputs #19

bebuch opened this issue Aug 3, 2017 · 0 comments

Comments

@bebuch
Copy link
Owner

bebuch commented Aug 3, 2017

  • Outputs of type std::vector< T > should be able to decompose the vector to multiple data of type T.
  • Inputs of type std::vector< T > should be able to compose the vector by multiple data of type T.

Outputs know the count of vector elements. This count can be stored in a config file variable of type std::size_t.

Inputs need to know, how many data they should collect before they become available for the input. This can be express as numeric value in the config file or by a config file variable of type std::size_t. Furthermore, inputs need to know how they should proceed if a previous module failed. The default behavior should ne to skip the correct amount of data. The alternative ('greedy') behavior is just to ignore the fail.

For the default behavior we need information from the previous output how much data is affected by the fail.

  1. Alternative: Therefor we need a noexcept prepare call before the exec call to set the expected output count. In most cases this can be done by the amount of data of another input and can be implemented on user side by calling a standard function generator with just naming this input.
  2. Alternative: (need Type dimensions for modules #18 implemented) The current design is, that inputs and outputs always hold a std::vector< T >. We change this type to std::vector< std::optional< T > > and the exec-function must know all its inputs and outputs. Also the relationship of the counts of elements in its inputs must be known. Then the exec-function can be called once per input-set. This way an exception will affect only one data-set and the output can be set or keeps in an std::optional empty state.

Proposed syntax for config file:

  • decompose:
    output '=' ( ['#' '>' variable] '>' )* '>' variable
  • compose:
    input '=' ( (count | '#' ('<' | '&') variable) ['greedy'] '<' )* ('<' | '&') variable

Legend:

  • '...' expression is a symbol or keyword
  • (...) just a group of expressions
  • [...] means optional (0 or 1 times)
  • | means or
  • * last expression can appear 0 times or more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant