public int getModuleId() {
return component.getModuleId();
}
-
+
+ public ModuleUpdaterBase<T> getUpdater() {
+ return updater;
+ }
+
public SynchronizationEventHandlerBase<T> getHandler() {
return handler;
}
+ @SuppressWarnings("unchecked")
+ public <E extends SynchronizationEventHandlerBase<?>> E getConcreteHandler() {
+ return (E) handler;
+ }
+
public void setModuleId(int moduleId) {
component.setModuleId(moduleId);
}
if(oldChildMap != null)
for(T component : oldChildMap.values()) {
component.clearParent();
- mapping.addPendingRemoval(component);
+ addPendingRemoval(component);
}
}
// Alternative implementation when uids are not available.
if(oldChildMap != null)
for(T component : oldChildMap.values()) {
component.clearParent();
- mapping.addPendingRemoval(component);
+ addPendingRemoval(component);
}
}
}
}
+ protected void addPendingRemoval(T component) {
+ if (TRACE_EVENTS)
+ System.out.println("addPendingRemoval(" + component.componentId + " : " + component.solverComponentName + ")");
+ mapping.addPendingRemoval(component);
+ }
+
private String getSubprocessName(String name,
Collection<SerializedVariable> properties) {
for(SerializedVariable property : properties)
package org.simantics.structural.synchronization.utils;
-import java.io.PrintWriter;
-
import gnu.trove.map.hash.THashMap;
import gnu.trove.procedure.TObjectObjectProcedure;
import gnu.trove.procedure.TObjectProcedure;
import gnu.trove.set.hash.THashSet;
+import java.io.PrintWriter;
+import java.util.function.Consumer;
+
/**
* The entry point to the mapping structure between Simantics database and a
* designated solver. It is used to synchronize changes from Simantics to the
return !pendingRemoval.isEmpty();
}
+ public void forEachPendingRemoval(Consumer<T> consumer) {
+ pendingRemoval.forEach(c -> {
+ consumer.accept(c);
+ return true;
+ });
+ }
+
}