Panda3D
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Member Functions | Static Public Member Functions
CachedTypedWritableReferenceCount Class Reference

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...

Inheritance diagram for CachedTypedWritableReferenceCount:
TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject CopyOnWriteObject NodeCachedReferenceCount AnimPreloadTable CollisionSolid Geom GeomPrimitive GeomVertexArrayData GeomVertexData TransformBlendTable RenderState TransformState

List of all members.

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 ()

Detailed Description

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().


Member Function Documentation

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.

Returns the current reference count.

static TypeHandle getClassType ( ) [static]

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

Reimplemented from ReferenceCount.

Reimplemented in NodeCachedReferenceCount.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties