Files
@ dae0a0a246f5
Branch filter:
Location: tempo-plotter/src/framebuffer2.h - annotation
dae0a0a246f5
1.8 KiB
text/plain
added one functional test for BinaryStreamReader
f8c253a6ab5f 5c0005f331cf f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f df800179c68c f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f 90a919d06a77 90a919d06a77 41cf55d3a08c f8c253a6ab5f 41cf55d3a08c f8c253a6ab5f 41cf55d3a08c f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f 5c0005f331cf 41cf55d3a08c 41cf55d3a08c 41cf55d3a08c f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f f8c253a6ab5f | /*
Copyright © 2018 Hasan Yavuz Özderya
This file is part of serialplot.
serialplot is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
serialplot is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with serialplot. If not, see <http://www.gnu.org/licenses/>.
*/
// IMPORTANT NOTE: this file will be renamed to "framebuffer.h" when
// stream work is complete
#ifndef FRAMEBUFFER_H
#define FRAMEBUFFER_H
struct Range
{
double start, end;
};
/// Abstract base class for all frame buffers.
class FrameBuffer
{
public:
/// Placeholder virtual destructor
virtual ~FrameBuffer() {};
/// Returns size of the buffer.
virtual unsigned size() const = 0;
/// Returns a sample from given index.
virtual double sample(unsigned i) const = 0;
/// Returns minimum and maximum of the buffer values.
virtual Range limits() const = 0;
};
/// Common base class for index and writable frame buffers
class ResizableBuffer : public FrameBuffer
{
public:
/// Resize the buffer.
///
/// @important Resizing to same value is an error.
virtual void resize(unsigned n) = 0;
};
/// Abstract base class for writable frame buffers
class WFrameBuffer : public ResizableBuffer
{
/// Add samples to the buffer
virtual void addSamples(double* samples, unsigned n) = 0;
/// Reset all data to 0
virtual void clear() = 0;
};
#endif // FRAMEBUFFER_H
|