Пример #1
0
        public ColumnData(DbType dbType, IUnmanagedAllocator allocator)
            : base(allocator)
        {
            m_dbType  = dbType;
            DataArray = new ExpandableArray <T>(1, typeof(T).IsValueType ? DriverRowData.GetByteCount(dbType) : IntPtr.Size);

            AssignFromDriverRow = GenerateAssignFromDriverRowAction();
            AssignToDriverRow   = GenerateAssignToDriverRowAction();
            WriteData           = GenerateWriteDataAction();
            ReadData            = GenerateReadDataAction();
        }
Пример #2
0
        public ColumnData(ColumnDataBase source, IUnmanagedAllocator allocator)
            : base(source, allocator)
        {
            var typed = (ColumnData <T>)source;

            m_dbType            = typed.DbType;
            DataArray           = typed.DataArray;
            AssignFromDriverRow = typed.AssignFromDriverRow;
            AssignToDriverRow   = typed.AssignToDriverRow;
            WriteData           = typed.WriteData;
            ReadData            = typed.ReadData;
        }
        private static void ReadBitVectorFromStore(BinaryReader reader, ExpandableArray <int> bitVectorData, int count)
        {
            var readSoFar = 0;

            bitVectorData.EnsureCapacity(count);
            const int elementsPerItem = 32;

            while (count > 0)
            {
                var block = bitVectorData.GetBlock(readSoFar);

                for (var i = 0; count > 0 && i < block.Length; i++, count -= elementsPerItem)
                {
                    block[i] = reader.ReadInt32();
                }

                readSoFar += bitVectorData.ElementsPerBlock;
            }
        }
Пример #4
0
            public ItemComparer(BitVector notNulls, ExpandableArray <TUnderlyingValue> data, IComparer <TUnderlyingValue> valueComparer)
            {
                if (notNulls == null)
                {
                    throw new ArgumentNullException("notNulls");
                }

                if (data == null)
                {
                    throw new ArgumentNullException("data");
                }

                if (valueComparer == null)
                {
                    throw new ArgumentNullException("valueComparer");
                }

                m_notNulls      = notNulls;
                m_data          = data;
                m_valueComparer = valueComparer;
            }