public override object Process(object input) { if (input == null) { throw new ArgumentNullException("input", "Argument is not allowed to be null."); } if (!Verified && !Verify()) { throw new PipelineNotValidException(this, "Can not use a Pipline that is incomplete."); } object currentIn = input; Stopwatch sw = new Stopwatch(); Tuple <string, long>[] timing = new Tuple <string, long> [Stages.Count]; long totalTime = 0; for (int i = 0; i < Stages.Count; i++) { PipelineStage internalPipelineStage = Stages[i]; sw.Start(); currentIn = internalPipelineStage.Process(currentIn); timing[i] = new Tuple <string, long>(internalPipelineStage.GetType().Name, sw.ElapsedMilliseconds); totalTime += sw.ElapsedMilliseconds; sw.Reset(); //Logger.Log(LogType.Log, $"Stage {timing[i].Item1} finished in {timing[i].Item2.ToString()} ms", 2); } //Logger.Log(LogType.Log, $"_______________________________________________", 1); //Logger.Log(LogType.Log, $"Total: {totalTime} ms", 1); return(currentIn); }
public override TOut Process(string input) { string ext = Path.GetExtension(input); if (typeLoaders.ContainsKey(ext)) { return(typeLoaders[ext].Process(fileLoader.Process(input))); } throw new UnknownFileFormatException(input); }
protected override TOut DoWork(TIn input) { return(stage.Process(input)); }