Context dependent object management class. More...
#include <Inventor/devices/SoBaseContextObject.h>
Public Member Functions | |
SoBaseContextObject (SoDeviceContextSharedGroup *sharedContextGroup) | |
Constructor. | |
void | ref () |
Increment reference count. | |
void | unref () |
Decrement reference count. | |
SoDeviceContextSharedGroup * | getContextSharedGroup () const |
Returns the OpenGL context in which the OpenGL objects were created. | |
int | getRefCount () const |
Returns the reference count of this instance (initially zero). | |
virtual void | release () |
This function is called by the attached context when it has been requested to delete the context through the SoDeviceContext::dispose() method. | |
Friends | |
class | SoDeviceContextSharedGroup |
Context dependent object management class.
A helper base class used to store context dependent objects.
Definition at line 43 of file SoBaseContextObject.h.
SoBaseContextObject::SoBaseContextObject | ( | SoDeviceContextSharedGroup * | sharedContextGroup | ) |
Constructor.
sharedContextGroup | context shared group from which it depends. |
|
inline |
Returns the OpenGL context in which the OpenGL objects were created.
Definition at line 76 of file SoBaseContextObject.h.
|
inline |
Returns the reference count of this instance (initially zero).
Definition at line 81 of file SoBaseContextObject.h.
void SoBaseContextObject::ref | ( | ) |
Increment reference count.
Reference count is initially zero.
|
inlinevirtual |
This function is called by the attached context when it has been requested to delete the context through the SoDeviceContext::dispose() method.
As some object might be still attached, it triggers all attached object release() method to ask them to detach (and then get it refcount to zero).
Definition at line 89 of file SoBaseContextObject.h.
void SoBaseContextObject::unref | ( | ) |
Decrement reference count.
If this call changes the reference count to zero, the object will be destroyed (just like node classes).
Context dependent objects can only be destroyed if the context that owns them is active. The state parameter is used to determine the correct context for this object. You can pass a NULL state to unref(), but deletion of the object will be delayed until an action is applied in the correct context.
|
friend |
Definition at line 124 of file SoBaseContextObject.h.