mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-21 09:29:31 +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)
|
TRttiNamedObject = class(TRttiObject)
|
||||||
protected
|
protected
|
||||||
function GetName: string; virtual;
|
function GetName: string; virtual;
|
||||||
|
function GetHandle: Pointer; virtual; abstract;
|
||||||
public
|
public
|
||||||
property Name: string read GetName;
|
property Name: string read GetName;
|
||||||
|
property Handle: Pointer read GetHandle;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TRttiType }
|
{ TRttiType }
|
||||||
@ -178,6 +180,7 @@ type
|
|||||||
protected
|
protected
|
||||||
FTypeData: PTypeData;
|
FTypeData: PTypeData;
|
||||||
function GetName: string; override;
|
function GetName: string; override;
|
||||||
|
function GetHandle: Pointer; override;
|
||||||
function GetIsInstance: boolean; virtual;
|
function GetIsInstance: boolean; virtual;
|
||||||
function GetIsManaged: boolean; virtual;
|
function GetIsManaged: boolean; virtual;
|
||||||
function GetIsOrdinal: boolean; virtual;
|
function GetIsOrdinal: boolean; virtual;
|
||||||
@ -270,6 +273,7 @@ type
|
|||||||
protected
|
protected
|
||||||
function GetVisibility: TMemberVisibility; override;
|
function GetVisibility: TMemberVisibility; override;
|
||||||
function GetName: string; override;
|
function GetName: string; override;
|
||||||
|
function GetHandle: Pointer; override;
|
||||||
public
|
public
|
||||||
constructor create(AParent: TRttiType; APropInfo: PPropInfo);
|
constructor create(AParent: TRttiType; APropInfo: PPropInfo);
|
||||||
function GetValue(Instance: pointer): TValue;
|
function GetValue(Instance: pointer): TValue;
|
||||||
@ -1616,6 +1620,11 @@ begin
|
|||||||
Result:=FPropInfo^.Name;
|
Result:=FPropInfo^.Name;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TRttiProperty.GetHandle: Pointer;
|
||||||
|
begin
|
||||||
|
Result := FPropInfo;
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TRttiProperty.create(AParent: TRttiType; APropInfo: PPropInfo);
|
constructor TRttiProperty.create(AParent: TRttiType; APropInfo: PPropInfo);
|
||||||
begin
|
begin
|
||||||
inherited create(AParent);
|
inherited create(AParent);
|
||||||
@ -1821,6 +1830,11 @@ begin
|
|||||||
Result:=FTypeInfo^.Name;
|
Result:=FTypeInfo^.Name;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TRttiType.GetHandle: Pointer;
|
||||||
|
begin
|
||||||
|
Result := FTypeInfo;
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TRttiType.create(ATypeInfo: PTypeInfo);
|
constructor TRttiType.create(ATypeInfo: PTypeInfo);
|
||||||
begin
|
begin
|
||||||
inherited create();
|
inherited create();
|
||||||
|
Loading…
Reference in New Issue
Block a user