class
Resource
Base class for all resources.
Public
Constructors
Resource
Methods
~Resource
GetName
Returns the name of the resource.
SetName
Sets the name of the resource.
GetHandle
Get a handle to this resource, if there is any associated.
GetMetaData
Retrieves meta-data containing various information describing a resource.
AllowAsyncLoading
Returns whether or not this resource is allowed to be asynchronously loaded.
Destroy
Frees all the data held by this object.
If the object has a render proxy, the internal reference to the render proxy will be released, but the proxy will not be destroyed unless this was the last reference. If render proxy destruction does happen, it is not immediate, but rather queued for destruction on the render thread.
staticGetRttiStatic
Internal
Methods
SetHandle
Associates a handle with the resource.
Should be called right after the handle for the resource is created, or right after resource load completes.
SetId
Associates a new id with the resource.
NotifyDidDuplicate
Call this on the resource after it has been duplicated (on the duplicated object).
Protected
Methods
GetResourceDependencies
Retrieves a list of all resources that this resource depends on.
AreDependenciesLoaded
Checks if all the resources this object is dependent on are fully loaded.
AddResourceDependency
Registers a new resource that this resource is dependent on.
RemoveResourceDependency
Unregisters a previously registered dependency.
OnDidDuplicate
Called on the resource after it has been duplicated (called on the duplicated object).
IsCompressible
Returns true if the resource can be compressed using a generic compression when saved on a storage device.
Certain resources already have their contents compressed (like audio files) and will not benefit from further compression. Resources supporting streaming should never be compressed, instead such resources can handle compression/decompression locally through their streams.
Fields
mId
mSelfHandle
mName
mMetaData
mKeepSourceData
Signal to the resource implementation if original data should be kept in memory.
This is sometimes needed if the resource destroys original data during normal usage, but it might still be required for special purposes (like saving in the editor).
mDependencies
A list of all other resources this resource depends on.
mDependenciesMutex
Mutex ensuring dependencies list updates and queries are thread safe.