Skip to content

EntropyCanvas::AssetOpState

Base state object for async asset operations. More…

#include <AssetOperationHandle.h>

Inherits from EntropyEngine::Core::EntropyObject

Name
~AssetOpState() override =default
voidfail(AssetOpError code, std::string msg)
voidcomplete(AssetOpStatus final, std::optional< T > value =std::nullopt)
virtual const char *className() const override
Runtime class name for diagnostics and reflection.
AssetOpState() =default
Name
std::atomic< uint64_t >totalBytes
std::atomic< AssetOpStatus >status
std::optional< T >result
uint64_trequestId
std::atomic< bool >isComplete
AssetOpErrorInfoerror
std::mutexcompletionMutex
std::condition_variablecompletionCV
std::atomic< uint64_t >bytesTransferred

Protected Classes inherited from EntropyEngine::Core::EntropyObject

Name
structHandleCore
Optional handle identity stamped by an owner/registry.

Public Functions inherited from EntropyEngine::Core::EntropyObject

Name
virtual~EntropyObject() =default
virtual const TypeSystem::TypeInfo *typeInfo() const
Optional richer type information; may be null.
booltryRetain() const
Attempts to retain only if the object is still alive.
virtual std::stringtoString() const
Human-readable short string (class@ptr by default).
voidretain() const
Increments the reference count.
voidrelease() const
Decrements the reference count and deletes when it reaches zero.
uint32_trefCount() const
Current reference count (approximate under contention).
EntropyObject &operator=(const EntropyObject & ) =delete
EntropyObject &operator=(EntropyObject && ) =delete
boolhasHandle() const
template <class OwnerT >
OwnerT *
handleOwnerAs() const
Returns the stamped owner pointer cast to the requested type.
const void *handleOwner() const
uint32_thandleIndex() const
uint64_thandleId() const
uint32_thandleGeneration() const
WeakControlBlock *getWeakControlBlock() const
Lazily retrieves or creates the weak control block.
virtual std::stringdescription() const
Long-form description; defaults to toString().
virtual std::stringdebugString() const
Debug-oriented string including refcount and handle when present.
virtual uint64_tclassHash() const
Stable type hash for cross-language identification.
EntropyObject() =default
EntropyObject(EntropyObject && ) =delete
EntropyObject(const EntropyObject & ) =delete

Protected Functions inherited from EntropyEngine::Core::EntropyObject

Name
void_setHandleIdentity(void * owner, uint32_t index, uint32_t generation)
void_clearHandleIdentity()

Protected Attributes inherited from EntropyEngine::Core::EntropyObject

Name
std::atomic< WeakControlBlock * >_weakBlock
Lazily allocated control block for weak refs.
std::atomic< uint32_t >_refCount
Thread-safe retain/release counter.
struct EntropyEngine::Core::EntropyObject::HandleCore_handle

Friends inherited from EntropyEngine::Core::EntropyObject

Name
structHandleAccess
template <typename T >
class EntropyCanvas::AssetOpState;

Base state object for async asset operations.

Derives from EntropyObject for intrusive reference counting. AssetClient stores WeakRef to track pending ops without preventing cleanup. Callers receive RefObject handles for strong ownership.

~AssetOpState() override =default
inline void fail(
AssetOpError code,
std::string msg
)
inline void complete(
AssetOpStatus final,
std::optional< T > value =std::nullopt
)
inline virtual const char * className() const override

Runtime class name for diagnostics and reflection.

Reimplements: EntropyEngine::Core::EntropyObject::className

AssetOpState() =default
std::atomic< uint64_t > totalBytes {0};
std::atomic< AssetOpStatus > status {AssetOpStatus::Pending};
std::optional< T > result;
uint64_t requestId = 0;
std::atomic< bool > isComplete {false};
AssetOpErrorInfo error;
std::mutex completionMutex;
std::condition_variable completionCV;
std::atomic< uint64_t > bytesTransferred {0};

Updated on 2026-01-26 at 17:14:35 -0500