コード例 #1
0
        public void Add(int sourceIndex, int count, IReadOnlyLogBuffer source, LogLineIndex destinationIndex)
        {
            // Let us see where that data lies in this page..
            var pageDestinationIndex = destinationIndex - _section.Index;

            foreach (var column in _copiedColumns)
            {
                _buffer.CopyFrom(column, pageDestinationIndex, source, new Int32Range(sourceIndex, count));
            }

            // We neither need, nor want the source buffer to have to supply the indices - we know them ourselves
            _buffer.CopyFrom(Columns.Index, pageDestinationIndex, new LogSourceSection(_section.Index + pageDestinationIndex, count), 0, count);
            _buffer.Fill(PageBufferedLogSource.RetrievalState, RetrievalState.Retrieved, pageDestinationIndex, count);
        }
コード例 #2
0
        public Page(int index, int pageSize, IReadOnlyList <IColumnDescriptor> columns, IReadOnlyList <IColumnDescriptor> copiedColumns)
        {
            _index          = index;
            _pageSize       = pageSize;
            _copiedColumns  = copiedColumns;
            _section        = new LogSourceSection(index * pageSize, pageSize);
            _buffer         = new LogBufferArray(pageSize, columns);
            _lastAccessTime = DateTime.MinValue;
            _numReads       = 0;

            _buffer.Fill(PageBufferedLogSource.RetrievalState, RetrievalState.NotInSource, 0, _pageSize);
        }