Class SoDeviceContextSharedGroup
java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.inventor.devices.SoDeviceContextSharedGroup
- All Implemented Interfaces:
SafeDisposable
Shared context management class.
This class provides functions to manage a shared group of device contexts.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
Field Summary
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new SharedGroup.SoDeviceContextSharedGroup
(int id) Creates a new SharedGroup with specific id. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(SoDeviceContext ctx) Adds a device context to the group.boolean
contains
(SoBaseContextCache object) Returns true if the specified object is already in the list of notified objects.boolean
contains
(SoDeviceContext ctx) Returns true if the passed context is part of the shared group.boolean
dispose()
Explicitly call this method to force object to dispose its unmanaged resources.int
getId()
Gets the id of this shared group.Returns the first context found in the shared group.boolean
Returns a boolean flag which indicates if it is safe to callSafeDisposable.dispose()
on the object.void
remove
(SoDeviceContext ctx) Removes a device context from the group.void
setId
(int id) Sets a specific id for this shared group.Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
Constructor Details
-
SoDeviceContextSharedGroup
public SoDeviceContextSharedGroup()Creates a new SharedGroup. -
SoDeviceContextSharedGroup
public SoDeviceContextSharedGroup(int id) Creates a new SharedGroup with specific id.
-
-
Method Details
-
dispose
public boolean dispose()Description copied from class:Inventor
Explicitly call this method to force object to dispose its unmanaged resources. The object may not be reused in the application code after this call.- Specified by:
dispose
in interfaceSafeDisposable
- Overrides:
dispose
in classInventor
- Returns:
true
if this object native resources were successfully disposed;false
if it was already disposed or no native resources has been registered for this object.
-
isDisposable
public boolean isDisposable()Description copied from interface:SafeDisposable
Returns a boolean flag which indicates if it is safe to callSafeDisposable.dispose()
on the object.- Specified by:
isDisposable
in interfaceSafeDisposable
- Returns:
true
if the object can be disposed in a safe manner
-
remove
Removes a device context from the group. -
add
Adds a device context to the group. -
setId
public void setId(int id) Sets a specific id for this shared group. -
contains
Returns true if the passed context is part of the shared group. -
contains
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. -
getId
public int getId()Gets the id of this shared group. -
getPrimaryContext
Returns the first context found in the shared group.
-