I don’t know if there is a better way of doing this but heres the problem. The program needs to read an XML settings file that a person can change which loads certain data types into a container of some kind.
First, do I have other options than a Tuple since an array, vector etc can only load similar data types. To further complicate things the tuple can be comprised of many different elements in different orders and needs to be globally accessible. Take for example it could be 5 vectors of strings, or a string, an ofVideoPlayer, an ofVideoGrabber, etc… I know that I would have to use templates which thankfully in c++11 they added variadic templates that make this concept possible. Still I am not even sure this is possible in C. I know it could certainly be done in Python but thats not really what I am looking for.
I did have a thought that came from this dilemma. Could we make the objects in openframeworks derive from a base object? that way one would be able to fill a vector with any data type from openframeworks assuming one set it up like vector which should allow you to pass in any object that extends the base class so you could have a vector with ofImages and ofPixels and ofVideoPlayers. It certainly complicates things if you try to do the same function on every object in the vector but it could make it easier than having to check many different variables.