Exemple #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)
     {
         FilterItem fi = null;
         fi = cache[filter.GetHashCode()];
         if (fi != null)
         {
             fi.timestamp = System.DateTime.UtcNow.Ticks;
             return(fi.filter);
         }
         cache[filter.GetHashCode()] = new FilterItem(filter);
         return(filter);
     }
 }
Exemple #2
0
 public override int GetHashCode()
 {
     return(filter.GetHashCode() ^ 0x1117BF25);
 }
 /// <summary>Returns a hash code value for this object. </summary>
 public override int GetHashCode()
 {
     return(query.GetHashCode() ^ filter.GetHashCode() + System.Convert.ToInt32(Boost));
 }
 /// <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(internalFilter.GetHashCode() + BitConverter.ToInt32(BitConverter.GetBytes(Boost), 0));
 }