예제 #1
0
        public bool TryRead(LogLineIndex sourceStartIndex, int count, ILogBuffer destination, int destinationIndex, bool requiresValidityCheck)
        {
            ++_numReads;
            _lastAccessTime = DateTime.UtcNow;

            var pageSourceIndex = sourceStartIndex - _section.Index;
            var range           = new Int32Range(pageSourceIndex, count);

            foreach (var column in _buffer.Columns)
            {
                if (destination.Contains(column))
                {
                    destination.CopyFrom(column, destinationIndex, _buffer, range);
                }
            }

            if (requiresValidityCheck)
            {
                if (_buffer.ContainsAnyDefault(Columns.Index, range))
                {
                    return(false);
                }
            }

            return(true);
        }
예제 #2
0
            public bool ContainsAny(T value, Int32Range range)
            {
                for (int i = 0; i < range.Count; ++i)
                {
                    // TODO: Boxing/Unboxing is going to kill us here, we need a generic equality comparer here
                    if (Equals(_data[range.Offset + i], value))
                    {
                        return(true);
                    }
                }

                return(false);
            }
예제 #3
0
        public bool ContainsAny <T>(IColumnDescriptor <T> column, T value, Int32Range range)
        {
            if (column == null)
            {
                throw new ArgumentNullException(nameof(column));
            }

            if (!_dataByColumn.TryGetValue(column, out var data))
            {
                throw new ArgumentException(string.Format("No such column: {0}", column));
            }

            return(((ColumnData <T>)data).ContainsAny(value, range));
        }
예제 #4
0
        public bool ContainsAnyDefault(IColumnDescriptor column, Int32Range range)
        {
            if (column == null)
            {
                throw new ArgumentNullException(nameof(column));
            }

            if (!_dataByColumn.TryGetValue(column, out var data))
            {
                throw new ArgumentException(string.Format("No such column: {0}", column));
            }

            return(data.ContainsAnyDefault(range));
        }
예제 #5
0
 public bool ContainsAnyDefault(Int32Range range)
 {
     return(ContainsAny(_column.DefaultValue, range));
 }