/// <summary> /// Executes a single rule priority (shared version of the method) /// </summary> /// <param name="priority"></param> private void InnerExecuteOnePriority(acceptor.RulePriority priority) { Util.DontNotify(() => { CacheImpact = new CacheImpact(); CurrentPriority = priority; // Activates the processing engine HashSet <Activation> activations = new HashSet <Activation>(); foreach (Dictionary dictionary in EfsSystem.Instance.Dictionaries) { foreach (NameSpace nameSpace in dictionary.NameSpaces) { SetupNameSpaceActivations(priority, activations, nameSpace); } } List <VariableUpdate> updates = new List <VariableUpdate>(); EvaluateActivations(activations, priority, updates); CheckUpdatesCompatibility(updates); ApplyUpdates(updates); ClearCaches(); CheckExpectationsState(priority); }); }
/// <summary> /// Steps one step backward in this run /// </summary> public void StepBack() { CacheImpact = new CacheImpact(); EventTimeLine.StepBack(); SynchronizeCompletedSubStepWithTimeLine(); ClearCaches(); }
/// <summary> /// Actions to be taken when the variable's value changes /// </summary> /// <param name="cacheImpact"></param> public void HandleChange(CacheImpact cacheImpact) { StructureValue value = Enclosing as StructureValue; if (value != null) { IVariable variable = value.Enclosing as IVariable; if (variable != null) { variable.HandleChange(cacheImpact); } } StructureElement.HandleChange(cacheImpact); }
/// <summary> /// Handles the changes for this variable /// </summary> /// <param name="cacheImpact"></param> public override void HandleChange(CacheImpact cacheImpact) { base.HandleChange(cacheImpact); Structure structure = Type as Structure; if (structure != null) { structure.HandleChange(cacheImpact); } StructureValue enclosingStructureValue = Enclosing as StructureValue; if (enclosingStructureValue != null) { IVariable enclosingVariable = enclosingStructureValue.Enclosing as IVariable; if (enclosingVariable != null) { enclosingVariable.HandleChange(cacheImpact); } } }
/// <summary> /// Setups the sub-step by applying its actions and adding its expects in the expect list /// </summary> /// <returns>True if the substep was not already seetup</returns> public bool SetupSubStep(SubStep subStep) { bool retVal = false; if (subStep != null) { if (!EventTimeLine.ContainsSubStep(subStep)) { Util.DontNotify(() => { LogInstance = subStep; CacheImpact = new CacheImpact(); EventTimeLine.AddModelEvent(new SubStepActivated(subStep, CurrentPriority), true); ClearCaches(); }); retVal = true; } } return(retVal); }
public void HandleChange(CacheImpact cacheImpact) { // Nothing to do }
/// <summary> /// Clears the cache of all impacted elements /// </summary> public void ClearCaches() { CacheImpact.ClearCaches(); CacheImpact = null; }
/// <summary> /// Handles a change of the model element by invalidating the cache of all element in CacheDependancy /// </summary> /// <param name="cacheImpact"></param> public override void HandleChange(CacheImpact cacheImpact) { base.HandleChange(cacheImpact); Structure.HandleChange(cacheImpact); }
/// <summary> /// Actions to be taken when the variable's value changes /// </summary> /// <param name="cacheImpact"></param> public void HandleChange(CacheImpact cacheImpact) { Type.HandleChange(cacheImpact); }