我有多个类都派生自一个基类,现在一些派生类不会被编译,这取决于平台。我有一个类,允许我返回一个基类的对象,但现在所有的派生类的名称已经硬编码。
I have multiple classes that all derive from a base class, now some of the derived classes will not be compiled depending on the platform. I have a class that allows me to return an object of the base class, however now all the names of the derived classes have been hard coded.
有办法
推荐答案确定哪些类已经被编译,在运行时优选,以便我可以删除链接,
您在寻找C ++运行时类注册吗?我找到了以下链接: meat/ 2006/03 / cpp-runtime-class-registration /
Are you looking for C++ runtime class registration? I found this link: meat/2006/03/cpp-runtime-class-registration/
这可能会完成你想要的,我不知道动态加载的模块,或者您不能使用相同的方法注册它们。
That would probably accomplish what you want, I am not sure about the dynamically loaded modules and whether or not you can register them using the same method.
更多推荐
类的C ++运行时知识
发布评论