I have a BaseClass, which everything inherits in one way or another, and what I want to do, is whenever one of the classes that inherits this BaseClass calls it's constructor, it adds a std::vector<instanced class> into the list of classes that BaseClass has, and whenever a class tries to add an instance into this list, and that class already has an instance of itself in the list, add it to the sublist inside the class list that has the same type as itself.
I think this would be better expressed into code:
std::vector< std::vector<void*> > classInstances;
if(already has class with that className)
find the vector that has the class in it, and
add the newly instanced class to that vector;
classes.push_back(std::vector<class being instanced>)
void* getClassHandle(std::string className)
this is for getting the class that has the classname that
is equal to the className paramater; no idea how to do this either
All and any help will and would be appreciated
Thanks in advance
Key for the map is the class name. This classname references a vector. The vector (Value) holds pairs of instance names and the corresponding pointers to the class instances. The class name (Key) can be obtained using typeid(). RTTI has to be activated in your compiler options for that, iirc.