找回密码
 立即注册
反射Reflection机制its | 软件设计/软件工程 2022-05-02 234 0star收藏 版权: . 保留作者信息 . 禁止商业使用 . 禁止修改作品
所谓反射机制(Reflection),简单来说就是根据类的名称获取类及其对应的实例。 具体来说,我们可以在运行时加载、检测和使用在编译时完全未知的类。 换句话说,程序可以加载一个名称仅在运行时知道的类,了解其完整结构(但不了解其方法定义),并生成其对象实体,或为其字段设置值,或调用其方法。

as 语言本身支持反射机制,而 C++ 不支持。

现在的问题是,as如何实现底层的反射机制?

(The so-called reflection mechanism is simply to obtain the class and its corresponding instances according to the name of the class. Specifically, we can load, detect and use classes at run time that are completely unknown at compile time. In other words, a program can load a class whose name is only known at run time, understand its complete structure (but not its method definition), and generate its object entity, or set values for its fields, or call its methods.
As language itself supports reflection mechanism, but C + + does not.
The question now is, how does as implement the underlying reflection mechanism?
)





上一篇:无效的线程间操作 PROGRESSBAR2 无法访问线程
下一篇:PHP扩展APC参数优化