/// <summary> /// Initializes a new instance of the <see cref="DataItem<T>"/> class, /// specifying whether the default for (T) results in an "empty" value. /// </summary> /// <param name="value">The value.</param> /// <param name="defaultIsEmpty">if set to <c>true</c> [default is empty].</param> /// <param name="doNotPool">if set to <c>true</c> [do not pool].</param> public DataItem(T value, bool defaultIsEmpty, bool doNotPool) { _value = PoolValue <T> .NewValue(value, defaultIsEmpty, doNotPool); }
/// <summary> /// Ensures the internal value is pooled. Usually called after clearing the pool. /// </summary> public void Repool() { _value = PoolValue <T> .NewValue(_value.Value); }
/// <summary> /// Initializes a new instance of the <see cref="DataItem<T>"/> class with a value. /// </summary> /// <param name="value">The value.</param> public DataItem(T value) { _value = PoolValue <T> .NewValue(value, _defaultIsEmpty, false); }