EntropyEngine::Core::EntropyObject
EntropyEngine::Core::EntropyObject
Section titled “EntropyEngine::Core::EntropyObject”Ref-counted base with optional handle stamping and basic introspection. More…
#include <EntropyObject.h>
Inherited by EntropyCanvas::AssetOpState< EntropyCanvas::AssetUploadResult >, [EntropyCanvas::AssetOpState< void >](/api/EntropyCanvas/AssetOpState< void >/), EntropyEngine::Core::Graph::AcyclicNodeHandle< WorkGraphNode >, EntropyCanvas::AssetOpState< T >, [EntropyCanvas::AssetOpState< void >](/api/EntropyCanvas/AssetOpState< void >/), EntropyEngine::Core::Concurrency::WorkContractGroup, EntropyEngine::Core::Concurrency::WorkContractHandle, EntropyEngine::Core::EntropyApplication, EntropyEngine::Core::EntropyService, EntropyEngine::Core::Graph::AcyclicNodeHandle< T >, EntropyEngine::Core::IO::FileWatch, EntropyEngine::Core::IO::IFileSystemBackend, EntropyEngine::Networking::ConnectionHandle, EntropyEngine::Networking::ConnectionManager, EntropyEngine::Networking::LocalServer, EntropyEngine::Networking::NetworkConnection, EntropyEngine::Networking::NetworkSession, EntropyEngine::Networking::RemoteServer, EntropyEngine::Networking::SessionHandle, EntropyEngine::Networking::SessionManager
Protected Classes
Section titled “Protected Classes”| Name | |
|---|---|
| struct | HandleCore Optional handle identity stamped by an owner/registry. |
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| virtual | ~EntropyObject() =default |
| virtual const TypeSystem::TypeInfo * | typeInfo() const Optional richer type information; may be null. |
| bool | tryRetain() const Attempts to retain only if the object is still alive. |
| virtual std::string | toString() const Human-readable short string (class@ptr by default). |
| void | retain() const Increments the reference count. |
| void | release() const Decrements the reference count and deletes when it reaches zero. |
| uint32_t | refCount() const Current reference count (approximate under contention). |
| EntropyObject & | operator=(const EntropyObject & ) =delete |
| EntropyObject & | operator=(EntropyObject && ) =delete |
| bool | hasHandle() const |
| template <class OwnerT > OwnerT * | handleOwnerAs() const Returns the stamped owner pointer cast to the requested type. |
| const void * | handleOwner() const |
| uint32_t | handleIndex() const |
| uint64_t | handleId() const |
| uint32_t | handleGeneration() const |
| WeakControlBlock * | getWeakControlBlock() const Lazily retrieves or creates the weak control block. |
| virtual std::string | description() const Long-form description; defaults to toString(). |
| virtual std::string | debugString() const Debug-oriented string including refcount and handle when present. |
| virtual const char * | className() const Runtime class name for diagnostics and reflection. |
| virtual uint64_t | classHash() const Stable type hash for cross-language identification. |
| EntropyObject() =default | |
| EntropyObject(EntropyObject && ) =delete | |
| EntropyObject(const EntropyObject & ) =delete |
Protected Functions
Section titled “Protected Functions”| Name | |
|---|---|
| void | _setHandleIdentity(void * owner, uint32_t index, uint32_t generation) |
| void | _clearHandleIdentity() |
Protected Attributes
Section titled “Protected Attributes”| 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
Section titled “Friends”| Name | |
|---|---|
| struct | HandleAccess |
Detailed Description
Section titled “Detailed Description”class EntropyEngine::Core::EntropyObject;Ref-counted base with optional handle stamping and basic introspection.
Designed for safe sharing across module/language boundaries. Reference count operations are thread-safe. When stamped with a handle identity, the object can participate in owner/index/generation validation without coupling to a specific handle type.
Public Functions Documentation
Section titled “Public Functions Documentation”function ~EntropyObject
Section titled “function ~EntropyObject”virtual ~EntropyObject() =defaultfunction typeInfo
Section titled “function typeInfo”inline virtual const TypeSystem::TypeInfo * typeInfo() constOptional richer type information; may be null.
function tryRetain
Section titled “function tryRetain”bool tryRetain() constAttempts to retain only if the object is still alive.
Return: true on success (reference acquired), false if object already dead
Use when you need to safely grab a reference from a background thread without racing destruction. If the refcount has already reached zero, tryRetain() returns false and the object must not be used.
// Example: Try to use an object that might be concurrently releasedif (obj->tryRetain()) { doWork(obj); obj->release();} // else: object was already destroyed or being destroyedfunction toString
Section titled “function toString”virtual std::string toString() constHuman-readable short string (class@ptr by default).
Reimplemented by: EntropyEngine::Core::Concurrency::WorkContractGroup::toString, EntropyEngine::Core::Concurrency::WorkContractHandle::toString, EntropyEngine::Networking::ConnectionHandle::toString, EntropyEngine::Networking::ConnectionManager::toString, EntropyEngine::Networking::NamedPipeServer::toString, EntropyEngine::Networking::SessionHandle::toString, EntropyEngine::Networking::SessionManager::toString, EntropyEngine::Networking::UnixSocketServer::toString
function retain
Section titled “function retain”void retain() constIncrements the reference count.
Note: Thread-safe; may be called from any thread.
function release
Section titled “function release”void release() constDecrements the reference count and deletes when it reaches zero.
Note: Thread-safe; may delete the object on the calling thread when count hits zero.
function refCount
Section titled “function refCount”uint32_t refCount() constCurrent reference count (approximate under contention).
function operator=
Section titled “function operator=”EntropyObject & operator=( const EntropyObject &) =deletefunction operator=
Section titled “function operator=”EntropyObject & operator=( EntropyObject &&) =deletefunction hasHandle
Section titled “function hasHandle”inline bool hasHandle() constReturn: true if an owner has stamped this object with handle identity
function handleOwnerAs
Section titled “function handleOwnerAs”template <class OwnerT >inline OwnerT * handleOwnerAs() constReturns the stamped owner pointer cast to the requested type.
Template Parameters:
- OwnerT Expected owner class type (e.g., WorkContractGroup)
Return: Owner pointer cast to OwnerT*, or nullptr if not stamped
Note: Safe by construction: owners stamp the object with the true owner pointer
function handleOwner
Section titled “function handleOwner”inline const void * handleOwner() constReturn: Owner pointer that stamped this object, or null if none
function handleIndex
Section titled “function handleIndex”inline uint32_t handleIndex() constReturn: Index value stamped by the owner (undefined if !hasHandle())
function handleId
Section titled “function handleId”inline uint64_t handleId() constReturn: 64-bit packed index:generation identifier (undefined if !hasHandle())
function handleGeneration
Section titled “function handleGeneration”inline uint32_t handleGeneration() constReturn: Generation value stamped by the owner (undefined if !hasHandle())
function getWeakControlBlock
Section titled “function getWeakControlBlock”WeakControlBlock * getWeakControlBlock() constLazily retrieves or creates the weak control block.
Return: Pointer to the control block (retained by the object)
function description
Section titled “function description”virtual std::string description() constLong-form description; defaults to toString().
Reimplemented by: EntropyEngine::Core::Concurrency::WorkContractGroup::description
function debugString
Section titled “function debugString”virtual std::string debugString() constDebug-oriented string including refcount and handle when present.
Reimplemented by: EntropyEngine::Core::Concurrency::WorkContractGroup::debugString
function className
Section titled “function className”inline virtual const char * className() constRuntime class name for diagnostics and reflection.
Reimplemented by: EntropyApplication::className, EntropyCanvas::AssetOpState::className, EntropyCanvas::AssetOpState::className, [EntropyCanvas::AssetOpState< void >::className](/api/EntropyCanvas/AssetOpState< void >/#function-classname), EntropyEngine::Core::Concurrency::WorkContractGroup::className, EntropyEngine::Core::Concurrency::WorkContractHandle::className, EntropyEngine::Core::EntropyApplication::className, EntropyEngine::Core::EntropyService::className, EntropyEngine::Core::Graph::AcyclicNodeHandle::className, EntropyEngine::Core::Graph::AcyclicNodeHandle::className, EntropyEngine::Core::IO::FileWatch::className, EntropyEngine::Core::IO::IFileSystemBackend::className, EntropyEngine::Core::IO::LocalFileSystemBackend::className, EntropyEngine::Networking::ConnectionHandle::className, EntropyEngine::Networking::ConnectionManager::className, EntropyEngine::Networking::NamedPipeServer::className, EntropyEngine::Networking::SessionHandle::className, EntropyEngine::Networking::SessionManager::className, EntropyEngine::Networking::UnixSocketServer::className
function classHash
Section titled “function classHash”virtual uint64_t classHash() constStable type hash for cross-language identification.
Reimplemented by: EntropyEngine::Core::Concurrency::WorkContractGroup::classHash, EntropyEngine::Core::Concurrency::WorkContractHandle::classHash, EntropyEngine::Core::Graph::AcyclicNodeHandle::classHash, EntropyEngine::Core::Graph::AcyclicNodeHandle::classHash, EntropyEngine::Networking::ConnectionHandle::classHash, EntropyEngine::Networking::ConnectionManager::classHash, EntropyEngine::Networking::NamedPipeServer::classHash, EntropyEngine::Networking::SessionHandle::classHash, EntropyEngine::Networking::SessionManager::classHash, EntropyEngine::Networking::UnixSocketServer::classHash
function EntropyObject
Section titled “function EntropyObject”EntropyObject() =defaultfunction EntropyObject
Section titled “function EntropyObject”EntropyObject( EntropyObject &&) =deletefunction EntropyObject
Section titled “function EntropyObject”EntropyObject( const EntropyObject &) =deleteProtected Functions Documentation
Section titled “Protected Functions Documentation”function _setHandleIdentity
Section titled “function _setHandleIdentity”inline void _setHandleIdentity( void * owner, uint32_t index, uint32_t generation)function _clearHandleIdentity
Section titled “function _clearHandleIdentity”inline void _clearHandleIdentity()Protected Attributes Documentation
Section titled “Protected Attributes Documentation”variable _weakBlock
Section titled “variable _weakBlock”std::atomic< WeakControlBlock * > _weakBlock {nullptr};Lazily allocated control block for weak refs.
variable _refCount
Section titled “variable _refCount”std::atomic< uint32_t > _refCount {1};Thread-safe retain/release counter.
variable _handle
Section titled “variable _handle”struct EntropyEngine::Core::EntropyObject::HandleCore _handle;Friends
Section titled “Friends”friend HandleAccess
Section titled “friend HandleAccess”friend struct HandleAccess( HandleAccess);Updated on 2026-01-26 at 16:50:32 -0500