public StockProcessor(StockSession session)
        {
            this.Session = session;

            // Load the source file static information
            Session.SourceFile.LoadStaticData(session);

            // Create the derived data set
            HistoricalData = StockDataSetDerived <StockDataSink, StockDataSource, StockProcessingState> .Derive(Session.SourceFile.GetSegments <StockDataSource>(), Session.SinkFile, CreateSink, GetProcessingState);

            DerivedData = StockDataSetDerived <StockDataSink, StockDataSource, StockProcessingState> .CastToInterface(HistoricalData);

            Session.Data = DerivedData;
            Session.SinkFile.SetSegments <StockDataSink>(StockDataSetDerived <StockDataSink, StockDataSource, StockProcessingState> .CastToBase(HistoricalData));
        }
Exemple #2
0
        public StockProcessor(StockSession session)
        {
            this.Session = session;

            // Load the source file static information
            Session.SourceFile.LoadStaticData(session);

            // Create the derived data set
            HistoricalData = StockDataSetDerived <StockDataSink, StockDataSource, StockProcessingState> .Derive(Session.SourceFile.GetSegments <StockDataSource>(), Session.SinkFile, CreateSink, GetProcessingState);

            DerivedData = StockDataSetDerived <StockDataSink, StockDataSource, StockProcessingState> .CastToInterface(HistoricalData);

            Session.Data = DerivedData;
            Session.SinkFile.SetSegments <StockDataSink>(StockDataSetDerived <StockDataSink, StockDataSource, StockProcessingState> .CastToBase(HistoricalData));

            foreach (var pair in HistoricalData)
            {
                var state = new StockProcessingState();
                state.DataSet = pair.Value;
                ProcessingStates[pair.Key] = new Dictionary <TimeSpan, StockProcessingState>()
                {
                };
            }
        }