Data provider interface for the GraphView class.
This interface defines the DataSource for GraphView objects. The graph view queries an associated data source object for the data to display. All GraphView objects must have a data source object that hold the data to be displayed. The data source interface exposes an array-like scheme for providing data to the GraphView.
This interface forces you to expose your data sample as an array, where all samples has an index. The index starts at index 0 and has variable length.
You must subclass this interface and override at least 3 virtual methods. These 3 methods are:
- DataPoint(int) : Return individual data samples
- BufferLength() : Return the full length of the data source
- MaxSampleValueSpan() : Return the full range of the data sample values
By providing the methods for retreiving data, getting the total length of the data buffer and defining the valid value range of the data samples.
If your subclass is representing a casual signal buffer, where samples are continuesly written, you might override the method:
This method should return the index to the newest sample in the buffer. This enables the GraphView to display a scrolling cursor, that moves as the buffer data gets updates.
Note: You are in charge of notifying the associated GraphView‘s when the data source content changes.
Override this to return data point samples to the view.
Provides a sample from the data source. You must override this method to return samples at any given index.
- the sample value at the given index
The 0-indexed sample position, that should be returned
Override this to return the data sample buffer length to the view.
Returns the length / the total number of data samples in the data source. You must override this method to return the total number of data sample in your data source implementation.
- the size / length of the data source
The value span for the data samples. üsed to map the buffer samples to the screen (view height)