示例#1
0
 /// <summary> Returns the cached version of the filter.  Allows the caller to pass up
 /// a small filter but this will keep a persistent version around and allow
 /// the caching filter to do its job.
 ///
 /// </summary>
 /// <param name="filter">The input filter
 /// </param>
 /// <returns> The cached version of the filter
 /// </returns>
 public virtual Filter GetFilter(Filter filter)
 {
     lock (cache.SyncRoot)
     {
         FilterItem fi = null;
         fi = (FilterItem)cache[(System.Int32)filter.GetHashCode()];
         if (fi != null)
         {
             fi.timestamp = System.DateTime.Now.Millisecond;                     // {{Aroush-2.3.1}} do we want Millisecond or Ticks here?
             return(fi.filter);
         }
         cache[(System.Int32)filter.GetHashCode()] = new FilterItem(this, filter);
         return(filter);
     }
 }
示例#2
0
 /// <summary> Returns the cached version of the filter.  Allows the caller to pass up
 /// a small filter but this will keep a persistent version around and allow
 /// the caching filter to do its job.
 ///
 /// </summary>
 /// <param name="filter">The input filter
 /// </param>
 /// <returns> The cached version of the filter
 /// </returns>
 public virtual Filter GetFilter(Filter filter)
 {
     lock (cache)
     {
         FilterItem fi = null;
         fi = cache[filter.GetHashCode()];
         if (fi != null)
         {
             fi.timestamp = System.DateTime.Now.Ticks;
             return(fi.filter);
         }
         cache[filter.GetHashCode()] = new FilterItem(this, filter);
         return(filter);
     }
 }
示例#3
0
 public override int GetHashCode()
 {
     return(filter.GetHashCode() ^ 0x1117BF25);
 }
示例#4
0
 public override int GetHashCode()
 {
     return(_filter.GetHashCode() ^ this.GetType().GetHashCode());
 }
示例#5
0
 /// <summary>Returns a hash code value for this object. </summary>
 public override int GetHashCode()
 {
     return(query.GetHashCode() ^ filter.GetHashCode() + System.Convert.ToInt32(GetBoost()));
 }
 /// <summary>Returns a hash code value for this object. </summary>
 public override int GetHashCode()
 {
     // Simple add is OK since no existing filter hashcode has a float component.
     return(filter.GetHashCode() + BitConverter.ToInt32(BitConverter.GetBytes(GetBoost()), 0));
 }
示例#7
0
 /// <summary>Returns a hash code value for this object. </summary>
 public override int GetHashCode()
 {
     return(query.GetHashCode() ^ filter.GetHashCode());
 }
 public override int GetHashCode()
 {
     return(Filter_Renamed.GetHashCode() ^ this.GetType().GetHashCode());
 }