Plasma Engine  2.0
Loading...
Searching...
No Matches
PrefabCache.h
1#pragma once
2
3#include <Foundation/Configuration/Singleton.h>
4#include <Foundation/Configuration/Startup.h>
5#include <Foundation/Serialization/AbstractObjectGraph.h>
6#include <Foundation/Time/Timestamp.h>
7#include <Foundation/Types/UniquePtr.h>
8#include <ToolsFoundation/ToolsFoundationDLL.h>
9
11
12class PL_TOOLSFOUNDATION_DLL plPrefabCache
13{
14 PL_DECLARE_SINGLETON(plPrefabCache);
15
16public:
18
19 const plStringBuilder& GetCachedPrefabDocument(const plUuid& documentGuid);
20 const plAbstractObjectGraph* GetCachedPrefabGraph(const plUuid& documentGuid);
21 void LoadGraph(plAbstractObjectGraph& out_graph, plStringView sGraph);
22
23private:
24 PL_MAKE_SUBSYSTEM_STARTUP_FRIEND(ToolsFoundation, plPrefabCache);
25
26 struct PrefabData
27 {
28 PrefabData() = default;
29
30 plUuid m_documentGuid;
31 plString m_sAbsPath;
32
34 plStringBuilder m_sDocContent;
35 plTimestamp m_fileModifiedTime;
36 };
37 PrefabData& GetOrCreatePrefabCache(const plUuid& documentGuid);
38 void UpdatePrefabData(PrefabData& data);
39
42};
Definition AbstractObjectGraph.h:115
Definition Map.h:408
Definition PrefabCache.h:13
plStringBuilder is a class that is meant for creating and modifying strings.
Definition StringBuilder.h:35
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
The timestamp class encapsulates a date in time as microseconds since Unix epoch.
Definition Timestamp.h:23
This data type is the abstraction for 128-bit Uuid (also known as GUID) instances.
Definition Uuid.h:11