mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 18:47:52 +02:00
+ add TRttiNamedObject.Handle property of which the getter needs to be overridden in each sub class
git-svn-id: trunk@37401 -
This commit is contained in:
parent
31c9214884
commit
5c85e94919
@ -163,8 +163,10 @@ type
|
||||
TRttiNamedObject = class(TRttiObject)
|
||||
protected
|
||||
function GetName: string; virtual;
|
||||
function GetHandle: Pointer; virtual; abstract;
|
||||
public
|
||||
property Name: string read GetName;
|
||||
property Handle: Pointer read GetHandle;
|
||||
end;
|
||||
|
||||
{ TRttiType }
|
||||
@ -178,6 +180,7 @@ type
|
||||
protected
|
||||
FTypeData: PTypeData;
|
||||
function GetName: string; override;
|
||||
function GetHandle: Pointer; override;
|
||||
function GetIsInstance: boolean; virtual;
|
||||
function GetIsManaged: boolean; virtual;
|
||||
function GetIsOrdinal: boolean; virtual;
|
||||
@ -270,6 +273,7 @@ type
|
||||
protected
|
||||
function GetVisibility: TMemberVisibility; override;
|
||||
function GetName: string; override;
|
||||
function GetHandle: Pointer; override;
|
||||
public
|
||||
constructor create(AParent: TRttiType; APropInfo: PPropInfo);
|
||||
function GetValue(Instance: pointer): TValue;
|
||||
@ -1616,6 +1620,11 @@ begin
|
||||
Result:=FPropInfo^.Name;
|
||||
end;
|
||||
|
||||
function TRttiProperty.GetHandle: Pointer;
|
||||
begin
|
||||
Result := FPropInfo;
|
||||
end;
|
||||
|
||||
constructor TRttiProperty.create(AParent: TRttiType; APropInfo: PPropInfo);
|
||||
begin
|
||||
inherited create(AParent);
|
||||
@ -1821,6 +1830,11 @@ begin
|
||||
Result:=FTypeInfo^.Name;
|
||||
end;
|
||||
|
||||
function TRttiType.GetHandle: Pointer;
|
||||
begin
|
||||
Result := FTypeInfo;
|
||||
end;
|
||||
|
||||
constructor TRttiType.create(ATypeInfo: PTypeInfo);
|
||||
begin
|
||||
inherited create();
|
||||
|
Loading…
Reference in New Issue
Block a user