rtti Questions
1
This question is specifically about non-portable MSVC ABI stuff.
I'm trying to write the equivalent of C++'s typeid in obviously-nonportable-yet-not-magic C++. For the Itanium ABI (as used on Linu...
Helsell asked 18/6, 2017 at 18:34
3
Solved
#include <memory>
struct foo { };
int main() { std::make_shared<foo>(); }
The asssembly generated by both g++7 and clang++5 with -fno-exceptions -Ofast for the code above:
Contains ...
4
Solved
I want to convert an string to an enum type using TValue, I googled but I didn't find how to do that.
type
TEnumTest = (etFirst, etSecond);
var
D: TEnumTest;
begin
D := StrToENumTest('etFirs...
Creole asked 18/3, 2010 at 18:46
4
Solved
I wish to create an alternative to std::type_index that does not require RTTI:
template <typename T>
int* type_id() {
static int x;
return &x;
}
Note that the address of the local va...
Timm asked 26/1, 2017 at 6:41
1
Solved
I'm trying to get variable name using RTTI like this.
Here is my test.
type
TStringHelper = record helper for string
function Name: string;
end;
TMyRecord = record
Field1:string;
end;
imp...
1
Solved
how i get ownership property of Method: TRttiMethod in OnInvoke method of TVirtualInterface class?
I have this interface:
IPerson = interface(IInvokable)
['{45CE428C-F880-4D61-A2C1-0F3CB47130B5}...
Dendrochronology asked 25/8, 2016 at 17:17
1
Solved
I'm working on small Windows Exception handling engine trying to gather maximum information from the system, including C++ exceptions RTTI.
In a 32-bit VectoredExceptionHandler compiled by MSVS 20...
Cressler asked 24/8, 2016 at 1:44
2
Solved
I'm working with a class library where all classes are, directly or indirectly, derived from a base class Base and have a name. The library provides a facility to search for objects by a name, whic...
3
This was inspired by a comment to my other question here:
How do you "not repeat yourself" when giving a class an accessible "name" in C++?
nvoight: "RTTI is bad because it's ...
1
Solved
On the Boost web site I found no information regarding the use or RTTI by boost::any.
I read in a few places that this is a requirement, but then I built a simple test project, and it builds both ...
Belonging asked 12/7, 2016 at 9:10
2
I had asked a question Do C++ POD types have RTTI? and someone told me in the comments:
POD types do have type_info, but don't have RTTI, and that's possible
because type_info isn't always RTTI...
2
Solved
I'm trying to understand TVirtualInterface class.
{$APPTYPE CONSOLE}
uses
SysUtils, Rtti;
type
ISpecificInterface = interface(IInvokable)
['{281D8B97-397E-430A-895A-9CA4E1F5FB5F}']
procedure...
1
I'm trying to find out if there is a way to do things similar to Delphi's enhanced RTTI features.
As far as I know FPC doesn't provide RTTI features which appeared in Delphi since Delphi 2010. But...
1
Solved
As I understand how RTTI is implemented in various C++ compilers (such as GCC), a pointer to the type_info data is stored in the vtable data of each class.
And also as mentioned here, POD type may...
1
Solved
I am trying to get types for record fields in order to create correct comparer (as general solution for any/almost any record type). I can't find type information for static arrays:
TArrFieldTest...
Fahey asked 12/1, 2016 at 15:3
1
I am working with an external library and need to create an observer pattern where observers are derived from an object that belongs to the library. I do not want to change the base class from the ...
Sharonsharona asked 11/1, 2016 at 12:38
1
Solved
C++ code can be compiled with run-time type information disabled, which disables dynamic_cast. But, virtual (polymorphic) methods still need to be dispatched based on the run-time type of the targe...
Ketty asked 18/12, 2015 at 10:43
2
Solved
The typeid represents a C++ RTTI operator being also a C++ keyword. It returns a std::type_info object that holds (dynamic) type specific information.
From what I understood from various sources, ...
2
Solved
I've recently posted a question in this forum asking for any advice regarding missing RTTI information in a DXE2 executable.
That post was a stripped down version of my actual case. RRUZ came to t...
Nestornestorian asked 16/5, 2012 at 6:26
1
Solved
I'm trying to generalize the content validation of visual components with the Text-property using RTTI but when I try to pass a string value into TRttiMethod.Invoke, I get the Message "Invalid Type...
Solarism asked 4/9, 2015 at 8:32
1
Solved
Overview
I appreciate a couple of similar questions have already been asked before:
Get/Set sub properties ussing RTTI
Get a sub property of a component in Delphi using RTTI
how i can set the va...
Hoff asked 8/7, 2015 at 15:33
1
I am attempting to write a generic messaging passing system for Delphi and .NET. The system allows messages to be defined as plain objects and message handlers are defined as anonymous methods that...
Bathsheb asked 1/7, 2015 at 16:22
3
Solved
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...
4
Solved
I have a list of pointers to objects. These objects have nothing in common (i.e. no common base class); for better understanding: It is a list of objects that lie under the mouse cursor in a GUI.
...
2
Solved
Is it possible and how to create and attach custom attribute to field at runtime?
uses
System.SysUtils,
System.Classes,
System.Rtti;
type
MyAttribute = class(TCustomAttribute)
private
fCapt...
Continual asked 28/3, 2015 at 12:59
© 2022 - 2024 — McMap. All rights reserved.