Shared context management class. More...
#include <Inventor/devices/SoDeviceContextSharedGroup.h>
Public Types | |
typedef std::set< SoDeviceContext * > | SoDeviceContextSet |
Type definition for SoDeviceContext set management. | |
Public Member Functions | |
SoDeviceContextSharedGroup () | |
Creates a new SharedGroup. | |
SoDeviceContextSharedGroup (int id) | |
Creates a new SharedGroup with specific id. | |
void | add (SoDeviceContext *ctx) |
Adds a device context to the group. | |
void | remove (SoDeviceContext *ctx) |
Removes a device context from the group. | |
void | setId (int id) |
Sets a specific id for this shared group. | |
int | getId () const |
Gets the id of this shared group. | |
const SoDeviceContextSet & | getContexts () const |
Gets the list of contexts managed by this shared group. | |
SoDeviceContext * | getPrimaryContext () const |
Returns the first context found in the shared group. | |
bool | contains (const SoDeviceContext *ctx) const |
Returns TRUE if the passed context is part of the shared group. | |
void | ref (SoBaseContextCache *object=NULL) |
Increment reference count. | |
void | unref (SoBaseContextCache *object=NULL) |
Decrement reference count. | |
bool | contains (SoBaseContextCache *object) const |
Returns TRUE if the specified object is already in the list of notified objects. | |
virtual void | dispose () |
Force all attached objects to release the context, by calling their respective release function, and force deletion of the contained context. | |
Public Member Functions inherited from SoRefCounter | |
void | ref () const |
Adds a reference to an instance. | |
void | unref () const |
Removes a reference from an instance. | |
void | unrefNoDelete () const |
unrefNoDelete() should be called when it is desired to decrement the reference count, but not delete the instance if this brings the reference count to zero. | |
int | getRefCount () const |
Returns current reference count. | |
void | lock () const |
lock this instance. | |
void | unlock () const |
unlock this instance. | |
Shared context management class.
This class provides functions to manage a shared group of device contexts.
Definition at line 52 of file SoDeviceContextSharedGroup.h.
typedef std::set<SoDeviceContext*> SoDeviceContextSharedGroup::SoDeviceContextSet |
Type definition for SoDeviceContext set management.
Definition at line 56 of file SoDeviceContextSharedGroup.h.
SoDeviceContextSharedGroup::SoDeviceContextSharedGroup | ( | ) |
Creates a new SharedGroup.
SoDeviceContextSharedGroup::SoDeviceContextSharedGroup | ( | int | id | ) |
Creates a new SharedGroup with specific id.
void SoDeviceContextSharedGroup::add | ( | SoDeviceContext * | ctx | ) |
Adds a device context to the group.
bool SoDeviceContextSharedGroup::contains | ( | const SoDeviceContext * | ctx | ) | const |
Returns TRUE if the passed context is part of the shared group.
bool SoDeviceContextSharedGroup::contains | ( | SoBaseContextCache * | object | ) | const |
Returns TRUE if the specified object is already in the list of notified objects.
To add or remove an object, from this list, the ref(object) and unref(object) methods can be used.
|
virtual |
Force all attached objects to release the context, by calling their respective release function, and force deletion of the contained context.
const SoDeviceContextSet & SoDeviceContextSharedGroup::getContexts | ( | ) | const |
Gets the list of contexts managed by this shared group.
int SoDeviceContextSharedGroup::getId | ( | ) | const |
Gets the id of this shared group.
SoDeviceContext * SoDeviceContextSharedGroup::getPrimaryContext | ( | ) | const |
Returns the first context found in the shared group.
void SoDeviceContextSharedGroup::ref | ( | SoBaseContextCache * | object = NULL | ) |
Increment reference count.
Object is the ContextObject that should be triggered when this context is deleted.
void SoDeviceContextSharedGroup::remove | ( | SoDeviceContext * | ctx | ) |
Removes a device context from the group.
void SoDeviceContextSharedGroup::setId | ( | int | id | ) |
Sets a specific id for this shared group.
void SoDeviceContextSharedGroup::unref | ( | SoBaseContextCache * | object = NULL | ) |
Decrement reference count.
Object is the ContextObject that was referenced originally.
If this call causes the reference count to go from 1 to 0 then the context is automatically deleted and all ContextObject that previously called ref(SoContextObject*) will be triggered for deletion (potentially asynchronously).