This class specializes
ReferenceCountto 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_unref()automatically increment and decrement the primary reference count as well. There also exists a NodePointerTo<> class to maintain the
int get_node_ref_count(void) const
Returns the current reference count.
void node_ref(void) const
Explicitly increments the node reference count and the normal reference count simultaneously.
bool node_unref(void) const
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.
void node_unref_only(void) const
Decrements the node reference count without affecting the normal reference count. Intended to be called by derived classes only, presumably to reimplement
bool test_ref_count_integrity(void) const
Does some easy checks to make sure that the reference count isn’t completely bogus.
- int get_node_ref_count(void) const