[Quantproject-developers] QuantProject/b3_Data/Selectors SelectorByGroup.cs, 1.3, 1.4
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2011-08-21 11:36:17
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/Selectors
In directory vz-cvs-3.sog:/tmp/cvs-serv5897/Selectors
Modified Files:
SelectorByGroup.cs
Log Message:
Now SelectorByGroup implements also ITickerSelectorByDate
Index: SelectorByGroup.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b3_Data/Selectors/SelectorByGroup.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SelectorByGroup.cs 27 Mar 2010 17:31:33 -0000 1.3
--- SelectorByGroup.cs 21 Aug 2011 11:36:15 -0000 1.4
***************
*** 33,40 ****
/// Class for selection on tickers by groupId only or groupId and date
/// </summary>
! public class SelectorByGroup : ITickerSelector
{
private string groupID;
private DateTime date = new DateTime(1900,1,1);
/// <summary>
--- 33,42 ----
/// Class for selection on tickers by groupId only or groupId and date
/// </summary>
! [Serializable]
! public class SelectorByGroup : ITickerSelector, ITickerSelectorByDate
{
private string groupID;
private DateTime date = new DateTime(1900,1,1);
+ private bool temporizedGroup = false;
/// <summary>
***************
*** 53,56 ****
--- 55,71 ----
/// </summary>
/// <param name="groupID">Group's code for which tickers are to be selected</param>
+ /// <param name="temporizedGroup">If true, the selection depends on
+ /// the time of request</param>
+ public SelectorByGroup( string groupID, bool temporizedGroup )
+ {
+ this.groupID = groupID;
+ this.temporizedGroup = temporizedGroup;
+ }
+
+ /// <summary>
+ /// Creates an new instance of SelectorByGroup, in order
+ /// to get tickers contained in the given group
+ /// </summary>
+ /// <param name="groupID">Group's code for which tickers are to be selected</param>
/// <param name="date">The date at which tickers to be selected belong effectively
/// to the given group</param>
***************
*** 69,76 ****
--- 84,103 ----
return QuantProject.DataAccess.Tables.Tickers_tickerGroups.GetTickers( this.groupID, this.date );
}
+
+ public DataTable GetTableOfSelectedTickers(DateTime dateTime)
+ {
+ if(this.temporizedGroup)
+ //date has not be set by the user because it is still equal to default value
+ return QuantProject.DataAccess.Tables.Tickers_tickerGroups.GetTickers( this.groupID, dateTime );
+ else//if not temporized, the selection depends only on groupID
+ return QuantProject.DataAccess.Tables.Tickers_tickerGroups.GetTickers( this.groupID );
+ }
+
public void SelectAllTickers()
{
;
}
+
+
}
}
|