5

C++ abstract (singleton) factory implementation...

view full story
linux-howto

http://www.unix.com – I want to create an abstract factory template which will allow me to pass in an "ID" for a subclass and return the singleton instance of that class stored in the factory. It'd be easy to adapt for "multi-ton", but for its present use this isn't necessary. The requirements are: - I don't want to have to "register" the classes in some main class somewhere, I want them to register themselves as best as possible. - I want the above to be done with as little boilerplate as possible. This seems to be close to a Prototype pattern I found before, but I'm not sure I lo (HowTos)