Basically I want to be able to do the following, but with my own classes:
![Variant vs concrete.png Variant vs concrete.png]()
I can call the property node "Value" on a Numeric control, a String control, or a generic Control, and I get different data types depending on which specific reference I call. Can I get this behavior with LVOOP classes, where I could return child-specific values when wiring with a child wire, but a variant (or other) when wired with a parent wire?
I don't believe these control properties are implemented as standard LVOOP classes (hence the awesome QControls). I'd like to be able to define some sort of hierarchy where a parent class returns a variant, but child classes can return their own specific datatype similar to the way "Numeric" controls are handled versus a generic "Control".
I can't have a parent class called "GetValue" with Variant as an output, as my Child classes would have to have their overrides return a variant as well. I could have a parent GetValue that calls private "GetChildValue" methods that children must override with their implementation of "Convert to Variant", but then I'm not allowed to have a child GetValue that returns the specific child data type, as I'd have already used that name in the child class.
I wonder if this is possible using malleable VI's (which I haven't used yet but look promising. I also wonder if I'm overthinking things, and there's a really simple way to do this, or if I'm trying to pick at an anti-pattern. Since LV does it internally it seems like it's a good way to go if I could figure it out ![Smiley Happy Smiley Happy]()
(To answer "What are you really trying to do here?", I'd like to implement something very similar to the above but that returns an array of U8's that represent each subtype as a flattened byte array. Each of my subtypes have an element that's a certain value type, but has more information than JUST an I32 or String or whatever.)