Handles the impact of a set of changes on the caches
예제 #1
0
 /// <summary>
 ///     Handles a change of the model element by invalidating the cache of all element in CacheDependancy
 /// </summary>
 /// <param name="cacheImpact"></param>
 public virtual void HandleChange(CacheImpact cacheImpact)
 {
     if (CacheDependancy != null)
     {
         foreach (ModelElement element in CacheDependancy)
         {
             cacheImpact.Add(element);
         }
     }
 }
예제 #2
0
        /// <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);
        }
예제 #3
0
 public void HandleChange(CacheImpact cacheImpact)
 {
     // Nothing to do
 }
예제 #4
0
        /// <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);
                }
            }
        }
예제 #5
0
 /// <summary>
 ///     Steps one step backward in this run
 /// </summary>
 public void StepBack()
 {
     CacheImpact = new CacheImpact();
     EventTimeLine.StepBack(this, _step);
     ClearCaches();
     _currentSubStepIndex = RebuildCurrentSubStep;
     _currentStepIndex = RebuildCurrentSubStep;
     _currentTestCaseIndex = RebuildCurrentSubStep;
 }
예제 #6
0
        /// <summary>
        ///     Setups the sub-step by applying its actions and adding its expects in the expect list
        /// </summary>
        public void SetupSubStep(SubStep subStep)
        {
            Util.DontNotify(() =>
            {
                LogInstance = subStep;

                // No setup can occur when some expectations are still active
                if (!EventTimeLine.ContainsSubStep(subStep))
                {
                    CacheImpact = new CacheImpact();
                    EventTimeLine.AddModelEvent(new SubStepActivated(subStep, CurrentPriority), this, true);
                    ClearCaches();
                }
            });
        }
예제 #7
0
        /// <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, ref updates);
                ApplyUpdates(updates);
                ClearCaches();
                CheckExpectationsState(priority);
            });
        }
 /// <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);
 }