[Quantproject-developers] QuantProject/b3_Data/DataProviders/Bars/Caching SimpleBarCache.cs, 1.1,
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2009-02-08 16:46:03
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/DataProviders/Bars/Caching In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10345/b3_Data/DataProviders/Bars/Caching Modified Files: SimpleBarCache.cs Log Message: Exception management is more logic now: the missingBarException is thrown only if necessary. Index: SimpleBarCache.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataProviders/Bars/Caching/SimpleBarCache.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SimpleBarCache.cs 5 Feb 2009 22:11:16 -0000 1.1 --- SimpleBarCache.cs 8 Feb 2009 16:45:56 -0000 1.2 *************** *** 23,26 **** --- 23,28 ---- using System; + using QuantProject.DataAccess; + namespace QuantProject.Data.DataProviders.Bars.Caching { *************** *** 31,34 **** --- 33,37 ---- { private int intervalFrameInSeconds; + public SimpleBarCache(int intervalFrameInSeconds) { *************** *** 53,59 **** catch( Exception ex ) { ! string message = ex.Message; // used to avoid warning ! throw new MissingBarException( ! ticker , dateTime , this.intervalFrameInSeconds); } return returnValue; --- 56,64 ---- catch( Exception ex ) { ! if( ex.GetType() == Type.GetType("QuantProject.DataAccess.EmptyQueryException") ) ! throw new MissingBarException( ! ticker , dateTime , this.intervalFrameInSeconds); ! else ! throw ex; } return returnValue; *************** *** 62,66 **** public bool WasExchanged( string ticker , DateTime dateTime ) { ! double marketValue = double.MinValue; try { --- 67,71 ---- public bool WasExchanged( string ticker , DateTime dateTime ) { ! double marketValue = double.NaN; try { *************** *** 71,75 **** string doNothing = missingBarException.Message; doNothing += ""; } ! return (marketValue != Double.MinValue); } } --- 76,80 ---- string doNothing = missingBarException.Message; doNothing += ""; } ! return (marketValue != Double.NaN); } } |