Dynamic / config time suffix specification #595
-
|
Is there a way to set a "suffix" based on user config? So far, all I find is that "suffix" must be a hard-wired C++ string tied to the compiled algorithm registration block. Is that right? In other words, how do I have multiple instances of the same algorithm (C++ code) which produce (or consume) products each with different suffixes? An concrete example, a WCT graph may transform "depos" to a "frame". To run this in Phlex I already must write a specific C++ code block because I must provide "depos" and "frame" as concrete C++ types to meet Phlex requirements. But given that, I will have one WCT graph that implements sim (output frame holds ADC waveform) and another that implements sim+sp (output frame holds signal waveforms). Both have same input/output types. Do I now need to write TWO C++ blocks just to hard-wire different suffix strings? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Okay, I believe the answer is in a variant of the registration macro that passes a config. Something like this example: PHLEX_REGISTER_ALGORITHMS(m, config)
{
auto input_query = config.get<product_query>("consumes"); // suffix comes from config
auto output_suffix = config.get<std::string>("produces"); // suffix comes from config
m.make<hit_finder>(config.get<double>("threshold"))
.transform("find_hits", &hit_finder::operator(), concurrency::unlimited)
.input_family(input_query)
.output_product_suffixes(output_suffix);
}
|
Beta Was this translation helpful? Give feedback.
-
|
Glad you found it. I was working on a reply when you posted your follow-up. |
Beta Was this translation helpful? Give feedback.
Okay, I believe the answer is in a variant of the registration macro that passes a config. Something like this example: