Package com.openinventor.inventor.caches
Class SoNodeDependencies
java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.inventor.caches.SoNodeDependencies
- All Implemented Interfaces:
SafeDisposable
This class is a cache handler that can be used to monitor the modifications made to elements or fields.
In order to add new Elements or Fields to be monitored by the cache, use the appropriate addDependency() method.
If one of the added elements or fields has been modified since the last call to updateCache(), the isValid() method will return false, and a subsequent call to updateCache() will make it valid again.
Additionnally, the handled cache can be manually invalidated using the invalidate() method.
-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDependency(Class<? extends Inventor> type, int classStackIndex) Add given element type as a dependency for the cache.booleandispose()Explicitly call this method to force object to dispose its unmanaged resources.voidManually invalidate the cache.booleanReturns a boolean flag which indicates if it is safe to callSafeDisposable.dispose()on the object.booleanReturns true if the cache is valid for the given state.voidupdateCache(SoState state) Update cache according to given state.Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
Constructor Details
-
SoNodeDependencies
public SoNodeDependencies()
-
-
Method Details
-
isDisposable
public boolean isDisposable()Description copied from interface:SafeDisposableReturns a boolean flag which indicates if it is safe to callSafeDisposable.dispose()on the object.- Specified by:
isDisposablein interfaceSafeDisposable- Returns:
trueif the object can be disposed in a safe manner
-
dispose
public boolean dispose()Description copied from class:InventorExplicitly 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:
disposein interfaceSafeDisposable- Overrides:
disposein classInventor- Returns:
trueif this object native resources were successfully disposed;falseif it was already disposed or no native resources has been registered for this object.
-
invalidate
public void invalidate()Manually invalidate the cache. -
addDependency
Add given element type as a dependency for the cache. -
updateCache
Update cache according to given state. After this call, the cache will be valid. -
isValid
Returns true if the cache is valid for the given state.
-