BitOrchestra.Expression.GetEvaluator C# (CSharp) Метод

GetEvaluator() публичный Метод

Gets an evaluator for this expression, checking first if it is in the cache.
public GetEvaluator ( Evaluator>.Dictionary Cache, int BufferSize, int Resolution ) : Evaluator
Cache Evaluator>.Dictionary
BufferSize int
Resolution int
Результат Evaluator
        public Evaluator GetEvaluator(Dictionary<Expression, Evaluator> Cache, int BufferSize, int Resolution)
        {
            Evaluator eval;
            if (Cache.TryGetValue(this, out eval))
            {
                // Make sure the cached version is buffered, so its results can be reused.
                if (!(eval is ConstantEvaluator) && !(eval is IdentityEvaluator))
                {
                    BufferedEvaluator beval = eval.GetBuffered(BufferSize);
                    if (eval != beval)
                    {
                        eval = beval;
                        Cache[this] = beval;
                    }
                }
            }
            else
            {
                eval = this.CreateEvaluator(Cache, BufferSize, Resolution);
                Cache[this] = eval;
            }
            return eval;
        }

Usage Example

Пример #1
0
 public EvaluatorStream(int BufferSize, Expression Expression, SoundOptions Options, bool Exporting)
     : this(BufferSize, Expression.GetEvaluator(new Dictionary<Expression,Evaluator>(), BufferSize, Options.Resolution), Options, Exporting)
 {
 }