There is nothing in C++ that will provide you such feature (called Reflection).
However, if your classes are of finite number, you can do some kind of mapping with some factories :
class IClassFactory // base interface
{ public:
virtual ~IClassFactory(){}
}
template< class T >
class ClassFactory {
/* whatever necessary here*/
public:
T* create();
};
class ClassManager
{
public:
void add( std::string name, IClassFactory* factory ) { m_map[name] = factory; }
ACommonBaseClass* create( std::string class_name ) { return m_map[class_name]->create(); } // this line isn't correct but you get the idea
private:
std::map< std::string, IClassFactory* > m_map;
};
Or something similar (this is written quickly).
Alternatively you could work with a scripting language that would allow Reflection, but that would add a whole layer to your application. Scripting languages that might be of interest for embedding with c++ : ChaiScript, Falcon, Lua, Python, AngelScript, MonkeyScript, Io, ...