Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

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:

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, TransformState, and RenderState.

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 TransformState, and RenderState.

int getCacheRefCount | ( |  | ) |

Returns the current reference count.

static TypeHandle getClassType | ( |  | ) | `[static]`

Reimplemented from TypedWritableReferenceCount.

Reimplemented in CopyOnWriteObject, NodeCachedReferenceCount, GeomTextGlyph, Geom, GeomVertexArrayData, TransformBlendTable, GeomVertexData, GeomPrimitive, GeomLines, GeomLinestrips, GeomPoints, GeomTriangles, GeomTrifans, GeomTristrips, CollisionSolid, CollisionBox, CollisionPlane, CollisionFloorMesh, CollisionPolygon, CollisionSphere, CollisionInvSphere, CollisionRay, CollisionLine, CollisionParabola, CollisionSegment, CollisionTube, AnimPreloadTable, TransformState, and RenderState.

bool testRefCountIntegrity | ( |  | ) |

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