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;
67 INLINE
bool unref_if_one()
const;
70 bool do_test_ref_count_integrity()
const;
71 bool do_test_ref_count_nonzero()
const;
74 void create_weak_list();
82 local_ref_count = 10000000,
89 deleted_ref_count = -100,
92 mutable AtomicAdjust::Integer _ref_count;
93 AtomicAdjust::Pointer _weak_list;
99 static void init_type() {
107template<
class RefCountType>
126 INLINE
operator Base &();
127 INLINE
operator const Base &()
const;
132 static void init_type();
156 static void init_type();
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...
Another kind of proxy, similar to RefCountProxy.
A "proxy" to use to make a reference-countable object whenever the object cannot inherit from Referen...
A base class for all things that want to be reference-counted.
TypeHandle is the identifier used to differentiate C++ class types.
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.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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...
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.