EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Member Functions | List of all members
CircularBuffer Class Reference

In-Memory buffer for values. More...

#include <CircularBuffer.h>

Public Member Functions

void allocate (DbrType type, DbrCount count, size_t num)
 Allocate buffer for num*(type,count) values. More...
 
DbrType getDbrType () const
 
DbrCount getDbrCount () const
 
size_t getCapacity () const
 
size_t getCount () const
 Number of values in the buffer, 0...(capacity-1)
 
void reset ()
 Keep memory as is, but reset to have 0 entries.
 
size_t getOverwrites () const
 Number of samples that had to be dropped.
 
RawValue::DatagetNextElement ()
 Advance pointer to the next element and return it. More...
 
void addRawValue (const RawValue::Data *raw_value)
 Copy a raw value into the buffer.
 
const RawValue::DatagetRawValue (size_t i) const
 Get a pointer to value number i without removing it. More...
 
const RawValue::DataremoveRawValue ()
 Return pointer to the oldest value in the buffer and remove it. More...
 
void dump () const
 dump
 

Detailed Description

In-Memory buffer for values.

Each SampleMechanism has one to buffer the incoming values until they are written to the disk.

Member Function Documentation

void CircularBuffer::allocate ( DbrType  type,
DbrCount  count,
size_t  num 
)

Allocate buffer for num*(type,count) values.

size_t CircularBuffer::getCapacity ( ) const
inline
Returns
Returns the capacity.

That is: max. number of elements.

DbrCount CircularBuffer::getDbrCount ( ) const
inline
Returns
Returns the data size.
DbrType CircularBuffer::getDbrType ( ) const
inline
Returns
Returns the data type.
RawValue::Data* CircularBuffer::getNextElement ( )

Advance pointer to the next element and return it.

This allows you to fiddle with that element yourself, otherwise see addRawValue.

const RawValue::Data* CircularBuffer::getRawValue ( size_t  i) const

Get a pointer to value number i without removing it.

Returns
Returns 0 if i is invalid.
const RawValue::Data* CircularBuffer::removeRawValue ( )

Return pointer to the oldest value in the buffer and remove it.

Returns
Returns 0 of there's nothing more to remove.

The documentation for this class was generated from the following file: