[软件设计/软件工程] AS和C++的反射机制比较

[复制链接]
发表于 2022-5-2 11:24:10
所谓反射机制(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参数优化

使用道具 举报

Archiver|手机版|小黑屋|吾爱开源 |网站地图

Copyright 2011 - 2012 Lnqq.NET.All Rights Reserved( ICP备案粤ICP备14042591号-1粤ICP14042591号 )

关于本站 - 版权申明 - 侵删联系 - Ln Studio! - 广告联系

本站资源来自互联网,仅供用户测试使用,相关版权归原作者所有

快速回复 返回顶部 返回列表