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

Rewrite reflection and merging #426

Merged
merged 4 commits into from
Oct 10, 2024

Commits on Oct 9, 2024

  1. Prepare to use vir-reflect-light instead of refl-cpp

    Use GR_MAKE_REFLECTABLE macro instead of ENABLE_REFLECTION...
    
    Signed-off-by: Matthias Kretz <[email protected]>
    mattkretz committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    f102757 View commit details
    Browse the repository at this point in the history
  2. Rewrite port reflection & discovery

    - remove ports defined as template arguments (MergedGraph)
      => drop Block inheritance from std::tuple
    
    - split Port into Port and PortDescriptor, where the latter is used in
      the type lists returned from block reflection
    
    - remove fixed_string name template parameter from Port
    
    - remove ability to programmatically set a Port name; only the
      reflected member name is ever used — and then as string_view instead
      of string (because the name can never be set by users / points to
      compile-time strings).
    
    - flatten tuples of Ports and arrays of Ports when reflecting on block
      members, as if they were direct members of the block.
    
    - reflect vectors of Ports as dynamically sized Ports instead of
      `vector<PortDescriptor>`
    
    - `reflFirstTypeName` is not needed with the way `refl::type_name`
      presents the names. If it would be, then it's a bug to fix in
      `refl::type_name`. Therefore, replace `reflFirstTypeName` calls with
      `refl::type_name`.
    
    Signed-off-by: Matthias Kretz <[email protected]>
    mattkretz committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    322be51 View commit details
    Browse the repository at this point in the history
  3. Move reflect-light into GR

    Signed-off-by: Matthias Kretz <[email protected]>
    mattkretz committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    0a5ce46 View commit details
    Browse the repository at this point in the history
  4. Refactor gr::registerBlock

    1. A simple `registerBlock` overload for a list of complete block types
    was missing. If the given type is a specialized template, then the
    `type_name` is transformed into a template argument string and passed to
    `addBlockType`.
    
    2. Generalize the `registerBlock` function for a block template with
    type template arguments to an arbitrary number of parameters/arguments.
    
    3. Generalize the `registerBlockTT` function to an arbitrary number of
    type lists (and corresponding number of parameters for the template
    template parameter). The relatively expensive use of std::apply is
    replaced by an `outer_product` over all given typelists.
    
    4. Add a comment on how to improve the remaining `registerBlock`
    overloads.
    
    5. Add meta::outer_product (lifted from mattkretz/virtest).
    
    Signed-off-by: Matthias Kretz <[email protected]>
    mattkretz committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    8e6be5f View commit details
    Browse the repository at this point in the history