+++ /dev/null
-package net.mograsim.logic.model.snippets.highlevelstatehandlers.standard;
-
-import net.mograsim.logic.model.model.components.submodels.SubmodelComponent;
-
-public class HighLevelStateHandlerContext
-{
- public final SubmodelComponent component;
- public final String stateID;
-
- public HighLevelStateHandlerContext(SubmodelComponent component, String stateID)
- {
- this.component = component;
- this.stateID = stateID;
- }
-}
\ No newline at end of file
}
public <P, H extends SubcomponentHighLevelStateHandler> H addSubcomponentHighLevelState(String subcomponentStateID,
- BiFunction<HighLevelStateHandlerContext, P, H> handlerConstructor, P handlerParams)
+ BiFunction<SubmodelComponent, P, H> handlerConstructor, P handlerParams)
{
return addSubcomponentHighLevelState(subcomponentStateID, c -> handlerConstructor.apply(c, handlerParams));
}
public <H extends SubcomponentHighLevelStateHandler> H addSubcomponentHighLevelState(String subcomponentStateID,
- Function<HighLevelStateHandlerContext, H> handlerConstructor)
+ Function<SubmodelComponent, H> handlerConstructor)
{
- HighLevelStateHandlerContext context = new HighLevelStateHandlerContext(component, subcomponentStateID);
- H handler = handlerConstructor.apply(context);
+ H handler = handlerConstructor.apply(component);
addSubcomponentHighLevelState(subcomponentStateID, handler);
return handler;
}
}
public <P, H extends AtomicHighLevelStateHandler> H addAtomicHighLevelState(String subcomponentStateID,
- BiFunction<HighLevelStateHandlerContext, P, H> handlerConstructor, P handlerParams)
+ BiFunction<SubmodelComponent, P, H> handlerConstructor, P handlerParams)
{
return addAtomicHighLevelState(subcomponentStateID, c -> handlerConstructor.apply(c, handlerParams));
}
public <H extends AtomicHighLevelStateHandler> H addAtomicHighLevelState(String subcomponentStateID,
- Function<HighLevelStateHandlerContext, H> handlerConstructor)
+ Function<SubmodelComponent, H> handlerConstructor)
{
- HighLevelStateHandlerContext context = new HighLevelStateHandlerContext(component, subcomponentStateID);
- H handler = handlerConstructor.apply(context);
+ H handler = handlerConstructor.apply(component);
addAtomicHighLevelState(subcomponentStateID, handler);
return handler;
}
import java.io.InputStream;
import java.util.Map;
+import net.mograsim.logic.model.model.components.submodels.SubmodelComponent;
import net.mograsim.logic.model.snippets.CodeSnippetSupplier;
import net.mograsim.logic.model.snippets.highlevelstatehandlers.standard.atomic.AtomicHighLevelStateHandler;
import net.mograsim.logic.model.snippets.highlevelstatehandlers.standard.subcomponent.SubcomponentHighLevelStateHandler;
public class StandardHighLevelStateHandlerSnippetSuppliers
{
- public static final CodeSnippetSupplier<HighLevelStateHandlerContext, AtomicHighLevelStateHandler> atomicHandlerSupplier;
- public static final CodeSnippetSupplier<HighLevelStateHandlerContext, SubcomponentHighLevelStateHandler> subcomponentHandlerSupplier;
+ public static final CodeSnippetSupplier<SubmodelComponent, AtomicHighLevelStateHandler> atomicHandlerSupplier;
+ public static final CodeSnippetSupplier<SubmodelComponent, SubcomponentHighLevelStateHandler> subcomponentHandlerSupplier;
static
{
import net.mograsim.logic.model.model.components.submodels.SubmodelComponent;
import net.mograsim.logic.model.serializing.IdentifyParams;
import net.mograsim.logic.model.snippets.SnippetDefinintion;
-import net.mograsim.logic.model.snippets.highlevelstatehandlers.standard.HighLevelStateHandlerContext;
import net.mograsim.logic.model.snippets.highlevelstatehandlers.standard.StandardHighLevelStateHandlerSnippetSuppliers;
public class BitVectorSplittingAtomicHighLevelStateHandler implements AtomicHighLevelStateHandler
private final List<Integer> vectorPartLengthesUnmodifiable;
private int length;
- public BitVectorSplittingAtomicHighLevelStateHandler(HighLevelStateHandlerContext context)
+ public BitVectorSplittingAtomicHighLevelStateHandler(SubmodelComponent component)
{
- this(context, null);
+ this(component, null);
}
- public BitVectorSplittingAtomicHighLevelStateHandler(HighLevelStateHandlerContext context,
+ public BitVectorSplittingAtomicHighLevelStateHandler(SubmodelComponent component,
BitVectorSplittingAtomicHighLevelStateHandlerParams params)
{
- this.component = context.component;
+ this.component = component;
this.vectorPartTargets = new ArrayList<>();
this.vectorPartTargetsUnmodifiable = Collections.unmodifiableList(vectorPartTargets);
this.vectorPartLengthes = new ArrayList<>();
import net.mograsim.logic.model.model.components.submodels.SubmodelComponent;
import net.mograsim.logic.model.serializing.IdentifyParams;
import net.mograsim.logic.model.snippets.SnippetDefinintion;
-import net.mograsim.logic.model.snippets.highlevelstatehandlers.standard.HighLevelStateHandlerContext;
import net.mograsim.logic.model.snippets.highlevelstatehandlers.standard.StandardHighLevelStateHandlerSnippetSuppliers;
public class DelegatingAtomicHighLevelStateHandler implements AtomicHighLevelStateHandler
private ModelComponent delegateTarget;
private String subStateID;
- public DelegatingAtomicHighLevelStateHandler(HighLevelStateHandlerContext context)
+ public DelegatingAtomicHighLevelStateHandler(SubmodelComponent component)
{
- this(context, null);
+ this(component, null);
}
- public DelegatingAtomicHighLevelStateHandler(HighLevelStateHandlerContext context, DelegatingAtomicHighLevelStateHandlerParams params)
+ public DelegatingAtomicHighLevelStateHandler(SubmodelComponent component, DelegatingAtomicHighLevelStateHandlerParams params)
{
- this.parentComponent = context.component;
+ this.parentComponent = component;
if (params != null)
{
// TODO document this
import net.mograsim.logic.model.model.wires.ModelWire;
import net.mograsim.logic.model.serializing.IdentifyParams;
import net.mograsim.logic.model.snippets.SnippetDefinintion;
-import net.mograsim.logic.model.snippets.highlevelstatehandlers.standard.HighLevelStateHandlerContext;
import net.mograsim.logic.model.snippets.highlevelstatehandlers.standard.StandardHighLevelStateHandlerSnippetSuppliers;
public class WireForcingAtomicHighLevelStateHandler implements AtomicHighLevelStateHandler
private final List<ModelWire> wiresToForceInverted;
private final List<ModelWire> wiresToForceInvertedUnmodifiable;
- public WireForcingAtomicHighLevelStateHandler(HighLevelStateHandlerContext context)
+ public WireForcingAtomicHighLevelStateHandler(SubmodelComponent component)
{
- this(context, null);
+ this(component, null);
}
- public WireForcingAtomicHighLevelStateHandler(HighLevelStateHandlerContext context, WireForcingAtomicHighLevelStateHandlerParams params)
+ public WireForcingAtomicHighLevelStateHandler(SubmodelComponent component, WireForcingAtomicHighLevelStateHandlerParams params)
{
- this.component = context.component;
+ this.component = component;
this.wiresToForce = new ArrayList<>();
this.wiresToForceUnmodifiable = Collections.unmodifiableList(wiresToForce);
this.wiresToForceInverted = new ArrayList<>();
import net.mograsim.logic.model.model.components.submodels.SubmodelComponent;
import net.mograsim.logic.model.serializing.IdentifyParams;
import net.mograsim.logic.model.snippets.SnippetDefinintion;
-import net.mograsim.logic.model.snippets.highlevelstatehandlers.standard.HighLevelStateHandlerContext;
import net.mograsim.logic.model.snippets.highlevelstatehandlers.standard.StandardHighLevelStateHandlerSnippetSuppliers;
public class DelegatingSubcomponentHighLevelStateHandler implements SubcomponentHighLevelStateHandler
private ModelComponent delegateTarget;
private String prefix;
- public DelegatingSubcomponentHighLevelStateHandler(HighLevelStateHandlerContext context)
+ public DelegatingSubcomponentHighLevelStateHandler(SubmodelComponent component)
{
- this(context, null);
+ this(component, null);
}
- public DelegatingSubcomponentHighLevelStateHandler(HighLevelStateHandlerContext context,
+ public DelegatingSubcomponentHighLevelStateHandler(SubmodelComponent component,
DelegatingSubcomponentHighLevelStateHandlerParams params)
{
- this.parentComponent = context.component;
+ this.parentComponent = component;
if (params != null)
{
// TODO document this