Skip to content

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

Description

@bebuch
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions