rtti Questions

2

Solved

I have a procedure that needs to insert an array of TObjects into to a list. The list can be of any of the supported types, e.g. TObjectList, TObjectList<T>, TROArray, etc. The procedure lo...
Horsemint asked 2/3, 2015 at 16:6

5

Solved

Does anyone know of a TDataset descendant that works with Generics and RTTI, so that I can write code like this, and make use of data-aware components in the GUI? : ... ds:TDataset<TPerson>;...
Granddaughter asked 2/3, 2012 at 13:2

3

Remember the old class hierarchy posters that used to come w/Delphi? I'm wanting a full class hierarchy browser for ALL my Delphi classes, including the custom ones I've built and installed on the...
Brigade asked 28/3, 2009 at 1:45

2

Solved

I'm playing arround with TValue I've written this code in a blank project: uses RTTI; procedure TForm1.FormCreate(Sender: TObject); var s: string; b: Boolean; begin s := TValue.From<Boo...
Arnaud asked 13/1, 2015 at 8:55

5

I'm working on migrating an old project from Delphi 2007 to Delphi 2010. One thing I've found is that the resulting executable has more than doubled in size, and the original was already quite big....
Younts asked 14/1, 2010 at 23:31

2

Solved

Everything I've read indicates that TRTTIContext is thread-safe. However, TRTTIContext.FindType seems to fail (returns nil) occasionally when multithreading. Using a TCriticalSection around it fix...
Neuroticism asked 8/12, 2014 at 22:56

7

Solved

Can anybody tell me how to activate RTTI in c++ when working on unix. I heard that it can be disabled and enabled. on my unix environment,how could i check whether RTTI is enabled or disabled? I a...
Encephalomyelitis asked 14/4, 2010 at 5:42

4

Solved

The typeid operator in C++ returns an object of class std::type_info which can yield its textual name. However, I'm just interested in getting an unique numeric identifier for any polymorphic class...
Graham asked 19/4, 2011 at 16:54

5

Solved

I have been looking for a way to get around the slowness of the dynamic cast type checking. Before you start saying I should redesign everything, let me inform you that the design was decided on 5 ...
Foss asked 25/8, 2014 at 23:15

1

Solved

I have some confusion regarding the RTTI mechanism in C++. Suppose in have class A and class B that inherits from A. Now consider the following code: B* b = new B(); A* a = dynamic_cast<A*>...
Krakow asked 17/7, 2014 at 14:13

1

When you compile a DLL in Delphi XE6, it automatically exports the function TMethodImplementationIntercept from System.Rtti.pas. I tried to find a way to avoid this export but didn't find any confi...
Thematic asked 13/7, 2014 at 1:12

1

Solved

I want use reflection on the current class inside a class procedure/function (static method). How can I do without using the "Self" keyword? And without harcode the class name: this procedure shoul...
Cankerous asked 3/7, 2014 at 16:30

2

I want to dump a complex / long record into a memo for debugging purpose TmyRecord = aValue : String aNumber : Real; Morenumbers : Integer ; .... .... end; I think Delphi XE 2 RTTI shou...
Moonshine asked 23/5, 2014 at 7:47

1

Solved

I need to access, record properties, and set/get this property values. Firstly, i want to access properties. But i can't. What is wrong? Ver : Delphi XE6. sample code: type TmyRecord = record ...
Morgan asked 3/5, 2014 at 14:34

1

Solved

Is this valid code with newer Delphi versions? // handle HTTP request "example.com/products?ProductID=123" procedure TMyRESTfulService.HandleRequest([QueryParam] ProductID: string); In this exam...
Indissoluble asked 9/4, 2014 at 6:26

6

We often hear/read that one should avoid dynamic casting. I was wondering what would be 'good use' examples of it, according to you? Edit: Yes, I'm aware of that other thread: it is indeed when r...
Mireillemireles asked 26/8, 2008 at 13:49

3

Solved

The issue is somewhat similar to this question but the accepted answer does not really propose a solution or workaround. In our project, we have a dylib and the main executalble. The dylib is comp...
Valma asked 12/2, 2014 at 19:1

2

Assume a simple file bla.cpp: struct MyClass { virtual int foo(int x); virtual ~MyClass(); }; int MyClass::foo(int x) { return x + 23; } MyClass::~MyClass() {} Build into a shared library wi...
Propel asked 3/3, 2014 at 15:34

1

Solved

Just to make sure I'm not overlooking a strange edge case as I've found yet a case that produce it, but I want to make sure: Is there any Delphi version that can emit RTTI containing a type that h...
Pruritus asked 1/3, 2014 at 9:10

3

Solved

I have defined the following : a method pointer that returns 0 if a verification is OK or an error code TValidationFunc = Function(AParam: TAnObject): integer Of Object; a list of functions to...
Stiltner asked 21/2, 2014 at 11:31

5

Solved

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: #include <cxxabi.h> #include <typeinfo> names...
Homegrown asked 8/10, 2011 at 8:1

3

Solved

Consider the following code: #include <iostream> #include <typeinfo> #include <type_traits> using namespace std; struct A { int data; }; struct B1 : A {}; struct B2 : virtual A...
Serafinaserafine asked 24/11, 2013 at 12:20

2

Solved

I need to key some data in a map by a type. Currently I have something like this: struct TypeInfoComparer { bool operator()(std::type_info const* a, std::type_info const* b) const { return a-&g...
Frazzled asked 16/11, 2013 at 19:9

1

Solved

Linked to the original question Is it possible to get the index of class property? and answered by Remy Lebeau and RRUZ program Demo; {$APPTYPE CONSOLE} uses System.SysUtils, Winapi.Windows, S...
Kraska asked 1/11, 2013 at 7:16

5

Solved

Let's say I have a family of classes which all implement the same interface, perhaps for scheduling: class Foo : public IScheduler { public: Foo (Descriptor d) : IScheduler (d) {} /* methods */ ...
Verdugo asked 25/10, 2013 at 19:21

© 2022 - 2024 — McMap. All rights reserved.