14 #ifndef REFERENCECOUNT_H 15 #define REFERENCECOUNT_H 48 INLINE
int get_ref_count()
const;
49 INLINE
void ref()
const;
50 virtual INLINE
bool unref()
const;
53 MAKE_PROPERTY(ref_count, get_ref_count);
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;
64 INLINE
void weak_unref();
66 INLINE
bool ref_if_nonzero()
const;
69 bool do_test_ref_count_integrity()
const;
70 bool do_test_ref_count_nonzero()
const;
73 void create_weak_list();
81 local_ref_count = 10000000,
88 deleted_ref_count = -100,
91 mutable AtomicAdjust::Integer _ref_count;
92 AtomicAdjust::Pointer _weak_list;
98 static void init_type() {
106 template<
class RefCountType>
125 INLINE
operator Base &();
126 INLINE
operator const Base &()
const;
131 static void init_type();
155 static void init_type();
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is an object shared by all the weak pointers that point to the same ReferenceCount object.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class is intended to be the base class of all objects in Panda that might be allocated and delet...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void unref_delete(RefCountType *ptr)
This global helper function will unref the given ReferenceCount object, and if the reference count re...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A "proxy" to use to make a reference-countable object whenever the object cannot inherit from Referen...