Package com.openinventor.inventor.caches
Class SoBaseContextCache
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.caches.SoBaseContextCache
-
- All Implemented Interfaces:
SafeDisposable
- Direct Known Subclasses:
SoCache
public class SoBaseContextCache extends Inventor implements SafeDisposable
Base context dependent cache management class. A helper base class used to store context dependent cache objects.
-
-
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
dispose()
Explicitly call this method to force object to dispose its unmanaged resources.boolean
isContextDependent()
return current context dependency state.boolean
isDisposable()
Returns a boolean flag which indicates if it is safe to callSafeDisposable.dispose()
on the object.void
release(SoDeviceContextSharedGroup name_8543)
This function is called when a context has been requested to delete the context through the SoDeviceContext.dispose() method.void
setContextDependent()
Calls setContextDependent((boolean)true).void
setContextDependent(boolean flag)
Object is considered not context dependent as long asSoDeviceContext
was not ref by this object.-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Method Detail
-
setContextDependent
public void setContextDependent()
Calls setContextDependent((boolean)true).
-
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
-
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.
-
isContextDependent
public boolean isContextDependent()
return current context dependency state. (by default all caches are context dependent).
-
release
public void release(SoDeviceContextSharedGroup name_8543)
This function is called when a context has been requested to delete the context through the SoDeviceContext.dispose() method. As some object might be still attached, it triggers all attached objectrelease()
method to ask them to detach (and then get it refcount to zero).
-
setContextDependent
public void setContextDependent(boolean flag)
Object is considered not context dependent as long asSoDeviceContext
was not ref by this object. Once at least one device is ref then it calls this function to enbale later check checks deleting this object. see (SoDeviceContext.checkRefIssue call in destructor).
-
-