Plasma Engine  2.0
Loading...
Searching...
No Matches
GraphPatch.h
1#pragma once
2
4
5#include <Foundation/Basics.h>
6#include <Foundation/Serialization/GraphVersioning.h>
7#include <Foundation/Strings/HashedString.h>
8#include <Foundation/Utilities/EnumerableClass.h>
9
10class plRTTI;
15
19class PL_FOUNDATION_DLL plGraphPatch : public plEnumerable<plGraphPatch>
20{
21public:
22 enum class PatchType : plUInt8
23 {
24 NodePatch,
25 GraphPatch,
26 };
27
35 plGraphPatch(const char* szType, plUInt32 uiTypeVersion, PatchType type = PatchType::NodePatch);
36
39 virtual void Patch(plGraphPatchContext& ref_context, plAbstractObjectGraph* pGraph, plAbstractObjectNode* pNode) const = 0;
41 const char* GetType() const;
43 plUInt32 GetTypeVersion() const;
44 PatchType GetPatchType() const;
45
46 PL_DECLARE_ENUMERABLE_CLASS(plGraphPatch);
47
48private:
49 const char* m_szType = nullptr;
50 plUInt32 m_uiTypeVersion;
51 PatchType m_PatchType;
52};
Definition AbstractObjectGraph.h:115
Definition AbstractObjectGraph.h:17
Base class to add the ability to another class to enumerate all active instance of it,...
Definition EnumerableClass.h:28
Handles the patching of a node. Is passed into the patch classes to provide utility functions and tra...
Definition GraphVersioning.h:69
Patch base class for plAbstractObjectGraph patches.
Definition GraphPatch.h:20
virtual void Patch(plGraphPatchContext &ref_context, plAbstractObjectGraph *pGraph, plAbstractObjectNode *pNode) const =0
Patch function. If type == PatchType::NodePatch, the implementation needs to patch pNode in pGraph to...
PatchType
Definition GraphPatch.h:23
Singleton that allows version patching of plAbstractObjectGraph.
Definition GraphVersioning.h:106
This class holds information about reflected types. Each instance represents one type that is known t...
Definition RTTI.h:30