Hi,
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?
If a compiler doesn't "support" RTTI, does that mean that the compiler can not handle class hierarchies that have virtual functions in them? Or have I been misunderstanding the literature about how RTTI isn't portable, and the issues lie elsewhere?
I am developing game editor in C# that uses c++ lib files.
I want RTTI for C++ classes in C#.
Is it possible to get RTTI of C++ class in C#?
If yes how?
As already discussed in Rtti data manipulation and consistency in Delphi 2010 a consistency between the original data and rtti values can be reached by accessing members by using a pair of TRttiField and an instance pointer. This would be very easy in case of a simple class with only basic member types (like e.g. integers or strings).
But what if…
I'm trying to fetch an interface using D2010 RTTI.
program rtti_sb_1;
{$APPTYPE CONSOLE}
{$M+}
uses
SysUtils,
Rtti,
mynamespace in 'mynamespace.pas';
var
ctx: TRttiContext;
RType: TRttiType;
MyClass: TMyIntfClass;
begin
ctx := TRttiContext.Create;
MyClass := TMyIntfClass.Create;
// This prints a list of all known…
Hi,
If I have a superclass, say Animal,
and two subclasses: Zebra and Giraffe,
If I decide to define a Vector of Animals:
Vector <Animal> animals = new Vector();
and I want to say: You can add Giraffes, but you must own at least one Zebra first.
What is the best way to do this without using RTTI? (instanceof)
Hello,
I found great explanation about the new RTTI in Delphi,but I don't understand one important thing about all I have read so far - Where can I use that?
What is it supposed to replace?
Thanks in advance.
I am trying to write class that inherits from FMX TStyledControl. When style is updated it loads style resource objects to cache.
I created project group for package with custom controls and test FMX HD project as it describes in Delphi help. After installing package and placing TsgSlideHost on the test form I run test app. It’s work well,…
Based on one answer to an earlier post, I'm investigating the possibility of the following design
TChildClass = class(TObject)
private
FField1: string;
FField2: string;
end;
TMyClass = class(TObject)
private
FField1: TChildClass;
FField2: TObjectList<TChildClass>;
end;
Now, in the real world, TMyClass will have 10…
Has anyone an idea, how I can make TValue using a reference to the original data? In my serialization project, I use (as suggested in XML-Serialization) a generic serializer which stores TValues in an internal tree-structure (similar to the MemberMap in the example).
This member-tree should also be used to create a dynamic setup form…
I've been banging my head on an issue and before I continue injuring myself some more, I'd like to confirm:
Is it possible to have a GCC project that uses libraries that are compiled with and without RTTI?
So, for example, I have project A (compiled without RTTI) that uses library B (compiled with RTTI) and library C (compiled…
Hi,
Considering such an enumeration :
type
TTypeOfData = (
[XmlName('ABC')] todABC,
[XmlName('DEF')] todDEF,
[XmlName('GHI')] todGHI
);
Where XmlName is a custom attribute used to define the serialization string for members of this enumeration.
How can I explore the attributes attached to each member of this…
I try to write a kind of object/record serializer with Delphi 2010 and wonder if there is a way to detect, if a record is a variant record. E.g. the TRect record as defined in Types.pas:
TRect = record
case Integer of
0: (Left, Top, Right, Bottom: Longint);
1: (TopLeft, BottomRight: TPoint);
end;
As my serializer should…
Hello
I have a question. I am a newbie with Run Time Type Information from Delphi 2010. I need to set length to a dynamic array into a TValue. You can see the code.
Type TMyArray = array of integer;
TMyClass = class
publihed
function Do:TMyArray;
end;
function TMyClass.Do:TMyArray;
begin
SetLength(Result,5);
for i:=0 to 4…
As we all known, when we call a constructor of a class like this:
instance := TSomeClass.Create;
The Delphi compiler actually do the following things:
Call the static NewInstance method
to allocate memory and initialize
the memory layout.
Call the constructor method to
perform the initialization of the class
Call the…
I'd like to set the length of a dynamic array, as suggested in this post. I have two classes TMyClass and the related TChildClass defined as
TChildClass = class
private
FField1: string;
FField2: string;
end;
TMyClass = class
private
FField1: TChildClass;
FField2: Array of TChildClass;
end;
The array…
Good day,
I had tried to make recurrent function to return a TValue as a n-dimensional. matrix(2D, 3D, 4D...)
for example, this procedure will show a n-dimensional matrix(it will list all elements from a n-dimensional matrix as TValue variable):
Procedure Show(X:TValue);
var i:integer;
begin
if x.IsArray then…
This is probably going to be a "no", but is there any way I can use Delphi's RTTI, either old-school or the 2010 extended RTTI, to pass in a string containing the name of a type, specifically the name of an enumerated type, and have it give me the PTypeInfo for that type? I've looked through RTTI.pas and…
I've recently experimented extensively with interfaces and D2010 RTTI. I don't know at runtime the actual type of the interface; although I will have access to it's qualified name using a string.
Consider the following:
program rtti_sb_1;
{$APPTYPE CONSOLE}
uses
SysUtils, Rtti, TypInfo, mynamespace in…
I've got two questions (of which at least one is regarding RTTI in D2010 and dynamic instancing)
I was reading what appears to be the foils for a conference talk by Barry Kelly, and found on p. 13 something that looked really interesting: TRTTIConstructor.Invoke. In an adjacent bullet point, on finds…
I've recently been able to fetch a TRttiType for an interface using TRttiContext.FindType using Robert Loves "GetType"-workaround ("registering" the interface by an explicit call to ctx.GetType, e.g. RType := ctx.GetType(TypeInfo(IMyPrettyLittleInterface));).
One logical next step would be to iterate…
I want to handle a TRttiMethod as anonymous method. How could I do this?
Here is a simplified example of how I wish things to work:
Interface:
TMyClass = class
public
// this method will be acquired via Rtti
procedure Foo;
// this method shall return above Foo as anonymous method
function…
I am developing visual game level editor in c++.
For this I want reflection(RTTI) mechanism to know class attributes at runtime.
I am currently using PDB files for this.But using PDB I couldn't retrieve actual code line for extra information in commented format which is given for that attribute.…