¡@

Home 

c++ Programming Glossary: basefactory

Factory pattern allocating memory at compile time, and how to print compile time info

http://stackoverflow.com/questions/10676498/factory-pattern-allocating-memory-at-compile-time-and-how-to-print-compile-time

stored in a map. An instance can then be returned using BaseFactory createInstance I am not sure how a map is holding class names.. #pragma message createT instantiated return new T struct BaseFactory typedef std map std string Bump_BaseObject map_type return an.. x #x template typename T struct DerivedRegister BaseFactory DerivedRegister const std string s #pragma message Type registered..

Is there a way to instantiate objects from a string holding their class name?

http://stackoverflow.com/questions/582331/is-there-a-way-to-instantiate-objects-from-a-string-holding-their-class-name

Base class DerivedB public Base etc... and another file BaseFactory.h #include Base.h class BaseFactory public BaseFactory const.. and another file BaseFactory.h #include Base.h class BaseFactory public BaseFactory const string sClassName msClassName sClassName.. BaseFactory.h #include Base.h class BaseFactory public BaseFactory const string sClassName msClassName sClassName Base Create if..