如何检索 C++ RTTI 以外的类信息
这是三个类, class ClassA{}; class ClassB:public ClassA{}; class ClassC:public ClassB{}; ClassC cobject; 我想知道对象的“类名称”(即ClassC…
delphi2010 rtti的遍历记录
type myrec = record id:dWord; name:array[0..31] of WideChar; three:dword; count:dword; ShuXing:Single; ShuXing2:dword; ShuXing3:dWORD; end; …
为什么这种 RTTI 优化会使速度变慢?
我有一个在循环中重复调用的操作。使用 TRttiField: if (field.name = '') or (field.Name[1] <> 'F') then continue; 分析表明我因此在 UStrAsg 和 …
如何使用 type_info 进行类型转换?
我存储了一个指向 type_info 对象的指针。 int MyVariable = 123; const std::type_info* Datatype = &typeid(MyVariable); 我如何使用它来将另一个变…
虚拟接口Dtor &&动态_Cast
我试图从接口向下转换为派生类,但我的虚拟 dtor 杀死了它? class IFOO { public: virtual ~IFOO(){}; virtual size_t index() PURE; }; class FOO :…
Delphi - 视觉表单继承 - 组件基类检测
我正在使用 VFI(视觉表单继承),我需要检查实例化表单的组件是否属于表单类或表单超类。 有什么想法吗? unit1 TFormStatus = class(TForm) cpPanel…
RTTI 动态数组 TValue Delphi 2010
我有一个问题。我是来自 Delphi 2010 的运行时类型信息的新手。我需要将动态数组的长度设置为 TValue。你可以看到代码。 Type TMyArray = array of in…
确定派生类是否重写基类的方法
class B { virtual int foo(); }; class D : public B { virtual int foo() { cout<<"D\n"; } }; int B::foo() { /* how do i tell if this->foo() is…
RTTI Delphi 创建一个 n 维矩阵作为 TValue
美好的一天, TValue 是 Delphi-2010 及更高版本的 RTTI 功能。 继我的之前的问题之后,我尝试使循环函数返回n 维的 TValue。 矩阵(2D,3D,4D ...)…
为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如何让它打印未损坏的名称?
为什么当我运行这个 main.cpp 时: #include #include using namespace std; struct Blah {}; int main() { cout << typeid(Blah).name() << endl; re…
从 DLL 导出的函数中的 RTTI
我有一个 Visual Studio 2008 C++ dll,我想在其中接受可变数量的参数并知道每个参数的类型。例如: __declspec( dllexport ) void Foo( const char* …
C++:模拟 RTTI
我有一个这样的类层次结构: class A { } // class AA : A { } // A class AAA : AA { } // / \ class AAB : AA { } // AA AB class AB : A { } // / …
哪个 Delphi 版本支持公共方法的 RTTI?
默认情况下,2010 以下版本的 RTTI 仅为已发布的班级成员创建。 我在 2006 年的博客 (http://hallvards.blogspot.com/2006/09/extended-class-rtti.ht…
检查 c++ 中是否存在函数时出现问题
我在 上找到了一些非常有趣的 C++ 代码stackoverflow ,我对此感到非常困惑,因为正如作者所说,它应该可以工作,但在我的 gcc 4.5.1 和 4.4 上失败了…