Context dependent object management class. More...
#include <Inventor/devices/SoBaseContextObject.h>
Public Member Functions | |
SoBaseContextObject (SoDeviceContextSharedGroup *sharedContextGroup) | |
void | ref () |
void | unref () |
SoDeviceContextSharedGroup * | getContextSharedGroup () const |
int | getRefCount () const |
virtual void | release () |
Friends | |
class | SoDeviceContextSharedGroup |
A helper base class used to store context dependent objects.
SoBaseContextObject::SoBaseContextObject | ( | SoDeviceContextSharedGroup * | sharedContextGroup | ) |
Constructor.
sharedContextGroup | context shared group from which it depends. |
SoDeviceContextSharedGroup* SoBaseContextObject::getContextSharedGroup | ( | ) | const [inline] |
Returns the OpenGL context in which the OpenGL objects were created.
int SoBaseContextObject::getRefCount | ( | ) | const [inline] |
Returns the reference count of this instance (initially zero).
void SoBaseContextObject::ref | ( | ) |
Increment reference count.
Reference count is initially zero.
virtual void SoBaseContextObject::release | ( | ) | [inline, virtual] |
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).
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 class SoDeviceContextSharedGroup [friend] |