29 Mar
2006
29 Mar
'06
11:21 a.m.
boost-users-bounces@lists.boost.org wrote:
Is there any way that, using Boost, you can dynamically create classes by name, similar to the MFC RUNTIME_CLASS macros? I was hoping that the boost::serialize libs might be able to help with this.
For example, I want to be able to do something like:
CMyClass* pClass = CREATE_CLASS_BY_NAME("CMyClass");
Can Boost help me to achieve this?
Is there any problem in using a conventional Factory solution and writing the macro yourself? I would suggest using the factory template introduced by Andrei Alexandrescu in his book "Modern C++ Design" and available with the Loki lib. See 'http://sourceforge.net/projects/loki-lib/' for details. Oliver