2 #ifndef __CIRCULARBUFFER_H__
3 #define __CIRCULARBUFFER_H__
6 #include "storage/RawValue.h"
36 {
return max_index-1; }
46 {
return overwrites; }
90 #endif //__CIRCULARBUFFER_H__
void reset()
Keep memory as is, but reset to have 0 entries.
unsigned short DbrType
DbrType is used to hold dbr_time_xxx types.
Definition: RawValue.h:24
void allocate(DbrType type, DbrCount count, size_t num)
Allocate buffer for num*(type,count) values.
RawValue::Data * getNextElement()
Advance pointer to the next element and return it.
DbrCount getDbrCount() const
Definition: CircularBuffer.h:28
unsigned short DbrCount
DbrCount is used to hold the array size of CA channels.
Definition: RawValue.h:27
In-Memory buffer for values.
Definition: CircularBuffer.h:14
DbrType getDbrType() const
Definition: CircularBuffer.h:24
size_t getOverwrites() const
Number of samples that had to be dropped.
Definition: CircularBuffer.h:45
size_t getCapacity() const
Definition: CircularBuffer.h:35
const RawValue::Data * removeRawValue()
Return pointer to the oldest value in the buffer and remove it.
size_t getCount() const
Number of values in the buffer, 0...(capacity-1)
void addRawValue(const RawValue::Data *raw_value)
Copy a raw value into the buffer.
dbr_time_double Data
Type for accessing the raw data and its common fields.
Definition: RawValue.h:55
const RawValue::Data * getRawValue(size_t i) const
Get a pointer to value number i without removing it.