Skip to content

Enable direct conversion from configuration parameter to product_query #163

@knoepfel

Description

@knoepfel

Users should be able to specify a configuration like

module_name: {
  plugin: "<plugin path>",
  input_product: { product: "a", layer: "spill"}
}

and then, in the registration code, be able to directly express the value of the input_product parameter above as a product_query object:

PHLEX_REGISTER_ALGORITHMS(m, config)
{
  m.transform(...).input_family(config.get<product_query>("input_product")); 

  // which is equivalent to:
  //
  // m.transform(...).input_family(
  //   product_query{config.get<std::string>("input_product.product"),
  //                 config.get<std::string>("input_product.player")}
  // );
}

It would be desirable to use the in: parameter instead of layer:. However, because in is a keyword in Jsonnet, it would need to be surrounded by quotes (e.g., "in":). To avoid this awkwardness, we use layer instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions