Heterogenous properties
Hi. I'm trying to develop a (bidirectional) graph whose edges contain a property Value, which is a baseclass with different inherited classes dependent upon the type of vertex they are connected to. I attach a pointer to a base class Node to each vertex - the node containing only a virtual method called from a designated parsing algorithm. This method needs to access the Value leafclasses of the vertex's outedges. For example, a particular vertex receives a double from one outedge and a struct xy {double x,y; } from another, does some operation and stores, say, a complex number in a relevant inedge. In essense it's kind of like genetic programming with multiple parents and multiple value types. I would really like to avoid using dynamic_cast in dispatching edge Value descendants. Any thoughts on this?
participants (1)
-
Martin Jynge