This is a special extension to ReferenceCount that includes dual reference counts: the standard reference count number, which includes all references to the object, and a separate number (the cache reference count) that counts the number of references to the object just within its cache alone. More...
Public Member Functions | |
cacheRef () | |
Explicitly increments the cache reference count and the normal reference count simultaneously. | |
bool | cacheUnref () |
Explicitly decrements the cache reference count and the normal reference count simultaneously. | |
int | getCacheRefCount () |
Returns the current reference count. | |
bool | testRefCountIntegrity () |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
Static Public Member Functions | |
static TypeHandle | getClassType () |
This is a special extension to ReferenceCount that includes dual reference counts: the standard reference count number, which includes all references to the object, and a separate number (the cache reference count) that counts the number of references to the object just within its cache alone.
When get_ref_count() == get_cache_ref_count(), the object is not referenced outside the cache.
The cache refs must be explicitly maintained; there is no PointerTo<> class to maintain the cache reference counts automatically. The cache reference count is automatically included in the overall reference count: calling cache_ref() and cache_unref() automatically calls ref() and unref().
cacheRef | ( | ) |
Explicitly increments the cache reference count and the normal reference count simultaneously.
Reimplemented in CopyOnWriteObject, RenderState, and TransformState.
bool cacheUnref | ( | ) |
Explicitly decrements the cache 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.
Reimplemented in RenderState, and TransformState.
int getCacheRefCount | ( | ) |
Returns the current reference count.
static TypeHandle getClassType | ( | ) | [static] |
Reimplemented from TypedWritableReferenceCount.
Reimplemented in GeomTextGlyph, GeomTristrips, GeomTrifans, GeomTriangles, GeomPoints, GeomLinestrips, GeomLines, Geom, GeomPrimitive, GeomVertexData, TransformBlendTable, GeomVertexArrayData, CollisionTube, CollisionSegment, CollisionParabola, CollisionLine, CollisionRay, CollisionInvSphere, CollisionSphere, CollisionPolygon, CollisionFloorMesh, CollisionPlane, CollisionBox, CollisionSolid, CopyOnWriteObject, AnimPreloadTable, RenderState, NodeCachedReferenceCount, and TransformState.
bool testRefCountIntegrity | ( | ) |
Does some easy checks to make sure that the reference count isn't completely bogus.
Reimplemented from ReferenceCount.
Reimplemented in NodeCachedReferenceCount.