Plasma Engine  2.0
Loading...
Searching...
No Matches
LongOpControllerManager.h
1#pragma once
2
3#include <EditorEngineProcessFramework/LongOps/Implementation/LongOpManager.h>
4
5class plLongOpProxy;
6
9{
10 enum class Type
11 {
12 OpAdded,
13 OpRemoved,
15 };
16
17 Type m_Type;
19};
20
29class PL_EDITORENGINEPROCESSFRAMEWORK_DLL plLongOpControllerManager final : public plLongOpManager
30{
31 PL_DECLARE_SINGLETON(plLongOpControllerManager);
32
33public:
36
39 {
48 float m_fCompletion = 0.0f;
49 bool m_bIsRunning = false;
50 };
51
54
56 void RegisterLongOp(const plUuid& documentGuid, const plUuid& componentGuid, const char* szLongOpType);
57
59 void UnregisterLongOp(const plUuid& documentGuid, const plUuid& componentGuid, const char* szLongOpType);
60
62 void StartOperation(plUuid opGuid);
63
65 void CancelOperation(plUuid opGuid);
66
69 void CancelAndRemoveAllOpsForDocument(const plUuid& documentGuid);
70
72 ProxyOpInfo* GetOperation(const plUuid& opGuid);
73
75 const plDynamicArray<plUniquePtr<ProxyOpInfo>>& GetOperations() const { return m_ProxyOps; }
76
77private:
78 virtual void ProcessCommunicationChannelEventHandler(const plProcessCommunicationChannel::Event& e) override;
79
80 void ReplicateToWorkerProcess(ProxyOpInfo& opInfo);
81 void BroadcastProgress(ProxyOpInfo& opInfo);
82 void RemoveOperation(plUuid opGuid);
83
85};
Definition DynamicArray.h:81
Definition Event.h:177
The LongOp controller is active in the editor process and manages which long ops are available,...
Definition LongOpControllerManager.h:30
plEvent< const plLongOpControllerEvent & > m_Events
Events about the state of all available long ops.
Definition LongOpControllerManager.h:53
const plDynamicArray< plUniquePtr< ProxyOpInfo > > & GetOperations() const
Gives access to all currently available long ops. Make sure the lock m_Mutex (of the plLongOpManager ...
Definition LongOpControllerManager.h:75
Base class with shared functionality for plLongOpControllerManager and plLongOpWorkerManager.
Definition LongOpManager.h:12
Proxy long ops represent a long operation on the editor side.
Definition LongOps.h:19
A Unique ptr manages an object and destroys that object when it goes out of scope....
Definition UniquePtr.h:10
This data type is the abstraction for 128-bit Uuid (also known as GUID) instances.
Definition Uuid.h:11
Events about all known long ops. Broadcast by plLongOpControllerManager.
Definition LongOpControllerManager.h:9
plUuid m_OperationGuid
Use plLongOpControllerManager::GetOperation() to resolve the GUID to the actual long op.
Definition LongOpControllerManager.h:18
Type
Definition LongOpControllerManager.h:11
@ OpProgress
The completion progress of a long op has changed.
@ OpAdded
A new long op has been added / registered.
@ OpRemoved
A long op has been deleted. The GUID is sent, but it cannot be resolved anymore.
Holds all information about the proxy long op on the editor side.
Definition LongOpControllerManager.h:39
plUuid m_ComponentGuid
Definition LongOpControllerManager.h:44
plTime m_StartOrDuration
Definition LongOpControllerManager.h:46
plUuid m_OperationGuid
Identifies the operation itself.
Definition LongOpControllerManager.h:41
plUuid m_DocumentGuid
Definition LongOpControllerManager.h:42
Definition ProcessCommunicationChannel.h:33
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12