Logo Search packages:      
Sourcecode: libgdf version File versions  Download package

Classes | Public Member Functions | Private Attributes

gdf::RecordBuffer Class Reference

Buffers incomplete records before they are written to disk. More...

#include <RecordBuffer.h>

Collaboration diagram for gdf::RecordBuffer:
Collaboration graph
[legend]

List of all members.

Classes

class  RecordFullHandler

Public Member Functions

RecordacquireRecord ()
 Returns a reference to a free record.
void addRecord (Record *r)
 Add a complete Record.
void addSamplePhys (const size_t channel_idx, const double value)
 Add a physical sample to the channel specified by channel_idx.
template<typename T >
void addSampleRaw (const size_t channel_idx, const T rawval)
 Add a raw sample to the channel specified by channel_idx.
void blitSamplesPhys (const size_t channel_idx, const double *values, size_t num)
 Blit a number of physical samples into channel specified by channel_idx.
template<typename T >
void blitSamplesRaw (const size_t channel_idx, const T *values, size_t num)
 Blit a number of raw samples into channel specified by channel_idx.
void clearBuffers ()
 Clear all buffers.
std::list< Record * >::iterator createNewRecord ()
 Put a new record to the end of the list.
void fillPhys (const size_t channel_idx, const double value, size_t num)
 Fill a number of samples with the same physical value.
template<typename T >
void fillRaw (const size_t channel_idx, const T value, size_t num)
 Fill a number of samples with the same raw value.
void flood ()
 Fills all partial records with default values.
RecordgetFirstFullRecord ()
 Reference to first (oldest) full record in list. This is also the first record that gets filled.
size_t getNumFreeAlloc (const size_t channel_idx)
 Gets number of free samples currently allocated for this channel.
size_t getNumFullRecords () const
 Get number of full records in the buffer.
size_t getNumPartialRecords () const
 Get number of partially filled records currently in the list.
ChannelgetValidChannel (const size_t channel_idx)
 Returns reference to channel specified by channel_idx.
void handleChannelFull (const size_t channel_idx)
 Called when a channel becomes full.
void handleRecordFull ()
 Called when a record becomes full.
 RecordBuffer (const GDFHeaderAccess *gdfh)
 Constructor.
void registerRecordFullCallback (RecordFullHandler *h)
 Register Callback for record full event.
void removeFirstFullRecord ()
 Remove first full record in list.
void reset ()
 Resets the buffer to a valid initial state.
void unregisterRecordFullCallback (RecordFullHandler *h)
 Unegister Callback for record full event.
virtual ~RecordBuffer ()
 Destructor.

Private Attributes

std::vector< std::list< Record * >
::iterator > 
m_channelhead
const GDFHeaderAccessm_gdfh
size_t m_num_full
PointerPool< Record > * m_pool
std::list< RecordFullHandler * > m_recfull_callbacks
std::list< Record * > m_records
std::list< Record * > m_records_full

Detailed Description

Buffers incomplete records before they are written to disk.

When saving data, one or more channels can be ahead of the others, and may even extend over multiple records. RecordBuffer takes care of this by creating a new record as soon a channel exceeds it's capacity.

Definition at line 37 of file RecordBuffer.h.


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

Generated by  Doxygen 1.6.0   Back to index