rtti
Removing namespace of type name in C++
In C++, when we use typeid to get type name of an object or class, it will show a decorated(mangled) string. I use cxxabi to demangle it:[详细]
2023-04-12 03:18 分类:问答Delphi: non-deterministic access violation using RTTI to set object properties from TMemo.Text
I\'m building a really crude GUI to model mapper which basically traverses all TEdit and TMemo fields on a form, extracts the text and set this text in a data model object. (The solution hinges on am[详细]
2023-04-11 17:55 分类:问答Run time type information of base and derived classes
I\'m trying to extend the functionality of some classes that I do not have access to. Basically I\'m trying to create a toString/toXML method for logging purposes. I though开发者_StackOverflow中文版t[详细]
2023-04-02 09:47 分类:问答How can I call TRttiProperty.SetValue for non-string properties when I have the value as a string?
I want to serialize an Object in Delphi and I\'m using the new RTTI. Butwhen I load the values from the storage, they are retreived as string,s and TRttiProperty.SetValue needs a TValue as a second ar[详细]
2023-04-01 09:04 分类:问答Losing RTTI info after returning from a function
Given a class and subclass: class Event {...} class Note : public Event {...} A Note is Cloned and stored in a pointer within a function f(). The type-information is preserved in the pointer and ca[详细]
2023-03-31 13:02 分类:问答Enable Delphi XE RTTI only for some classes
I\'m trying to have RTTI enabled only for a subset of my classes. The reason is that for those classes for which I want RTTI, I want RTTI on public methods too, but if that is enabled project-wide, t[详细]
2023-03-31 11:45 分类:问答How do I create a generic TValue for enumerated RTTI field?
In the question here a method for creating a compatible TValue to use with SetValue is shown. I\'m trying to make a generic version of this, to use RTTI to store a class into an INI file. This is my c[详细]
2023-03-30 16:52 分类:问答Will equal type_info addresses mean equal types?
I\'m micro-optimizing code for identifying object types. I assume I can use the following for checking whether two objects instantiated in the same module have identical types:[详细]
2023-03-27 15:28 分类:问答What's the lifetime of the object returned by typeid operator?
If I call typeid and retrieve the address of returned type_info: const type_info* info = &( typeid( Something ) );[详细]
2023-03-27 02:15 分类:问答Can type_info pointers be used to distingush types in C++?
I have a set of polymorphic C++ classes and they are all instantiated by the same module (Windows DLL). Now having two pointers to such classes and having called typeid:[详细]
2023-03-27 01:52 分类:问答