Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::CachedResource Class Reference

#include <Resource.h>

+ Inheritance diagram for Divide::CachedResource:

Public Member Functions

 CachedResource (const ResourceDescriptorBase &descriptor, std::string_view typeName)
 
virtual bool load (PlatformContext &context)
 Loading and unloading interface.
 
virtual bool postLoad ()
 
virtual bool unload ()
 
void setState (ResourceState currentState) final
 
- Public Member Functions inherited from Divide::Resource
 Resource (std::string_view resourceName, std::string_view typeName)
 
ResourceState getState () const noexcept
 
 PROPERTY_R (Str< 32 >, typeName)
 
 PROPERTY_R (Str< 256 >, resourceName)
 
- Public Member Functions inherited from Divide::GUIDWrapper
 GUIDWrapper () noexcept
 
 GUIDWrapper (const GUIDWrapper &old) noexcept
 
 GUIDWrapper (GUIDWrapper &&old) noexcept
 
virtual ~GUIDWrapper ()=default
 
FORCE_INLINE I64 getGUID () const noexcept
 
GUIDWrapperoperator= (const GUIDWrapper &old)=delete
 
GUIDWrapperoperator= (GUIDWrapper &&other)=delete
 

Protected Member Functions

 PROPERTY_RW (ResourcePath, assetLocation)
 
 PROPERTY_RW (Str< 256 >, assetName)
 
 PROPERTY_R (size_t, descriptorHash)
 
virtual void setState (ResourceState currentState)
 

Protected Attributes

Mutex _callbackLock {}
 
- Protected Attributes inherited from Divide::Resource
std::atomic< ResourceState_resourceState
 
- Protected Attributes inherited from Divide::GUIDWrapper
const I64 _guid
 

Friends

class ResourceCache
 
struct ResourceLoader
 

Additional Inherited Members

- Static Public Member Functions inherited from Divide::GUIDWrapper
static I64 generateGUID () noexcept
 

Detailed Description

Definition at line 89 of file Resource.h.

Constructor & Destructor Documentation

◆ CachedResource()

Divide::CachedResource::CachedResource ( const ResourceDescriptorBase descriptor,
std::string_view  typeName 
)
explicit

Definition at line 47 of file Resource.cpp.

Member Function Documentation

◆ load()

bool Divide::CachedResource::load ( PlatformContext context)
virtual

Loading and unloading interface.

Reimplemented in Divide::Material, Divide::SceneNode, Divide::ShaderProgram, and Divide::Texture.

Definition at line 55 of file Resource.cpp.

◆ postLoad()

bool Divide::CachedResource::postLoad ( )
virtual

Reimplemented in Divide::SceneNode, Divide::glTexture, Divide::ShaderProgram, and Divide::Texture.

Definition at line 60 of file Resource.cpp.

◆ PROPERTY_R()

Divide::CachedResource::PROPERTY_R ( size_t  ,
descriptorHash   
)
protected

◆ PROPERTY_RW() [1/2]

Divide::CachedResource::PROPERTY_RW ( ResourcePath  ,
assetLocation   
)
protected

◆ PROPERTY_RW() [2/2]

Divide::CachedResource::PROPERTY_RW ( Str< 256 >  ,
assetName   
)
protected

◆ setState()

void Divide::CachedResource::setState ( ResourceState  currentState)
finalvirtual

Reimplemented from Divide::Resource.

Definition at line 70 of file Resource.cpp.

◆ unload()

bool Divide::CachedResource::unload ( )
virtual

Friends And Related Function Documentation

◆ ResourceCache

friend class ResourceCache
friend

Definition at line 91 of file Resource.h.

◆ ResourceLoader

friend struct ResourceLoader
friend

Definition at line 92 of file Resource.h.

Member Data Documentation

◆ _callbackLock

Mutex Divide::CachedResource::_callbackLock {}
mutableprotected

Definition at line 105 of file Resource.h.


The documentation for this class was generated from the following files: