CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::AbstractResourceHandle Class Reference

Base class for weak and strong resource handle implementation. More...

#include <CeresEngine/Resource/ResourceHandle.hpp>

Inheritance diagram for CeresEngine::AbstractResourceHandle:
CeresEngine::ResourceHandle< Texture > CeresEngine::ResourceHandle< Mesh > CeresEngine::ResourceHandle< Shader > CeresEngine::ResourceHandle< Terrain > CeresEngine::ResourceHandle< Material > CeresEngine::ResourceHandle< Font > CeresEngine::ResourceHandle< Scene > CeresEngine::ResourceHandle< T >

Public Member Functions

 AbstractResourceHandle ()=default
 
 AbstractResourceHandle (ResourceHandleData *data)
 
 AbstractResourceHandle (SPtr< Resource > resource) noexcept
 
const UUIDgetUUID () const noexcept
 
bool isValid () const noexcept
 Checks if the resource handle is valid.
 
Async< HResourceload () const
 Loads the resource, if not loaded.
 
bool isLoaded () const noexcept
 Checks if the resource handle is valid and loaded.
 
 operator bool () const noexcept
 Checks if the resource handle is valid.
 
void reset ()
 Resets the resource handle to the default state.
 

Protected Member Functions

void set (ResourceHandleData *const data) noexcept
 Changes the internal resource handle data object of the handle.
 

Protected Attributes

ResourceHandleDatamData = nullptr
 

Detailed Description

Base class for weak and strong resource handle implementation.

Constructor & Destructor Documentation

◆ AbstractResourceHandle() [1/3]

CeresEngine::AbstractResourceHandle::AbstractResourceHandle ( )
default

◆ AbstractResourceHandle() [2/3]

CeresEngine::AbstractResourceHandle::AbstractResourceHandle ( ResourceHandleData data)
inlineexplicit

◆ AbstractResourceHandle() [3/3]

CeresEngine::AbstractResourceHandle::AbstractResourceHandle ( SPtr< Resource resource)
explicitnoexcept

Member Function Documentation

◆ getUUID()

const UUID & CeresEngine::AbstractResourceHandle::getUUID ( ) const
inlinenoexcept

◆ isLoaded()

bool CeresEngine::AbstractResourceHandle::isLoaded ( ) const
inlinenoexcept

Checks if the resource handle is valid and loaded.

◆ isValid()

bool CeresEngine::AbstractResourceHandle::isValid ( ) const
inlinenoexcept

Checks if the resource handle is valid.

◆ load()

Async< HResource > CeresEngine::AbstractResourceHandle::load ( ) const

Loads the resource, if not loaded.

◆ operator bool()

CeresEngine::AbstractResourceHandle::operator bool ( ) const
inlineexplicitnoexcept

Checks if the resource handle is valid.

◆ reset()

void CeresEngine::AbstractResourceHandle::reset ( )
inline

Resets the resource handle to the default state.

◆ set()

void CeresEngine::AbstractResourceHandle::set ( ResourceHandleData *const  data)
inlineprotectednoexcept

Changes the internal resource handle data object of the handle.

This will keep track of the reference counting calls.

Parameters
dataThe new resource handle data to be set. Can be nullptr.

Member Data Documentation

◆ mData

ResourceHandleData* CeresEngine::AbstractResourceHandle::mData = nullptr
protected

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