示例#1
0
文件: BoxCache.cs 项目: zanderphh/wif
 /// <summary>
 /// The AddValues
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="values">The <see cref="T[]" /></param>
 internal static void AddValues <T>(params T[] values) where T : struct
 {
     BoxCache <T> .AddValues(values);
 }
示例#2
0
文件: BoxCache.cs 项目: zanderphh/wif
 /// <summary>
 /// Adds boxes for the specified values into the cache. Note that the cache uses a copy-on-write mechanism to ensure
 ///     thread safety and
 ///     ensure fastest possible lookup time so use this sparingly after application startup.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="values">The values<see cref="IEnumerable{T}"/></param>
 public static void AddValues <T>(IEnumerable <T> values) where T : struct, IComparable <T>
 {
     BoxCache <T> .AddValues(values);
 }
示例#3
0
文件: BoxCache.cs 项目: zanderphh/wif
 /// <summary>
 /// Gets a cached box for the specified value. A box is created and added to the cache if it doesn't already exist.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="value">The value<see cref="T"/></param>
 /// <returns>The <see cref="object"/></returns>
 public static object GetOrAddBox <T>(T value)
 {
     return(BoxCache <T> .GetOrAddBox(value));
 }
示例#4
0
文件: BoxCache.cs 项目: zanderphh/wif
 /// <summary>
 /// Adds a box for the specified value into the cache. Note that the cache uses a copy-on-write mechanism to ensure
 ///     thread safety and
 ///     ensure fastest possible lookup time so use this sparingly and use 'AddValues()' for multiple values instead.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="value">The value<see cref="T"/></param>
 public static void AddValue <T>(T value) where T : struct
 {
     BoxCache <T> .AddValue(value);
 }