Class PipelineHelper
java.lang.Object
eu.qualimaster.easy.extension.internal.PipelineHelper
- All Implemented Interfaces:
net.ssehub.easy.instantiation.core.model.vilTypes.IVilType
public class PipelineHelper
extends Object
implements net.ssehub.easy.instantiation.core.model.vilTypes.IVilType
Some pipeline helper functions mapped into rt-VIL.
- Author:
- Holger Eichelberger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.ssehub.easy.varModel.confModel.IDecisionVariablegetAvailable(net.ssehub.easy.varModel.confModel.IDecisionVariable pElt, String algorithm) Returns the available algorithm with given nameAlgorithmfrompElt.(package private) static net.ssehub.easy.instantiation.core.model.vilTypes.configuration.DecisionVariablegetByName(net.ssehub.easy.instantiation.core.model.vilTypes.configuration.Configuration configuration, String variableName) Finds a variable via its qualified instance name, i.e., the qualified name including nested variable names.static booleanisHardwareAlgorithm(net.ssehub.easy.varModel.confModel.IDecisionVariable var) Returns whethervaris a hardware algorithm.static net.ssehub.easy.varModel.confModel.IDecisionVariableobtainAlgorithmByName(net.ssehub.easy.varModel.confModel.Configuration config, String name) Obtains an algorithm fromconfigby its name.static net.ssehub.easy.varModel.confModel.IDecisionVariableobtainAlgorithmFromFamilyByName(net.ssehub.easy.varModel.confModel.IDecisionVariable family, String name) Obtains an algorithm form a family.static net.ssehub.easy.varModel.confModel.IDecisionVariableobtainAlgorithmFromFamilyByName(net.ssehub.easy.varModel.confModel.IDecisionVariable family, String slot, String name) Obtains an algorithm form a family.static net.ssehub.easy.varModel.confModel.IDecisionVariableobtainFamilyByName(net.ssehub.easy.varModel.confModel.IDecisionVariable pipeline, String name) Obtains a family of givennamefrompipeline.static net.ssehub.easy.instantiation.core.model.vilTypes.configuration.DecisionVariableobtainPipeline(net.ssehub.easy.instantiation.core.model.vilTypes.configuration.Configuration configuration, String variableName) Returns the pipeline related to the variable given by its instance name.static net.ssehub.easy.instantiation.core.model.vilTypes.configuration.DecisionVariableobtainPipeline(net.ssehub.easy.instantiation.core.model.vilTypes.configuration.Configuration configuration, String variableName, boolean strict) Returns the pipeline related to the variable given by its instance name.static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.vilTypes.configuration.DecisionVariable> obtainPipeline(net.ssehub.easy.instantiation.core.model.vilTypes.configuration.Configuration configuration, Iterator<?> clauses) Returns all pipelines mentioned inclauses.static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.vilTypes.configuration.DecisionVariable> obtainPipeline(net.ssehub.easy.instantiation.core.model.vilTypes.configuration.Configuration configuration, net.ssehub.easy.instantiation.core.model.vilTypes.Collection<?> clauses) Returns all pipelines mentioned inclauses.static net.ssehub.easy.varModel.confModel.IDecisionVariableobtainPipeline(net.ssehub.easy.varModel.confModel.Configuration configuration, net.ssehub.easy.varModel.confModel.IDecisionVariable element) Returns the pipeline decision for the given pipelineelement.static net.ssehub.easy.varModel.confModel.IDecisionVariableobtainPipelineByName(net.ssehub.easy.varModel.confModel.Configuration config, String name) Returns a pipeline from the configuration.static net.ssehub.easy.varModel.confModel.IDecisionVariableobtainPipelineByName(net.ssehub.easy.varModel.confModel.Configuration config, String name, String varName) Returns a pipeline from the configuration from a given variable containing pipelines.static net.ssehub.easy.varModel.confModel.IDecisionVariableobtainPipelineElementByName(net.ssehub.easy.varModel.confModel.IDecisionVariable pipeline, net.ssehub.easy.varModel.model.datatypes.IDatatype type, String name) Obtains a pipeline element.private static net.ssehub.easy.varModel.confModel.IDecisionVariablesearchScope(net.ssehub.easy.varModel.confModel.Configuration configuration, net.ssehub.easy.varModel.model.datatypes.IResolutionScope scope, net.ssehub.easy.varModel.model.datatypes.IDatatype type) Searches a givenscopefor a variable declaration oftypeand returns for the first matched decision variable the related decision.static voidsetActual(net.ssehub.easy.varModel.confModel.Configuration config, String pipeline, String pipelineElement, String algorithm) Sets the value of the actual slot inpipeline,pipelineElementtoalgorithmto the respective instance stored in the available slot ofpipelineElement.static voidSets the value of the actual slot ofpEltdue to algorithm corresponding to the algorithm with same name in the available slot.
-
Constructor Details
-
PipelineHelper
public PipelineHelper()
-
-
Method Details
-
obtainPipeline
public static net.ssehub.easy.instantiation.core.model.vilTypes.configuration.DecisionVariable obtainPipeline(net.ssehub.easy.instantiation.core.model.vilTypes.configuration.Configuration configuration, String variableName) throws net.ssehub.easy.instantiation.core.model.common.VilException Returns the pipeline related to the variable given by its instance name.- Parameters:
configuration- the configuration as basis for the lookupvariableName- the instance name of the variable- Returns:
- the pipeline (may be null if not found)
- Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- in case that accessing a pipeline fails
-
obtainPipeline
public static net.ssehub.easy.instantiation.core.model.vilTypes.configuration.DecisionVariable obtainPipeline(net.ssehub.easy.instantiation.core.model.vilTypes.configuration.Configuration configuration, String variableName, boolean strict) throws net.ssehub.easy.instantiation.core.model.common.VilException Returns the pipeline related to the variable given by its instance name.- Parameters:
configuration- the configuration as basis for the lookupvariableName- the instance name of the variablestrict- iftruereturn a pipeline only ifvariableNamedirectly refers to it,falseconsider also contained variables and search also parent variables- Returns:
- the pipeline (may be null if not found)
- Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- in case that accessing a pipeline fails
-
getByName
static net.ssehub.easy.instantiation.core.model.vilTypes.configuration.DecisionVariable getByName(net.ssehub.easy.instantiation.core.model.vilTypes.configuration.Configuration configuration, String variableName) Finds a variable via its qualified instance name, i.e., the qualified name including nested variable names.- Parameters:
configuration- the configuration to search onvariableName- the name of the variable- Returns:
- the related decision variable (may be null if none was found)
-
obtainPipeline
public static net.ssehub.easy.varModel.confModel.IDecisionVariable obtainPipeline(net.ssehub.easy.varModel.confModel.Configuration configuration, net.ssehub.easy.varModel.confModel.IDecisionVariable element) throws net.ssehub.easy.varModel.model.ModelQueryException Returns the pipeline decision for the given pipelineelement.- Parameters:
configuration- the configuration for the lookupelement- the pipeline element (may be null, leads to null)- Returns:
- the pipeline, may be null if the pipeline was not found
- Throws:
net.ssehub.easy.varModel.model.ModelQueryException- if accessing type information fails
-
searchScope
private static net.ssehub.easy.varModel.confModel.IDecisionVariable searchScope(net.ssehub.easy.varModel.confModel.Configuration configuration, net.ssehub.easy.varModel.model.datatypes.IResolutionScope scope, net.ssehub.easy.varModel.model.datatypes.IDatatype type) Searches a givenscopefor a variable declaration oftypeand returns for the first matched decision variable the related decision.- Parameters:
configuration- the configuration to retrieve the decision fromscope- the search scope for the declarationstype- the type to search for- Returns:
- the decision or null if not found
-
obtainPipeline
public static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.vilTypes.configuration.DecisionVariable> obtainPipeline(net.ssehub.easy.instantiation.core.model.vilTypes.configuration.Configuration configuration, net.ssehub.easy.instantiation.core.model.vilTypes.Collection<?> clauses) throws net.ssehub.easy.instantiation.core.model.common.VilException Returns all pipelines mentioned inclauses.- Parameters:
configuration- the configuration as basis for the lookupclauses- the clauses to look into- Returns:
- the pipelines (may be empty)
- Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- in case that accessing a pipeline fails
-
obtainPipeline
public static net.ssehub.easy.instantiation.core.model.vilTypes.Set<net.ssehub.easy.instantiation.core.model.vilTypes.configuration.DecisionVariable> obtainPipeline(net.ssehub.easy.instantiation.core.model.vilTypes.configuration.Configuration configuration, Iterator<?> clauses) throws net.ssehub.easy.instantiation.core.model.common.VilException Returns all pipelines mentioned inclauses.- Parameters:
configuration- the configuration as basis for the lookupclauses- the clauses to look into- Returns:
- the pipelines (may be empty)
- Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- in case that accessing a pipeline fails
-
obtainPipelineByName
public static net.ssehub.easy.varModel.confModel.IDecisionVariable obtainPipelineByName(net.ssehub.easy.varModel.confModel.Configuration config, String name) Returns a pipeline from the configuration.- Parameters:
config- the configurationname- the name of the pipeline- Returns:
- the pipeline or null if it does not exist
-
obtainPipelineByName
public static net.ssehub.easy.varModel.confModel.IDecisionVariable obtainPipelineByName(net.ssehub.easy.varModel.confModel.Configuration config, String name, String varName) Returns a pipeline from the configuration from a given variable containing pipelines.- Parameters:
config- the configurationname- the name of the pipelinevarName- the variable containing the pipelines- Returns:
- the pipeline or null if it does not exist
-
obtainFamilyByName
public static net.ssehub.easy.varModel.confModel.IDecisionVariable obtainFamilyByName(net.ssehub.easy.varModel.confModel.IDecisionVariable pipeline, String name) Obtains a family of givennamefrompipeline.- Parameters:
pipeline- the pipeline to obtain the family from (may be null)name- the name of the family- Returns:
- the family if it exists, null if there is no family
-
isHardwareAlgorithm
public static boolean isHardwareAlgorithm(net.ssehub.easy.varModel.confModel.IDecisionVariable var) Returns whethervaris a hardware algorithm.- Parameters:
var- the variable to check- Returns:
truefor hardware algorithm,falseelse
-
obtainAlgorithmByName
public static net.ssehub.easy.varModel.confModel.IDecisionVariable obtainAlgorithmByName(net.ssehub.easy.varModel.confModel.Configuration config, String name) Obtains an algorithm fromconfigby its name.- Parameters:
config- the configurationname- the name of the algorithm- Returns:
- the algorithm or null if not found
-
obtainPipelineElementByName
public static net.ssehub.easy.varModel.confModel.IDecisionVariable obtainPipelineElementByName(net.ssehub.easy.varModel.confModel.IDecisionVariable pipeline, net.ssehub.easy.varModel.model.datatypes.IDatatype type, String name) Obtains a pipeline element.- Parameters:
pipeline- the pipelinetype- the type of the element (may be null)name- the name of the element- Returns:
- the element or null if it does not exist for some reason
-
obtainAlgorithmFromFamilyByName
public static net.ssehub.easy.varModel.confModel.IDecisionVariable obtainAlgorithmFromFamilyByName(net.ssehub.easy.varModel.confModel.IDecisionVariable family, String name) Obtains an algorithm form a family.- Parameters:
family- the family (may be null)name- the name of the algorithm- Returns:
- the algorithm or null if none exists
-
obtainAlgorithmFromFamilyByName
public static net.ssehub.easy.varModel.confModel.IDecisionVariable obtainAlgorithmFromFamilyByName(net.ssehub.easy.varModel.confModel.IDecisionVariable family, String slot, String name) Obtains an algorithm form a family.- Parameters:
family- the family (may be null)slot- the slot infamilyto usename- the name of the algorithm- Returns:
- the algorithm or null if none exists
-
setActual
public static void setActual(net.ssehub.easy.varModel.confModel.IDecisionVariable pElt, String algorithm) throws net.ssehub.easy.instantiation.core.model.common.VilException Sets the value of the actual slot ofpEltdue to algorithm corresponding to the algorithm with same name in the available slot.- Parameters:
pElt- the IVML configuration variable representing the target pipeline elementalgorithm- the name of the algorithm to set as actual- Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- in case that setting the actual value is not possible, but not if the algorithm or the pipeline element does not exist
-
getAvailable
public static net.ssehub.easy.varModel.confModel.IDecisionVariable getAvailable(net.ssehub.easy.varModel.confModel.IDecisionVariable pElt, String algorithm) throws net.ssehub.easy.instantiation.core.model.common.VilException Returns the available algorithm with given nameAlgorithmfrompElt.- Parameters:
pElt- the IVML configuration variable representing the target pipeline elementalgorithm- the algorithm name- Returns:
- the available algorithm or null if not found
- Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- in case that the available algorithm slot does not exist
-
setActual
public static void setActual(net.ssehub.easy.varModel.confModel.Configuration config, String pipeline, String pipelineElement, String algorithm) throws net.ssehub.easy.instantiation.core.model.common.VilException Sets the value of the actual slot inpipeline,pipelineElementtoalgorithmto the respective instance stored in the available slot ofpipelineElement.- Parameters:
config- the configurationpipeline- the pipeline namepipelineElement- the pipeline element namealgorithm- the algorithm name- Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- if setting the actual value is not possible, but not if the algorithm or the pipeline element does not exist
-