MityDSP Documentation Index
tcDspCircularIndex

Introduction

The tcDspCircularIndex class maintains a circular index and manages the read and write pointers. The circular buffer associated with the index is managed separately and can contain any kind of object.

There is always one empty entry in the buffer. The write index points to the next entry to be written. The read index points to the first valid entry to read. If the read index is the same as the write index, then the buffer is considered empty.

If you provide a LCK_handle, then this class manages synchronous access from different threads.

Example

A special class is provided to help with reads. A read of the buffer would look something like:

{
tcDspCircularIndex::tcCircularRead localRead( YourCircularIndex )
for( i = localRead.StartRead(nMaxRead);
i != tcDspCircularIndex::mnEndOfBuffer;
i = localRead.ReadNext() )
{}
}

When the object localRead goes out of scope, the read is completed. Note that when a read is active, the writes will spill if the write index catches up to the read pointer.

See also:
MityDSP::tcDspCircularIndex Class Reference

  
Generated on Mon Apr 22 2013 11:33:02 for MityDSP Core by  Doxygen Version 1.8.1.1
Copyright © 2009, Critical Link LLC, All rights reserved.