Hi everyone,
I'm not even sure if this is possible, but I seem to be struggling at the minute with it so here goes...
I have a main.cpp where severeal different objects of different classes are created, such as say Log, ConfigManager, XMLReader and so on - what I'm trying to do is someone create a map say, that can hold the pointers too all these objects in one so later on I could for example look up an object and reuse it
like
Log* myLog = new Log (...);
map <string, *pointers-to-objects*> ObjectList;
ObjectList.insert ("Logger", myLog);
then later on if I wanted another object to use the Log, I could do something like
Log* newLogPointer = ObjectList.find ("Log");
Is it even possible to have something like this? I've tried experimenting with void* pointers but having no luck, any help would be much appreciated :)!