#include <support/Atom.h>
This is needed because, when holding a weak reference, you can only safely call directly on to the SAtom object. You can't call to a derived class, because with virtual inheritance it will need to go through the vtable to find the SAtom object, and that vtable may no longer exist due to its code being unloaded. This structure is used by wptr<> and others to only use 4 bytes for a pointer, where it needs to have a pointer to both the real (derived) class and its base SAtom address.
Public Member Functions | |
void | Decrement (const void *id) |
Remove a reference. If this is the last, the structure is freed. | |
void | Increment (const void *id) |
Add another reference to the weak_atom_ptr. | |
Public Attributes | |
SAtom * | atom |
That SAtom object we hold the reference on. | |
void * | cookie |
Typically the "real" derived object you are working with. | |
int32_t | ref_count |
Number of weak references this structure holds. |
|
Remove a reference. If this is the last, the structure is freed.
|
|
Add another reference to the weak_atom_ptr.
|
|
That SAtom object we hold the reference on.
|
|
Typically the "real" derived object you are working with.
|
|
Number of weak references this structure holds.
|