Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
Deki::AssetRef< T > Struct Template Reference

Type-safe asset reference wrapper. More...

#include <AssetRef.h>

Inherits Deki::AssetRefBase.

Public Member Functions

T * Get ()
const T * Get () const
T * operator-> ()
const T * operator-> () const
T & operator* ()
const T & operator* () const
 operator T* ()
 operator const T * () const
 operator bool () const
AssetRefoperator= (T *p)
bool operator== (const T *other) const
bool operator!= (const T *other) const
bool operator== (std::nullptr_t) const
bool operator!= (std::nullptr_t) const
Public Member Functions inherited from Deki::AssetRefBase
bool HasGuid () const
bool HasSource () const
bool IsLoaded () const

Additional Inherited Members

Public Attributes inherited from Deki::AssetRefBase
void * ptr = nullptr
std::string guid
std::string source
bool loadAttempted = false
uint64_t cachedEpoch = 0

Detailed Description

template<typename T>
struct Deki::AssetRef< T >

Type-safe asset reference wrapper.

Provides transparent access to the underlying asset pointer while storing the GUID for asset loading. Works with any type T that has a static constexpr const char* AssetTypeName member.

Template Parameters
TThe asset type (must expose a static AssetTypeName member)

Member Function Documentation

◆ Get() [1/2]

template<typename T>
T * Deki::AssetRef< T >::Get ( )
inline

◆ Get() [2/2]

template<typename T>
const T * Deki::AssetRef< T >::Get ( ) const
inline

◆ operator->() [1/2]

template<typename T>
T * Deki::AssetRef< T >::operator-> ( )
inline

◆ operator->() [2/2]

template<typename T>
const T * Deki::AssetRef< T >::operator-> ( ) const
inline

◆ operator*() [1/2]

template<typename T>
T & Deki::AssetRef< T >::operator* ( )
inline

◆ operator*() [2/2]

template<typename T>
const T & Deki::AssetRef< T >::operator* ( ) const
inline

◆ operator T*()

template<typename T>
Deki::AssetRef< T >::operator T* ( )
inline

◆ operator const T *()

template<typename T>
Deki::AssetRef< T >::operator const T * ( ) const
inline

◆ operator bool()

template<typename T>
Deki::AssetRef< T >::operator bool ( ) const
inline

◆ operator=()

template<typename T>
AssetRef & Deki::AssetRef< T >::operator= ( T * p)
inline

◆ operator==() [1/2]

template<typename T>
bool Deki::AssetRef< T >::operator== ( const T * other) const
inline

◆ operator!=() [1/2]

template<typename T>
bool Deki::AssetRef< T >::operator!= ( const T * other) const
inline

◆ operator==() [2/2]

template<typename T>
bool Deki::AssetRef< T >::operator== ( std::nullptr_t ) const
inline

◆ operator!=() [2/2]

template<typename T>
bool Deki::AssetRef< T >::operator!= ( std::nullptr_t ) const
inline

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