14#ifndef CACHEDTYPEDWRITABLEREFERENCECOUNT_H
15#define CACHEDTYPEDWRITABLEREFERENCECOUNT_H
34class EXPCL_PANDA_PUTIL CachedTypedWritableReferenceCount :
public TypedWritableReferenceCount {
36 INLINE CachedTypedWritableReferenceCount();
37 INLINE CachedTypedWritableReferenceCount(
const CachedTypedWritableReferenceCount ©);
38 INLINE
void operator = (
const CachedTypedWritableReferenceCount ©);
39 INLINE ~CachedTypedWritableReferenceCount();
53 INLINE
void cache_unref_only()
const;
54 bool do_test_ref_count_integrity()
const;
57 mutable AtomicAdjust::Integer _cache_ref_count;
64 static void init_type() {
65 TypedWritableReferenceCount::init_type();
66 register_type(_type_handle,
"CachedTypedWritableReferenceCount",
67 TypedWritableReferenceCount::get_class_type());
71 static TypeHandle _type_handle;
74template<
class RefCountType>
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void cache_unref_delete(RefCountType *ptr)
This global helper function will unref the given ReferenceCount object, and if the reference count re...
void cache_ref() const
Explicitly increments the cache reference count and the normal reference count simultaneously.
bool cache_unref() const
Explicitly decrements the cache reference count and the normal reference count simultaneously.
get_cache_ref_count
Returns the current reference count.
void cache_ref_only() const
Decrements the cache reference count without affecting the normal reference count.
bool test_ref_count_integrity() const
Does some easy checks to make sure that the reference count isn't completely bogus.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.