Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

class hierarchy for FlowGraph nodes

memaher
Beginner
219 Views

Apology's up front if this turns out to be a stupid question: I'm getting my head in a right old tangle with the template functions...

I'm trying to design a reconfigurable flowgraph framework: whereby the actual makeup of the flowgraph can be dynamically created at runtime (from a configuration file). The flowgraph would consist of:

- function_node

- multifunction_node

- source_node

- join_node (working in conjunction with a function_node).

There is only a single datatype flowing through all of these nodes, lets call it CDataClass*.

In order to support the dynamic creation of these different types of nodes, I was hoping to have a single array (or vector[]) of a base class type, then instantiate the specific node types as common-interface descendants of the base class. However (and this is where I'm getting in a tangle with the templates), it looks like every different type of node has a different interface - both in the constructor and operator(), making the thought of having a common base type almost impossible.

Can anyone suggest a means to achieving this 'dynamic' behaviour, or advise if I'm missing something here?

cheers

Mat

0 Kudos
1 Reply
RafSchietekat
Valued Contributor III
219 Views

Each of those "isa" graph_node.

0 Kudos
Reply