This interface provide all the methods needed for the management of vtkObject in the Java world. They are used internally inside the generated Java code of the VTK objects to keep track of the reference count of the corresponding VTK C++ object and therefore allow to release memory when it became po
| 14 | * @author sebastien jourdain - sebastien.jourdain@kitware.com |
| 15 | */ |
| 16 | public interface vtkJavaMemoryManager { |
| 17 | /** |
| 18 | * Create or return an existing instance of the vtkObject that corresponds |
| 19 | * to the pointer id vtkId. |
| 20 | * |
| 21 | * @param vtkId |
| 22 | * is used to uniquely identify a vtkObject inside the C++ layer. |
| 23 | * |
| 24 | * @return a java object that map its underlying C++ instance. |
| 25 | */ |
| 26 | vtkObjectBase getJavaObject(Long vtkId); |
| 27 | |
| 28 | /** |
| 29 | * Store the Java instance of a vtkObject inside a weak pointer map. |
| 30 | * |
| 31 | * @param id |
| 32 | * is used to uniquely identify a vtkObject inside the C++ layer. |
| 33 | * @param obj |
| 34 | * is the Java instance that is stored inside a WeakPointer of |
| 35 | * the map. |
| 36 | */ |
| 37 | void registerJavaObject(Long id, vtkObjectBase obj); |
| 38 | |
| 39 | /** |
| 40 | * If found the Java object is removed from the map and we decrease the |
| 41 | * reference count of the underneath C++ instance. |
| 42 | * |
| 43 | * @param id |
| 44 | */ |
| 45 | void unRegisterJavaObject(Long id); |
| 46 | |
| 47 | /** |
| 48 | * Execute the garbage collection in the Java + VTK context to release Java |
| 49 | * instance that are not used anymore which keep holding a C++ instance |
| 50 | * around. |
| 51 | * |
| 52 | * @param debug |
| 53 | * allow to add extra information inside the return object such |
| 54 | * as the class name of the objects lefts as well as their |
| 55 | * numbers. |
| 56 | * |
| 57 | * @return an information object that provide useful information for |
| 58 | * statistic or debugging purpose. |
| 59 | */ |
| 60 | vtkReferenceInformation gc(boolean debug); |
| 61 | |
| 62 | /** |
| 63 | * @return an helper class that allow to trigger the garbage collector at a |
| 64 | * given frequency inside the EDT. |
| 65 | */ |
| 66 | vtkJavaGarbageCollector getAutoGarbageCollector(); |
| 67 | |
| 68 | /** |
| 69 | * This method will clean up the Map of the Java objects and will release |
| 70 | * any vtkObject that was held by a Java one. This will prevent you from |
| 71 | * using any existing VTK Java object. |
| 72 | * |
| 73 | * @return the size of the map that we cleared |
no outgoing calls
no test coverage detected