Esempio n. 1
0
        public static Delegate?GetDirectReader()
        {
            if (typeof(TLogical) == typeof(bool) ||
                typeof(TLogical) == typeof(int) ||
                typeof(TLogical) == typeof(long) ||
                typeof(TLogical) == typeof(Int96) ||
                typeof(TLogical) == typeof(float) ||
                typeof(TLogical) == typeof(double))
            {
                return(LogicalRead.GetDirectReader <TPhysical, TPhysical>());
            }

            if (typeof(TLogical) == typeof(uint))
            {
                return(LogicalRead.GetDirectReader <uint, int>());
            }

            if (typeof(TLogical) == typeof(ulong))
            {
                return(LogicalRead.GetDirectReader <ulong, long>());
            }

            return(null);
        }
 /// <summary>
 /// Return a reader delegate if a TPhysical column reader can directly write into a TLogical span (e.g. float to float, int to uint, etc).
 /// Otherwise return null. This is an optimisation to avoid needless memory copies between buffers (i.e. otherwise we have to use the
 /// identity converter).
 /// </summary>
 /// <returns>
 /// A delegate of type LogicalRead&lt;TLogical, TPhysical&gt;.DirectReader
 /// </returns>
 public virtual Delegate?GetDirectReader <TLogical, TPhysical>()
     where TPhysical : unmanaged
 {
     return(LogicalRead <TLogical, TPhysical> .GetDirectReader());
 }