NodeReferenceCount

from acron.core import NodeReferenceCount
class NodeReferenceCount

Bases:

Bases: ReferenceCount

This class specializes ReferenceCount to add an additional counter, called node_ref_count, for the purposes of counting the number of times the object is referenced by a “node”, whatever that may mean in context.

The new methods node_ref() and node_unref() automatically increment and decrement the primary reference count as well. There also exists a NodePointerTo<> class to maintain the node_ref() counters automatically.

See also CachedTypedWritableReferenceCount, which is similar in principle, as well as NodeCachedReferenceCount, which combines both of these.

Inheritance diagram

digraph inheritance565731c56a { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "NodeReferenceCount" [URL="acron.core.NodeReferenceCount.html#acron.core.NodeReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "ReferenceCount" -> "NodeReferenceCount" [arrowsize=0.75,style=""]; "ReferenceCount" [URL="acron.core.ReferenceCount.html#acron.core.ReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ReferenceCount" [arrowsize=0.75,style=""]; }
static get_class_type()
get_node_ref_count()

Returns the current reference count.

node_ref()

Explicitly increments the node reference count and the normal reference count simultaneously.

node_unref()

Explicitly decrements the node reference count and the normal reference count simultaneously.

The return value is true if the new reference count is nonzero, false if it is zero.

node_unref_only()

Decrements the node reference count without affecting the normal reference count. Intended to be called by derived classes only, presumably to reimplement node_unref().

test_ref_count_integrity()

Does some easy checks to make sure that the reference count isn’t completely bogus.