XII Release 0.1.0
Loading...
Searching...
No Matches
xiiCustomDataResourceBase Class Referenceabstract

#include <CustomData.h>

Inheritance diagram for xiiCustomDataResourceBase:
[legend]

Protected Member Functions

virtual void CreateAndLoadData (xiiAbstractObjectGraph &ref_graph, xiiRttiConverterContext &ref_context, const xiiAbstractObjectNode *pRootNode)=0
virtual xiiResourceLoadDescription UnloadData (Unload WhatToUnload) override
xiiResourceLoadDescription UpdateContent_Internal (xiiStreamReader *pStream, const xiiRTTI &rtti)
Protected Member Functions inherited from xiiResource
 xiiResource (DoUpdate resourceUpdateThread, xiiUInt8 uiQualityLevelsLoadable)
 Default constructor.
virtual ~xiiResource ()
 virtual destructor.
MemoryUsage & ModifyMemoryUsage ()
 Non-const version for resources that want to write this variable directly.
void SetIsReloadable (bool bIsReloadable)
void SetHasLoadingFallback (bool bHasLoadingFallback)
 Used internally by the code injection macros.

Additional Inherited Members

Public Types inherited from xiiResource
enum class  DoUpdate : xiiUInt8 { OnMainThread = 0U , OnAnyThread }
 Specifies the thread type on which update operations should be performed. More...
Public Member Functions inherited from xiiResource
XII_ALWAYS_INLINE xiiStringView GetResourceID () const
XII_ALWAYS_INLINE xiiUInt64 GetResourceIDHash () const
 Returns the hash of the unique ID.
void SetResourceDescription (xiiStringView sDescription)
const xiiString & GetResourceDescription () const
const xiiString & GetResourceIdOrDescription () const
XII_ALWAYS_INLINE xiiResourceState GetLoadingState () const
 Returns the current state in which this resource is in.
XII_ALWAYS_INLINE xiiUInt8 GetNumQualityLevelsDiscardable () const
XII_ALWAYS_INLINE xiiUInt8 GetNumQualityLevelsLoadable () const
 Returns how many quality levels the resource may additionally load.
float GetLoadingPriority (xiiTime now) const
 Returns the priority that is used by the resource manager to determine which resource to load next.
xiiResourcePriority GetPriority () const
 Returns the current resource priority.
void SetPriority (xiiResourcePriority priority)
 Changes the current resource priority.
XII_ALWAYS_INLINE const xiiBitflags< xiiResourceFlags > & GetBaseResourceFlags () const
 Returns the basic flags for the resource type. Mostly used the resource manager.
XII_ALWAYS_INLINE const MemoryUsage & GetMemoryUsage () const
 Returns the information about the current memory usage of the resource.
XII_ALWAYS_INLINE xiiTime GetLastAcquireTime () const
XII_ALWAYS_INLINE xiiInt32 GetReferenceCount () const
 Returns the reference count of this resource.
XII_ALWAYS_INLINE const xiiTimestamp & GetLoadedFileModificationTime () const
XII_ALWAYS_INLINE xiiUInt32 GetCurrentResourceChangeCounter () const
XII_ALWAYS_INLINE void IncResourceChangeCounter ()
 Allows to manually increase the resource change counter to signal that dependent code might need to update.
virtual void ResetResource ()
void PrintHandleStackTraces ()
Public Member Functions inherited from xiiReflectedClass
virtual const xiiRTTI * GetDynamicRTTI () const
bool IsInstanceOf (const xiiRTTI *pType) const
 Returns whether the type of this instance is of the given type or derived from it.
template<typename T>
XII_ALWAYS_INLINE bool IsInstanceOf () const
 Returns whether the type of this instance is of the given type or derived from it.
Static Public Member Functions inherited from xiiNoBase
static const xiiRTTI * GetStaticRTTI ()
Public Attributes inherited from xiiResource
xiiEvent< const xiiResourceEvent &, xiiMutex > m_ResourceEvents
Protected Types inherited from xiiResource
enum class  Unload : xiiUInt8 { AllQualityLevels = 0U , OneQualityLevel }

Detailed Description

Base class for resources that represent different implementations of xiiCustomData.

These resources are automatically generated using these macros: XII_DECLARE_CUSTOM_DATA_RESOURCE(YourCustomData) XII_DEFINE_CUSTOM_DATA_RESOURCE(YourCustomData)

Put the former into a header next to YourCustomData and the latter into an implementation file.

This builds these types: YourCustomDataResource YourCustomDataResourceHandle

You can then use these to reference this resource type for example in components. For a full example search the SampleGamePlugin for SampleCustomDataResource and SampleCustomDataResourceHandle and see how they are used.

Member Function Documentation

◆ UnloadData()

xiiResourceLoadDescription xiiCustomDataResourceBase::UnloadData ( Unload WhatToUnload)
overrideprotectedvirtual

Requests the resource to unload another quality level. If bFullUnload is true, the resource should unload all data, because it is going to be deleted afterwards.

Implements xiiResource.

Reimplemented in xiiCustomDataResource< T >.


The documentation for this class was generated from the following files:
  • /home/runner/work/XII/XII/Source/Engine/Core/Utils/CustomData.h
  • /home/runner/work/XII/XII/Source/Engine/Core/Utils/Implementation/CustomData.cpp