Plasma Engine  2.0
Loading...
Searching...
No Matches
LongOps.h
1#pragma once
2
3#include <EditorEngineProcessFramework/EditorEngineProcessFrameworkDLL.h>
4#include <Foundation/Reflection/Reflection.h>
5
8class plProgress;
9
11
18class PL_EDITORENGINEPROCESSFRAMEWORK_DLL plLongOpProxy : public plReflectedClass
19{
20 PL_ADD_DYNAMIC_REFLECTION(plLongOpProxy, plReflectedClass);
21
22public:
25 virtual void InitializeRegistered(const plUuid& documentGuid, const plUuid& componentGuid) {}
26
28 virtual const char* GetDisplayName() const = 0;
29
34 virtual void GetReplicationInfo(plStringBuilder& out_sReplicationOpType, plStreamWriter& inout_config) = 0;
35
39 virtual void Finalize(plResult result, const plDataBuffer& resultData) {}
40};
41
43
51class PL_EDITORENGINEPROCESSFRAMEWORK_DLL plLongOpWorker : public plReflectedClass
52{
53 PL_ADD_DYNAMIC_REFLECTION(plLongOpWorker, plReflectedClass);
54
55public:
60 virtual plResult InitializeExecution(plStreamReader& ref_config, const plUuid& documentGuid) { return PL_SUCCESS; }
61
71 virtual plResult Execute(plProgress& ref_progress, plStreamWriter& ref_proxydata) = 0;
72};
Proxy long ops represent a long operation on the editor side.
Definition LongOps.h:19
virtual const char * GetDisplayName() const =0
Called by the plQtLongOpsPanel to determine the display string to be shown in the UI.
virtual void GetReplicationInfo(plStringBuilder &out_sReplicationOpType, plStreamWriter &inout_config)=0
Called every time the long op shall be executed.
virtual void Finalize(plResult result, const plDataBuffer &resultData)
Called once the corresponding plLongOpWorker has finished.
Definition LongOps.h:39
virtual void InitializeRegistered(const plUuid &documentGuid, const plUuid &componentGuid)
Called once by plLongOpControllerManager::RegisterLongOp() to inform the proxy to which plDocument an...
Definition LongOps.h:25
Worker long ops are executed by the editor engine process.
Definition LongOps.h:52
virtual plResult InitializeExecution(plStreamReader &ref_config, const plUuid &documentGuid)
Called within the engine processes main thread. The function may lock the plWorld from the given scen...
Definition LongOps.h:60
virtual plResult Execute(plProgress &ref_progress, plStreamWriter &ref_proxydata)=0
Executed in a separete thread after InitializeExecution(). This should do the work that takes a while...
Manages the way a progress bar is subdivided and advanced.
Definition Progress.h:36
All classes that should be dynamically reflectable, need to be derived from this base class.
Definition DynamicRTTI.h:86
Interface for binary in (read) streams.
Definition Stream.h:22
Interface for binary out (write) streams.
Definition Stream.h:107
plStringBuilder is a class that is meant for creating and modifying strings.
Definition StringBuilder.h:35
This data type is the abstraction for 128-bit Uuid (also known as GUID) instances.
Definition Uuid.h:11
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54