SAtom::weak_atom_ptr Struct Reference

#include <support/Atom.h>

List of all members.


Detailed Description

Represents a safe weak reference on an SAtom object.

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

SAtomatom
 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.


Member Function Documentation

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.


Member Data Documentation

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.


The documentation for this struct was generated from the following files: