Package eu.qualimaster.easy.extension
Class ProjectFreezeModifier
java.lang.Object
eu.qualimaster.easy.extension.ProjectFreezeModifier
- All Implemented Interfaces:
net.ssehub.easy.varModel.model.rewrite.modifier.IProjectModifier
public class ProjectFreezeModifier
extends Object
implements net.ssehub.easy.varModel.model.rewrite.modifier.IProjectModifier
This modifier is used to freeze all relevant declarations inside the CFG projects of Qualimaster.
- Author:
- El-Sharkawy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate net.ssehub.easy.varModel.confModel.Configurationprivate List<net.ssehub.easy.varModel.model.DecisionVariableDeclaration> private static final int -
Constructor Summary
ConstructorsConstructorDescriptionProjectFreezeModifier(net.ssehub.easy.varModel.model.Project mainProject, List<net.ssehub.easy.varModel.model.DecisionVariableDeclaration> declarations) Single constructor instance for this class. -
Method Summary
Modifier and TypeMethodDescriptionprivate net.ssehub.easy.varModel.model.AttributegetBindingTimeAnnotation(net.ssehub.easy.varModel.model.Project project) Returns the binding time annotation of the project to create the selector statement of the freeze block.private booleanisRuntimeVariable(net.ssehub.easy.varModel.confModel.Configuration config, net.ssehub.easy.varModel.model.DecisionVariableDeclaration declaration) Checks whether the given declaration is a runtime variable.voidmodifyProject(net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.rewrite.RewriteContext context)
-
Field Details
-
RUNTIME_LEVEL
private static final int RUNTIME_LEVEL- See Also:
-
BLACKLIST
-
declarations
-
usedProjects
-
config
private net.ssehub.easy.varModel.confModel.Configuration config
-
-
Constructor Details
-
ProjectFreezeModifier
public ProjectFreezeModifier(net.ssehub.easy.varModel.model.Project mainProject, List<net.ssehub.easy.varModel.model.DecisionVariableDeclaration> declarations) Single constructor instance for this class.- Parameters:
mainProject- The main (copied) QM model, which imports all the other projects.declarations- The list of all declarations of the whole QM model, which should be frozen in all the different projects.
-
-
Method Details
-
modifyProject
public void modifyProject(net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.rewrite.RewriteContext context) - Specified by:
modifyProjectin interfacenet.ssehub.easy.varModel.model.rewrite.modifier.IProjectModifier
-
isRuntimeVariable
private boolean isRuntimeVariable(net.ssehub.easy.varModel.confModel.Configuration config, net.ssehub.easy.varModel.model.DecisionVariableDeclaration declaration) Checks whether the given declaration is a runtime variable.- Parameters:
config- The configuration where the declaration belongs to.declaration- The declaration to test.- Returns:
trueif the variable is a runtime variable and should not be frozen,falseelse.
-
getBindingTimeAnnotation
private net.ssehub.easy.varModel.model.Attribute getBindingTimeAnnotation(net.ssehub.easy.varModel.model.Project project) Returns the binding time annotation of the project to create the selector statement of the freeze block.- Parameters:
project- The project for which the freeze block shall be created.- Returns:
- The binding time annotation or
nullit could not be found.
-