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.
More...
#include "nodeReferenceCount.h"
List of all members.
Public Member Functions |
| int | get_node_ref_count () const |
| | Returns the current reference count.
|
| void | node_ref () const |
| | Explicitly increments the node reference count and the normal reference count simultaneously.
|
| bool | node_unref () const |
| | Explicitly decrements the node reference count and the normal reference count simultaneously.
|
| bool | test_ref_count_integrity () const |
| | Does some easy checks to make sure that the reference count isn't completely bogus.
|
Static Public Member Functions |
|
static TypeHandle | get_class_type () |
|
static void | init_type () |
Protected Member Functions |
| | NodeReferenceCount () |
| | The ReferenceCount constructor is protected because you almost never want to create just a ReferenceCount object by itself, and it's probably a mistake if you try.
|
| | NodeReferenceCount (const NodeReferenceCount ©) |
| | The copies of reference-counted objects do not themselves inherit the reference count!
|
| | ~NodeReferenceCount () |
| | The ReferenceCount destructor is protected to discourage users from accidentally trying to delete a ReferenceCount pointer directly.
|
| bool | do_test_ref_count_integrity () const |
| | Does some easy checks to make sure that the reference count isn't completely bogus.
|
| void | node_unref_only () const |
| | Decrements the node reference count without affecting the normal reference count.
|
| void | operator= (const NodeReferenceCount ©) |
| | The copies of reference-counted objects do not themselves inherit the reference count!
|
Detailed Description
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.
Definition at line 41 of file nodeReferenceCount.h.
Constructor & Destructor Documentation
| NodeReferenceCount::NodeReferenceCount |
( |
| ) |
[inline, protected] |
The ReferenceCount constructor is protected because you almost never want to create just a ReferenceCount object by itself, and it's probably a mistake if you try.
ReferenceCount doesn't store any useful information in its own right; its only purpose is to add reference-counting to some other class via inheritance.
Definition at line 33 of file nodeReferenceCount.I.
| NodeReferenceCount::NodeReferenceCount |
( |
const NodeReferenceCount & |
copy | ) |
[inline, protected] |
The copies of reference-counted objects do not themselves inherit the reference count!
This copy constructor is protected because you almost never want to create just a ReferenceCount object by itself, and it's probably a mistake if you try.
Definition at line 48 of file nodeReferenceCount.I.
| NodeReferenceCount::~NodeReferenceCount |
( |
| ) |
[inline, protected] |
The ReferenceCount destructor is protected to discourage users from accidentally trying to delete a ReferenceCount pointer directly.
This is almost always a bad idea, since the destructor is not virtual, and you've almost certainly got some pointer to something that inherits from ReferenceCount, not just a plain old ReferenceCount object.
Definition at line 93 of file nodeReferenceCount.I.
Member Function Documentation
| bool NodeReferenceCount::do_test_ref_count_integrity |
( |
| ) |
const [protected] |
| int NodeReferenceCount::get_node_ref_count |
( |
| ) |
const [inline] |
| void NodeReferenceCount::node_ref |
( |
| ) |
const [inline] |
| bool NodeReferenceCount::node_unref |
( |
| ) |
const [inline] |
| void NodeReferenceCount::node_unref_only |
( |
| ) |
const [inline, protected] |
The copies of reference-counted objects do not themselves inherit the reference count!
This copy assignment operator is protected because you almost never want to copy just a ReferenceCount object by itself, and it's probably a mistake if you try. Instead, this should only be called from a derived class that implements this operator and then calls up the inheritance chain.
Definition at line 66 of file nodeReferenceCount.I.
| bool NodeReferenceCount::test_ref_count_integrity |
( |
| ) |
const [inline] |
The documentation for this class was generated from the following files: