public Optional <T> ReadInputValueFromCache(ForwardGate gate)
        {
            if (_cachedInputValueByGate.TryGetValue(gate, out T value))
            {
                _cachedInputValueByGate.Remove(gate);
                return(Optional <T> .FromValue(value));
            }

            return(Optional <T> .Empty);
        }
Пример #2
0
 public void WriteInputValueToCache(ForwardGate gate, T value)
 {
     try
     {
         _firstInputValueByGate.Add(gate, value);
     }
     catch (ArgumentException exception)
     {
         throw new InvalidOperationException("Another input value is already present.", exception);
     }
 }
Пример #3
0
 public void AddSuccessor(ForwardGate sucessor)
 {
     _successors.Add(sucessor);
 }
Пример #4
0
 public GateEvaluation(ForwardGate gate, GateEvaluationInput <T> input)
 {
     _gate  = gate;
     _input = input;
 }