CachedTypedWritableReferenceCount

from panda3d.core import CachedTypedWritableReferenceCount
class CachedTypedWritableReferenceCount

Bases: TypedWritableReferenceCount

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

Inheritance diagram

Inheritance diagram of CachedTypedWritableReferenceCount

__init__(*args, **kwargs)
cacheRef()

C++ Interface: cache_ref(CachedTypedWritableReferenceCount self)

/**
  • Explicitly increments the cache reference count and the normal reference

  • count simultaneously.

*/

cacheUnref()

C++ Interface: cache_unref(CachedTypedWritableReferenceCount self)

/**
  • 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.

*/

cache_ref()

C++ Interface: cache_ref(CachedTypedWritableReferenceCount self)

/**
  • Explicitly increments the cache reference count and the normal reference

  • count simultaneously.

*/

cache_ref_count
cache_unref()

C++ Interface: cache_unref(CachedTypedWritableReferenceCount self)

/**
  • 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.

*/

getCacheRefCount()

C++ Interface: get_cache_ref_count(CachedTypedWritableReferenceCount self)

/**
  • Returns the current reference count.

*/

getClassType()

C++ Interface: get_class_type()

get_cache_ref_count()

C++ Interface: get_cache_ref_count(CachedTypedWritableReferenceCount self)

/**
  • Returns the current reference count.

*/

get_class_type()

C++ Interface: get_class_type()

testRefCountIntegrity()

C++ Interface: test_ref_count_integrity(CachedTypedWritableReferenceCount self)

/**
  • Does some easy checks to make sure that the reference count isn’t

  • completely bogus.

*/

test_ref_count_integrity()

C++ Interface: test_ref_count_integrity(CachedTypedWritableReferenceCount self)

/**
  • Does some easy checks to make sure that the reference count isn’t

  • completely bogus.

*/