14#ifndef WEAKREFERENCELIST_H
15#define WEAKREFERENCELIST_H
29class EXPCL_PANDA_EXPRESS WeakReferenceList {
34 INLINE
void ref()
const;
35 INLINE
bool unref()
const;
50 typedef pmap<WeakPointerCallback *, void *> Callbacks;
56 static const AtomicAdjust::Integer _alive_offset = (1 << 30);
57 mutable AtomicAdjust::Integer _count;
59 friend class ReferenceCount;
Derive from this class and override the callback() method if you want to get an immediate callback fr...
void add_callback(WeakPointerCallback *callback, void *data)
Adds the callback to the list of callbacks that will be called when the underlying pointer is deleted...
bool was_deleted() const
Returns true if the object represented has been deleted, ie.
void ref() const
Increases the number of weak references.
void remove_callback(WeakPointerCallback *callback)
Intended to be called only by WeakPointerTo (or by any class implementing a weak reference-counting p...
bool unref() const
Decreases the number of weak references.
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.