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
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
Modifier and TypeMethodDescriptionboolean
dispose()
Explicitly call this method to force object to dispose its unmanaged resources.boolean
return current context dependency state.boolean
Returns a boolean flag which indicates if it is safe to callSafeDisposable.dispose()
on the object.void
release
(SoDeviceContextSharedGroup name_8343) This function is called when a context has been requested to delete the context through the SoDeviceContext.dispose() method.void
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 Details
-
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). -
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).
-