![]() |
Plasma Engine
2.0
|
Helper class to acquire and release a resource safely. More...
#include <ResourceLock.h>
Public Member Functions | |
PL_ALWAYS_INLINE | plResourceLock (const plTypedResourceHandle< RESOURCE_TYPE > &hResource, plResourceAcquireMode mode, const plTypedResourceHandle< RESOURCE_TYPE > &hFallbackResource=plTypedResourceHandle< RESOURCE_TYPE >()) |
plResourceLock (const plResourceLock &)=delete | |
plResourceLock (plResourceLock &&other) | |
PL_ALWAYS_INLINE RESOURCE_TYPE * | operator-> () |
PL_ALWAYS_INLINE const RESOURCE_TYPE * | operator-> () const |
PL_ALWAYS_INLINE bool | IsValid () const |
PL_ALWAYS_INLINE | operator bool () const |
PL_ALWAYS_INLINE plResourceAcquireResult | GetAcquireResult () const |
PL_ALWAYS_INLINE const RESOURCE_TYPE * | GetPointer () const |
PL_ALWAYS_INLINE RESOURCE_TYPE * | GetPointerNonConst () const |
Helper class to acquire and release a resource safely.
The constructor calls plResourceManager::BeginAcquireResource, the destructor makes sure to call plResourceManager::EndAcquireResource. The instance of this class can be used like a pointer to the resource.
Whether the acquisition succeeded or returned a loading fallback, missing fallback or even no result, at all, can be retrieved through GetAcquireResult().