16 using std::runtime_error;
25 m_has_filled ( false )
82 addRow (
const std::vector< double > & v )
96 if (
empty () ==
false ) {
97 const string what (
"CircularBuffer: Attempt to set the capacity of " 98 "non-empty buffer is not allowed" );
99 throw runtime_error ( what );
unsigned int m_capacity
The capacity.
CircularBuffer class interface.
void replaceRow(unsigned int i, const std::vector< double > &data)
Replaces the data in the row i.
virtual void reserve(unsigned int count)
Sets the size, in rows, of the circular buffer.
void incrementRowIndex()
Increments the next row index.
bool m_has_filled
A flog which when true, indicates the buffer has been filled to capacity.
virtual void clear()
Clears the contents without changing the capacity.
virtual void reserve(unsigned int count)
For each column, reserves enough space for the data source to grow to count rows. ...
A DataSource class implemented with std::vector<double> to store the column data. ...
virtual bool empty() const
Returns true, if NTuple is empty, i.e.
virtual void addRow(const std::vector< double > &v)
Adds a row to the buffer.
virtual void clear()
Clears the NTuple.
CircularBuffer()
The default constructor creating an circular buffer with 0 columns.
virtual void addRow(const std::vector< double > &v)
Adds a row to the end of the ntuple.
unsigned int m_next_row
The index to the next row to be added.