Esempio n. 1
0
 /// <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);
 }
Esempio n. 2
0
 /// <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);
 }
Esempio n. 3
0
 /// <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));
 }
Esempio n. 4
0
 /// <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);
 }