From 47d13ce16db371f724642e5a8b0f3130b3512cf1 Mon Sep 17 00:00:00 2001 From: Michael Van Canneyt Date: Fri, 25 Apr 2025 10:09:22 +0200 Subject: [PATCH] * Move threadawareobjectbridge to separate unit --- packages/job/src/job_browser.pp | 39 +-------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/packages/job/src/job_browser.pp b/packages/job/src/job_browser.pp index 0c65fe8..9bf6229 100644 --- a/packages/job/src/job_browser.pp +++ b/packages/job/src/job_browser.pp @@ -129,19 +129,6 @@ Type property OnCallBackPasError : TCallbackErrorPasEventHandler read FOnCallBackPasError Write FOnCallBackPasError; end; - { TJSThreadAwareObjectBridge } - TShareObjectEvent = procedure (aObjectID: TJOBObjectID; aThreadID: Longint; aObj : TJSObject) of object; - - TJSThreadAwareObjectBridge = class(TJSObjectBridge) - private - FOnShareObject: TShareObjectEvent; - Protected - function ShareObject(aObjectID: TJOBObjectID; aThreadID: Longint): TJOBResult; virtual; - public - procedure FillImportObject(aObject: TJSObject); override; - Property OnShareObject : TShareObjectEvent Read FOnShareObject Write FOnShareObject; - end; - Implementation @@ -180,6 +167,7 @@ end; { TJSObjectFactoryReg } + constructor TJSObjectFactoryReg.Create(aFunc: TJSObjectFactory); begin FFunc:=aFunc; @@ -1323,30 +1311,5 @@ begin Console.debug(FGlobalObjects); end; -{ TJSThreadAwareObjectBridge } - -function TJSThreadAwareObjectBridge.ShareObject(aObjectID : TJOBObjectID; aThreadID : Longint) : TJOBResult; - -var - Obj : TJSObject; - -begin - Result:=JOBResult_None; - Obj:=FindObject(aObjectID); - if not Assigned(Obj) then - exit(JOBResult_UnknownObjId); - if not Assigned(OnShareObject) then - exit(JOBResult_UnImplemented); - OnShareObject(aObjectID,aThreadId,Obj); - Result:=JOBResult_Success; -end; - - - -procedure TJSThreadAwareObjectBridge.FillImportObject(aObject: TJSObject); -begin - inherited FillImportObject(aObject); - aObject[JOBFn_ShareObject]:=@ShareObject; -end; end.