public void GetColumn <T>(IReadOnlyList <LogLineIndex> sourceIndices,
                                  IColumnDescriptor <T> column,
                                  T[] destination,
                                  int destinationIndex,
                                  LogSourceQueryOptions queryOptions)
        {
            if (sourceIndices == null)
            {
                throw new ArgumentNullException(nameof(sourceIndices));
            }
            if (column == null)
            {
                throw new ArgumentNullException(nameof(column));
            }
            if (destination == null)
            {
                throw new ArgumentNullException(nameof(destination));
            }
            if (destinationIndex < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(destinationIndex));
            }
            if (destinationIndex + sourceIndices.Count > destination.Length)
            {
                throw new ArgumentException("The given buffer must have an equal or greater length than destinationIndex+length");
            }

            if (Equals(column, Core.Columns.Index) || Equals(column, Core.Columns.OriginalIndex))
            {
                GetIndex(sourceIndices, (LogLineIndex[])(object)destination, destinationIndex);
            }
            else if (Equals(column, Core.Columns.LogEntryIndex))
            {
                GetLogEntryIndex(sourceIndices, (LogEntryIndex[])(object)destination, destinationIndex);
            }
            else if (Equals(column, Core.Columns.LineNumber))
            {
                GetLineNumber(sourceIndices, (int[])(object)destination, destinationIndex);
            }
            else if (Equals(column, Core.Columns.OriginalLineNumber))
            {
                GetLineNumber(sourceIndices, (int[])(object)destination, destinationIndex);
            }
            else if (IsAdorned(column, Core.Columns.ElapsedTime))
            {
                GetElapsedTime(sourceIndices, (TimeSpan?[])(object)destination, destinationIndex, queryOptions);
            }
            else if (IsAdorned(column, Core.Columns.DeltaTime))
            {
                GetDeltaTime(sourceIndices, (TimeSpan?[])(object)destination, destinationIndex, queryOptions);
            }
            else
            {
                _source.GetColumn(sourceIndices, column, destination, destinationIndex, queryOptions);
            }
        }
Beispiel #2
0
        /// <inheritdoc />
        public void GetColumn <T>(IReadOnlyList <LogLineIndex> sourceIndices, IColumnDescriptor <T> column, T[] destination, int destinationIndex, LogSourceQueryOptions queryOptions)
        {
            if (column == null)
            {
                throw new ArgumentNullException(nameof(column));
            }
            if (destination == null)
            {
                throw new ArgumentNullException(nameof(destination));
            }

            ILogSource logSource = _source;

            if (logSource != null)
            {
                logSource.GetColumn(sourceIndices, column, destination, destinationIndex, queryOptions);
            }
            else
            {
                if (sourceIndices == null)
                {
                    throw new ArgumentNullException(nameof(sourceIndices));
                }
                if (destinationIndex < 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(destinationIndex));
                }
                if (destinationIndex + sourceIndices.Count > destination.Length)
                {
                    throw new ArgumentException("The given buffer must have an equal or greater length than destinationIndex+length");
                }

                destination.Fill(column.DefaultValue, destinationIndex, sourceIndices.Count);
            }
        }
 /// <summary>
 ///     Retrieves a list of cells for a given column from this log file.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="logSource"></param>
 /// <param name="sourceIndices"></param>
 /// <param name="column"></param>
 /// <param name="destination"></param>
 public static void GetColumn <T>(this ILogSource logSource,
                                  IReadOnlyList <LogLineIndex> sourceIndices,
                                  IColumnDescriptor <T> column,
                                  T[] destination)
 {
     logSource.GetColumn(sourceIndices, column, destination, 0, LogSourceQueryOptions.Default);
 }
        /// <inheritdoc />
        public void GetColumn <T>(IReadOnlyList <LogLineIndex> sourceIndices, IColumnDescriptor <T> column, T[] destination, int destinationIndex, LogSourceQueryOptions queryOptions)
        {
            if (sourceIndices == null)
            {
                throw new ArgumentNullException(nameof(sourceIndices));
            }
            if (column == null)
            {
                throw new ArgumentNullException(nameof(column));
            }
            if (destination == null)
            {
                throw new ArgumentNullException(nameof(destination));
            }
            if (destinationIndex < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(destinationIndex));
            }
            if (destinationIndex + sourceIndices.Count > destination.Length)
            {
                throw new ArgumentException("The given buffer must have an equal or greater length than destinationIndex+length");
            }

            try
            {
                _logSource.GetColumn(sourceIndices, column, destination, destinationIndex, queryOptions);
            }
            catch (Exception e)
            {
                BlameExceptionOnPlugin(e);
            }
        }
 public override void GetColumn <T>(IReadOnlyList <LogLineIndex> sourceIndices,
                                    IColumnDescriptor <T> column,
                                    T[] destination,
                                    int destinationIndex,
                                    LogSourceQueryOptions queryOptions)
 {
     _source.GetColumn(sourceIndices, column, destination, destinationIndex, queryOptions);
 }
 public override void GetColumn <T>(IReadOnlyList <LogLineIndex> sourceIndices, IColumnDescriptor <T> column, T[] destination, int destinationIndex, LogSourceQueryOptions queryOptions)
 {
     if (IsIndexedColumn(column))
     {
         _indices.CopyTo(column, new Int32View(sourceIndices), destination, destinationIndex);
     }
     else
     {
         _source.GetColumn(sourceIndices, column, destination, destinationIndex, queryOptions);
     }
 }
        public static T[] GetColumn <T>(this ILogSource logSource, IReadOnlyList <LogLineIndex> sourceIndices, IColumnDescriptor <T> column, LogSourceQueryOptions queryOptions)
        {
            if (sourceIndices == null)
            {
                throw new ArgumentNullException(nameof(sourceIndices));
            }

            var cells = new T[sourceIndices.Count];

            logSource.GetColumn(sourceIndices, column, cells, queryOptions);
            return(cells);
        }
Beispiel #8
0
 public void CopyFrom(int destinationIndex, ILogSource source, IReadOnlyList <LogLineIndex> indices, LogSourceQueryOptions queryOptions)
 {
     source.GetColumn(indices, _column, _data, destinationIndex, queryOptions);
 }
Beispiel #9
0
 public void CopyFrom(int destinationIndex, ILogSource source, LogSourceSection section, LogSourceQueryOptions queryOptions)
 {
     source.GetColumn(section, _column, _data, destinationIndex, queryOptions);
 }
 public static T[] GetColumn <T>(this ILogSource logSource, IReadOnlyList <LogLineIndex> sourceIndices, IColumnDescriptor <T> column)
 {
     return(logSource.GetColumn <T>(sourceIndices, column, LogSourceQueryOptions.Default));
 }