Example #1
0
        internal ApplyResult(
            ModuleData transform,
            Map <string, FactSet> modelInputs,
            Map <string, Term> valueInputs,
            ImmutableCollection <Id> outputNames,
            TermIndex index,
            ExecuterStatistics stats,
            bool keepDers,
            CancellationToken cancel)
        {
            Contract.Requires(transform != null);
            Contract.Requires(transform.Reduced.Node.NodeKind == NodeKind.Transform || transform.Reduced.Node.NodeKind == NodeKind.TSystem);
            Contract.Requires(modelInputs != null && valueInputs != null && outputNames != null);
            Contract.Requires(index != null);

            this.cancel      = cancel;
            this.stats       = stats;
            this.index       = index;
            this.modelInputs = modelInputs;
            this.valueInputs = valueInputs;

            applyTarget     = transform;
            KeepDerivations = keepDers;
            OutputNames     = outputNames;
        }
 public bool TryGetStatistics(int id, out ExecuterStatistics stats)
 {
     TaskData data;
     if (!tasks.TryGetValue(id, out data))
     {
         stats = null;
         return false;
     }  
     stats = data.Statistics;
     return true;
 }
 public TaskData(int id, TaskKind kind, Task task, ExecuterStatistics stats, CancellationTokenSource canceller)
 {
     Contract.Requires(id >= 0);
     Contract.Requires(task != null && stats != null && canceller != null);
     Id = id;
     Kind = kind;
     Task = task;
     Statistics = stats;
     Canceller = canceller;
     StartTime = DateTime.Now;
 }
Example #4
0
        internal QueryResult(
            FactSet facts,
            ExecuterStatistics stats,
            bool keepDers,
            CancellationToken cancel)
        {
            Contract.Requires(facts != null);

            this.facts      = facts;
            this.cancel     = cancel;
            this.stats      = stats;
            KeepDerivations = keepDers;
            Conclusion      = LiftedBool.Unknown;
        }
 public int StartTask(Task<QueryResult> task, ExecuterStatistics stats, CancellationTokenSource canceller)
 {
     Contract.Requires(task != null && stats != null && canceller != null);
     var data = new TaskData(tasks.Count, TaskKind.Query, task, stats, canceller);
     tasks.Add(data.Id, data);
     if (IsWaitOn)
     {
         task.RunSynchronously();
     }
     else
     {
         task.Start();
     }
     return data.Id;
 }
Example #6
0
        internal ApplyResult(
            FactSet copy,
            ImmutableCollection <Id> outputNames,
            TermIndex index,
            ExecuterStatistics stats,
            bool keepDers,
            CancellationToken cancel)
        {
            Contract.Requires(copy != null && outputNames != null && index != null);
            this.cancel = cancel;
            this.stats  = stats;
            this.index  = index;

            applyTarget     = (ModuleData)copy.Model.Node.CompilerData;
            KeepDerivations = keepDers;
            OutputNames     = outputNames;

            valueInputs = new Map <string, Term>(string.Compare);
            modelInputs = new Map <string, FactSet>(string.Compare);
            modelInputs.Add(string.Empty, copy);
        }