Skip to content

EntropyEngine::Core::Graph::AcyclicNodeHandle

EntropyEngine::Core::Graph::AcyclicNodeHandle

Section titled “EntropyEngine::Core::Graph::AcyclicNodeHandle”

Lightweight, stamped handle to a node in a DirectedAcyclicGraph. More…

#include <AcyclicNodeHandle.h>

Inherits from EntropyEngine::Core::EntropyObject

Name
AcyclicNodeHandle &operator=(const AcyclicNodeHandle & other)
Copies or clears the stamped identity depending on source validity.
AcyclicNodeHandle &operator=(AcyclicNodeHandle && other)
Move-assigns by copying or clearing identity based on source validity.
virtual const char *className() const override
Runtime type name for diagnostics.
virtual uint64_tclassHash() const override
Stable type hash for cross-language identification.
AcyclicNodeHandle() =default
Default-constructed handle with no identity (invalid).
AcyclicNodeHandle(GraphT * graph, uint32_t index, uint32_t generation)
Internal constructor used by DirectedAcyclicGraph to stamp identity.
AcyclicNodeHandle(const AcyclicNodeHandle & other)
Copies the stamped identity from another handle (if present).
AcyclicNodeHandle(AcyclicNodeHandle && other)
Moves by copying the stamped identity (handles are lightweight).
Name
classDirectedAcyclicGraph

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).
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.
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 <class T >
class EntropyEngine::Core::Graph::AcyclicNodeHandle;

Lightweight, stamped handle to a node in a DirectedAcyclicGraph.

AcyclicNodeHandle is an EntropyObject that carries an owner+index+generation identity stamped by DirectedAcyclicGraph. The generation prevents stale-handle reuse after node removal. Handles are cheap to copy and compare.

using namespace EntropyEngine::Core::Graph;
DirectedAcyclicGraph<int> dag;
auto a = dag.addNode(1);
auto b = dag.addNode(2);
dag.addEdge(a, b); // b depends on a
// Validate and access data
if (dag.isHandleValid(a)) {
int* data = dag.getNodeData(a);
if (data) { *data = 42; }
}
// Equality compares owner and stamped id (index:generation)
bool same = (a == a);
bool different = (a != b);
inline AcyclicNodeHandle & operator=(
const AcyclicNodeHandle & other
)

Copies or clears the stamped identity depending on source validity.

inline AcyclicNodeHandle & operator=(
AcyclicNodeHandle && other
)

Move-assigns by copying or clearing identity based on source validity.

inline virtual const char * className() const override

Runtime type name for diagnostics.

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

inline virtual uint64_t classHash() const override

Stable type hash for cross-language identification.

Reimplements: EntropyEngine::Core::EntropyObject::classHash

AcyclicNodeHandle() =default

Default-constructed handle with no identity (invalid).

inline AcyclicNodeHandle(
GraphT * graph,
uint32_t index,
uint32_t generation
)

Internal constructor used by DirectedAcyclicGraph to stamp identity.

Parameters:

  • graph Owning graph that stamps the handle
  • index Slot index within the graph
  • generation Generation counter for stale-handle detection
inline AcyclicNodeHandle(
const AcyclicNodeHandle & other
)

Copies the stamped identity from another handle (if present).

inline AcyclicNodeHandle(
AcyclicNodeHandle && other
)

Moves by copying the stamped identity (handles are lightweight).

friend class DirectedAcyclicGraph(
DirectedAcyclicGraph
);

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