|
@@ -41,6 +41,7 @@ uses
|
|
typinfo;
|
|
typinfo;
|
|
|
|
|
|
type
|
|
type
|
|
|
|
+ TRttiObject = class;
|
|
TRttiType = class;
|
|
TRttiType = class;
|
|
TRttiProperty = class;
|
|
TRttiProperty = class;
|
|
TRttiInstanceType = class;
|
|
TRttiInstanceType = class;
|
|
@@ -143,6 +144,8 @@ type
|
|
TRttiContext = record
|
|
TRttiContext = record
|
|
private
|
|
private
|
|
FContextToken: IInterface;
|
|
FContextToken: IInterface;
|
|
|
|
+ function GetByHandle(AHandle: Pointer): TRttiObject;
|
|
|
|
+ procedure AddObject(AObject: TRttiObject);
|
|
public
|
|
public
|
|
class function Create: TRttiContext; static;
|
|
class function Create: TRttiContext; static;
|
|
procedure Free;
|
|
procedure Free;
|
|
@@ -2350,6 +2353,20 @@ begin
|
|
FContextToken := nil;
|
|
FContextToken := nil;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TRttiContext.GetByHandle(AHandle: Pointer): TRttiObject;
|
|
|
|
+begin
|
|
|
|
+ if not Assigned(FContextToken) then
|
|
|
|
+ FContextToken := TPoolToken.Create;
|
|
|
|
+ Result := (FContextToken as IPooltoken).RttiPool.GetByHandle(AHandle);
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+procedure TRttiContext.AddObject(AObject: TRttiObject);
|
|
|
|
+begin
|
|
|
|
+ if not Assigned(FContextToken) then
|
|
|
|
+ FContextToken := TPoolToken.Create;
|
|
|
|
+ (FContextToken as IPooltoken).RttiPool.AddObject(AObject);
|
|
|
|
+end;
|
|
|
|
+
|
|
function TRttiContext.GetType(ATypeInfo: PTypeInfo): TRttiType;
|
|
function TRttiContext.GetType(ATypeInfo: PTypeInfo): TRttiType;
|
|
begin
|
|
begin
|
|
if not assigned(FContextToken) then
|
|
if not assigned(FContextToken) then
|