Hi everyone :)
At the minute I'm working on some stuff learning c++ and was wondering if ayone could offer some advice...
Say I have a pile of objects that need to be created (for example say, a Log object, XML parsers object, and a command line parser object). In my main.cpp file I have a pile of code setting up each of these objects, then I add a pointer to these objects to another list (called object manager) so I can pass this list to other parts of the program and get access to the previous mentioned objects.
Is there a way of creating say a separate file (say LogInit.cpp, XMLParserInit.cpp) that contains all the initalision stuff, and have these file called or run in main.cpp? So that way a user shouldn't have to modify or change main.cpp for a new object or to change stuff, only edit/make a new *object*Init.cpp file?
Haven't tried much yet, only messed about with a few idas, such as having a InitObject object that could maybe contain a Init method, then say logInit.cpp extends this InitObject class and overrides the Init method?
Sorry if this makes no sense, feel free to tell me it's a crazy idea if ya want! :P