Plasma Engine  2.0
Loading...
Searching...
No Matches
ResourceManagerState.h
1#pragma once
2
3#include <Core/CoreInternal.h>
4PL_CORE_INTERNAL_HEADER
5
6#include <Core/ResourceManager/ResourceManager.h>
7
9{
10private:
11 friend class plResource;
12 friend class plResourceManager;
15 friend class plResourceHandleReadContext;
16
19
22
26
28
32
33 plMap<const plRTTI*, plResourcePriority> m_ResourceTypePriorities;
34
36
37 struct TaskDataUpdateContent
38 {
40 plTaskGroupID m_GroupId;
41 };
42
43 struct TaskDataDataLoad
44 {
46 plTaskGroupID m_GroupId;
47 };
48
49 bool m_bTaskNamesInitialized = false;
50 bool m_bBroadcastExistsEvent = false;
51 plUInt32 m_uiForceNoFallbackAcquisition = 0;
52
53 // resources in this queue are waiting for a task to load them
55
57
58 bool m_bAllowLaunchDataLoadTask = true;
59 bool m_bShutdown = false;
60
61 plHybridArray<TaskDataUpdateContent, 24> m_WorkerTasksUpdateContent;
62 plHybridArray<TaskDataDataLoad, 8> m_WorkerTasksDataLoad;
63
64 plTime m_LastFrameUpdate;
65 plUInt32 m_uiLastResourcePriorityUpdateIdx = 0;
66
67 plDynamicArray<plResource*> m_LoadedResourceOfTypeTempContainer;
68 plHashTable<plTempHashedString, const plRTTI*> m_ResourcesToUnloadOnMainThread;
69
70 const plRTTI* m_pFreeUnusedLastType = nullptr;
71 plTempHashedString m_sFreeUnusedLastResourceID;
72
73 // Type Loaders
74
76 plResourceLoaderFromFile m_FileResourceLoader;
77 plResourceTypeLoader* m_pDefaultResourceLoader = &m_FileResourceLoader;
79
80
81 // Override / derived resources
82
84
85
86 // Named resources
87
89
90 // Asset system interaction
91
92 plMap<plString, const plRTTI*> m_AssetToResourceType;
93
94
95 // Export mode
96
97 bool m_bExportMode = false;
98 plUInt32 m_uiNextResourceID = 0;
99
100 // Resource Unloading
101 plTime m_AutoFreeUnusedTimeout = plTime::MakeZero();
102 plTime m_AutoFreeUnusedThreshold = plTime::MakeZero();
103
105};
Definition Deque.h:270
Definition DynamicArray.h:81
Definition Event.h:177
Definition HashTable.h:333
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
Definition Map.h:408
This class holds information about reflected types. Each instance represents one type that is known t...
Definition RTTI.h:30
The base class for all resources.
Definition Resource.h:10
A default implementation of plResourceTypeLoader for standard file loading.
Definition ResourceTypeLoader.h:60
The central class for managing all types derived from plResource.
Definition ResourceManager.h:16
Definition ResourceManagerState.h:9
[internal] Worker task for loading resources (typically from disk).
Definition WorkerTasks.h:10
[internal] Worker task for uploading resource data. Depending on the resource type,...
Definition WorkerTasks.h:26
Base class for all resource loaders.
Definition ResourceTypeLoader.h:29
A Shared ptr manages a shared object and destroys that object when no one references it anymore....
Definition SharedPtr.h:10
Given out by plTaskSystem::CreateTaskGroup to identify a task group.
Definition TaskSystemDeclarations.h:103
A class to use together with plHashedString for quick comparisons with temporary strings that need no...
Definition HashedString.h:151
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12
PL_ALWAYS_INLINE static constexpr plTime MakeZero()
Creates an instance of plTime that was initialized with zero.
Definition Time.h:42