类的C ++运行时知识 [英] C++ runtime knowledge of classes

查看:104
本文介绍了类的C ++运行时知识的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有多个类都派生自一个基类,现在一些派生类不会被编译,这取决于平台。我有一个类,允许我返回一个基类的对象,但现在所有的派生类的名称已经硬编码。

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 ++运行时类注册吗?我找到了以下链接:
http://meat.net/ 2006/03 / cpp-runtime-class-registration /

Are you looking for C++ runtime class registration? I found this link: http://meat.net/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 ++运行时知识的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆