3#include "ResourceLoadInfo.h"
4#include "ResourceHandle.h"
12 struct ResourceManagerBaseStorage;
20 void initialize()
override;
21 void clear()
override;
23 void reportLeaks(std::string_view typeName);
26 std::string getReport();
61 void processLoading()
final;
70 void activateResources()
final;
77 virtual void processDeletion()
override;
79 void fillDeletionQueue(std::vector<ResourceBase *> & deletion);
89 ResourceId getNextResourceId()
override;
97 void setResourceId(
ResourceBase * resource, ResourceId
id)
override;
108 virtual void handleDeletionInternal(
ResourceBase * resource) = 0;
111 virtual bool shouldAutoReload()
const;
112 virtual bool shouldMergeBySource()
const {
return true; }
115 std::vector<ResourceBase *> getAllocatedResources()
const;
125 virtual void destroyInternal(
ResourceBase * resource) = 0;
126 virtual void destroyInternalLocked(
ResourceBase * resource) = 0;
132 virtual int getUpdateQuota()
const;
135 size_t updatedResourceCount();
138 size_t orphanedResourceCount();
141 size_t allocatedResourceCount();
148 [[nodiscard]]
bool isValidResource(ResourceId
id)
const;
154 std::unique_ptr<ResourceManagerBaseStorage> storage;
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Defines common resource manager interface shared by resource managers for all types of resources.
virtual void postProcessLoading()
Hook for resource managers to run code at the tail of processLoading.
ActivationResult
Defines results for resource activation.
ResourceTypes
Resource types.
Contains all Cogs related functionality.
Base class for engine resources.
Resource handle base class handling reference counting of resources derived from ResourceBase.