24#if !defined SO_DEVICE_CONTEXT_SHARE_GROUP_H
25#define SO_DEVICE_CONTEXT_SHARE_GROUP_H
27#include <Inventor/misc/SoRefCounter.h>
28#include <Inventor/STL/set>
29#include <Inventor/threads/SbThreadMutex.h>
30#include <Inventor/devices/SoSharedGroupReferenceList.h>
31#include <Inventor/SbEventHandler.h>
34class SoBaseContextCache;
38#pragma warning( push )
39#pragma warning(disable:4251)
90 void ref(SoBaseContextCache*
object = NULL);
102 void unref(SoBaseContextCache*
object = NULL);
117 typedef int SharedGroupId;
136 static void checkRefIssues(SoBaseContextCache* cache);
139 void clearPendingDeleteList();
141 void setDisposing(
bool b );
144 SbThreadId_t getThreadId()
const;
147 static int getNewSharedIdGroup();
150 static void printSharedGroups();
155 bool hasValidContext()
const;
161 static int getDebuggingLevel()
162 {
return s_debuggingLevel; }
165 inline static int getFallbackContextGlobalSharedId()
186 void forceReleaseAttachedObject();
192 void commonConstructor();
204 typedef std::list<SoDeviceContextSharedGroup*> SoDeviceContexSharedGroupList;
206 static SoDeviceContexSharedGroupList s_sharedGroupList;
207 static int s_sharedGroupId;
210 typedef std::list<SoBaseContextCache*> SoBaseContextCacheList;
211 SoBaseContextCacheList m_listContextedObject;
212 bool m_isClearingPendingList;
215 SoSharedGroupReferenceList m_intrusivelistContextedObject;
218 typedef std::set<SoBaseContextObject*> SoBaseContextObjectList;
219 SoBaseContextObjectList m_waitingToBeFreed;
222 SbThreadId_t m_threadId;
236 static int s_debuggingLevel;
244inline void SoDeviceContextSharedGroup::setDisposing(
bool b )
249inline SbThreadId_t SoDeviceContextSharedGroup::getThreadId()
const
255#pragma warning( pop )
Class representing an event.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Portable mutex c...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Portable spinloc...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Context dependen...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Shared context m...
SoDeviceContextSharedGroup()
Creates a new SharedGroup.
std::set< SoDeviceContext * > SoDeviceContextSet
Type definition for SoDeviceContext set management.
const SoDeviceContextSet & getContexts() const
Gets the list of contexts managed by this shared group.
void ref(SoBaseContextCache *object=NULL)
Increment reference count.
bool contains(SoBaseContextCache *object) const
Returns TRUE if the specified object is already in the list of notified objects.
bool contains(const SoDeviceContext *ctx) const
Returns TRUE if the passed context is part of the shared group.
SoDeviceContext * getPrimaryContext() const
Returns the first context found in the shared group.
virtual void dispose()
Force all attached objects to release the context, by calling their respective release function,...
SoDeviceContextSharedGroup(int id)
Creates a new SharedGroup with specific id.
void unref(SoBaseContextCache *object=NULL)
Decrement reference count.
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.
Base class for ref-counted objects.