15 #ifndef REFERENCECOUNT_H 16 #define REFERENCECOUNT_H 18 #include "pandabase.h" 19 #include "weakReferenceList.h" 20 #include "typedObject.h" 21 #include "memoryUsage.h" 22 #include "memoryBase.h" 23 #include "config_express.h" 24 #include "atomicAdjust.h" 25 #include "numeric_types.h" 26 #include "deletedChain.h" 44 INLINE ReferenceCount(
const ReferenceCount &);
45 INLINE
void operator = (
const ReferenceCount &);
48 virtual INLINE ~ReferenceCount();
51 INLINE
int get_ref_count()
const;
52 INLINE
void ref()
const;
53 virtual INLINE
bool unref()
const;
55 INLINE
bool test_ref_count_integrity()
const;
56 INLINE
bool test_ref_count_nonzero()
const;
59 INLINE
void local_object();
60 INLINE
bool has_weak_list()
const;
67 bool do_test_ref_count_integrity()
const;
68 bool do_test_ref_count_nonzero()
const;
71 void create_weak_list();
79 local_ref_count = 10000000,
87 deleted_ref_count = -100,
90 mutable AtomicAdjust::Integer _ref_count;
91 AtomicAdjust::Pointer _weak_list;
97 static void init_type() {
98 register_type(_type_handle,
"ReferenceCount");
105 template<
class RefCountType>
106 INLINE
void unref_delete(RefCountType *ptr);
127 INLINE RefCountProxy(
const Base ©);
129 INLINE
operator Base &();
130 INLINE
operator const Base &()
const;
135 static void init_type();
155 INLINE RefCountObj(
const Base ©);
161 static void init_type();
167 #include "referenceCount.I" This is the specialization of PointerToVoid for weak pointers.
This is a list of WeakPointerTo's that share a reference to a given ReferenceCount object...
This class is intended to be the base class of all objects in Panda that might be allocated and delet...
A base class for all things that want to be reference-counted.
Another kind of proxy, similar to RefCountProxy.
TypeHandle is the identifier used to differentiate C++ class types.
A "proxy" to use to make a reference-countable object whenever the object cannot inherit from Referen...