mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 19:29:18 +02:00
+ add implementation class for parameters of methods that belong to a VMT-based type
git-svn-id: trunk@37758 -
This commit is contained in:
parent
68c7308de3
commit
7ad3a0f12c
@ -510,6 +510,18 @@ type
|
|||||||
function GetIntfType: TInterfaceType; override;
|
function GetIntfType: TInterfaceType; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
TRttiVmtMethodParameter = class(TRttiParameter)
|
||||||
|
private
|
||||||
|
FVmtMethodParam: PVmtMethodParam;
|
||||||
|
protected
|
||||||
|
function GetHandle: Pointer; override;
|
||||||
|
function GetName: String; override;
|
||||||
|
function GetFlags: TParamFlags; override;
|
||||||
|
function GetParamType: TRttiType; override;
|
||||||
|
public
|
||||||
|
constructor Create(AVmtMethodParam: PVmtMethodParam);
|
||||||
|
end;
|
||||||
|
|
||||||
resourcestring
|
resourcestring
|
||||||
SErrUnableToGetValueForType = 'Unable to get value for type %s';
|
SErrUnableToGetValueForType = 'Unable to get value for type %s';
|
||||||
SErrUnableToSetValueForType = 'Unable to set value for type %s';
|
SErrUnableToSetValueForType = 'Unable to set value for type %s';
|
||||||
@ -1075,6 +1087,44 @@ begin
|
|||||||
Result := itRaw;
|
Result := itRaw;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TRttiVmtMethodParameter }
|
||||||
|
|
||||||
|
function TRttiVmtMethodParameter.GetHandle: Pointer;
|
||||||
|
begin
|
||||||
|
Result := FVmtMethodParam;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TRttiVmtMethodParameter.GetName: String;
|
||||||
|
begin
|
||||||
|
Result := FVmtMethodParam^.Name;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TRttiVmtMethodParameter.GetFlags: TParamFlags;
|
||||||
|
begin
|
||||||
|
Result := FVmtMethodParam^.Flags;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TRttiVmtMethodParameter.GetParamType: TRttiType;
|
||||||
|
var
|
||||||
|
context: TRttiContext;
|
||||||
|
begin
|
||||||
|
if not Assigned(FVmtMethodParam^.ParamType) then
|
||||||
|
Exit(Nil);
|
||||||
|
|
||||||
|
context := TRttiContext.Create;
|
||||||
|
try
|
||||||
|
Result := context.GetType(FVmtMethodParam^.ParamType^);
|
||||||
|
finally
|
||||||
|
context.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor TRttiVmtMethodParameter.Create(AVmtMethodParam: PVmtMethodParam);
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
FVmtMethodParam := AVmtMethodParam;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TRttiFloatType }
|
{ TRttiFloatType }
|
||||||
|
|
||||||
function TRttiFloatType.GetFloatType: TFloatType;
|
function TRttiFloatType.GetFloatType: TFloatType;
|
||||||
|
Loading…
Reference in New Issue
Block a user