#include <CircularBuffer.h>
Public Member Functions | |
CircularBufferIter (CircularBuffer< T > *pCircularBufferInit) | |
void | reset () |
Resets the iterator to the initial starting position. | |
void | operator++ () |
Increments the iterator position. | |
T & | operator * () |
| |
bool | end () |
| |
bool | done () |
| |
uint | getCurrPos () |
| |
void | setCurrPos (uint pos) |
Sets the current position of the iterator. | |
void | removeFront () |
Removes the first entry from the underlying circular buffer. | |
Private Attributes | |
CircularBuffer< T > * | pCircularBuffer |
Underlying circular buffer object. | |
uint | currPos |
Current position of this iterator within the underlying circular buffer. |
The iterator starts at the 0th position in the underlying circular buffer and always increases, even as positions in the underlying circular buffer are recycled.
Incrementing this iterator has not affect on the contents of the underlying buffer.
Definition at line 237 of file CircularBuffer.h.
CircularBufferIter< T >::CircularBufferIter | ( | CircularBuffer< T > * | pCircularBufferInit | ) | [inline, explicit] |
Definition at line 252 of file CircularBuffer.h.
00253 { 00254 pCircularBuffer = pCircularBufferInit; 00255 reset(); 00256 }
void CircularBufferIter< T >::reset | ( | ) | [inline] |
Resets the iterator to the initial starting position.
Definition at line 261 of file CircularBuffer.h.
Referenced by CircularBufferIter< LcsRidRun >::CircularBufferIter(), LcsRowScanExecStream::open(), and LcsClusterReader::open().
00262 { 00263 currPos = 0; 00264 }
void CircularBufferIter< T >::operator++ | ( | ) | [inline] |
Increments the iterator position.
Definition at line 269 of file CircularBuffer.h.
00270 { 00271 assert(!pCircularBuffer->empty()); 00272 currPos++; 00273 }
T& CircularBufferIter< T >::operator * | ( | ) | [inline] |
Definition at line 278 of file CircularBuffer.h.
00279 { 00280 assert(!pCircularBuffer->empty()); 00281 assert( 00282 currPos >= pCircularBuffer->getFirstPos() && 00283 currPos <= pCircularBuffer->getLastPos()); 00284 return (*pCircularBuffer)[currPos]; 00285 }
bool CircularBufferIter< T >::end | ( | ) | [inline] |
Definition at line 291 of file CircularBuffer.h.
Referenced by CircularBufferIter< LcsRidRun >::done(), and LcsClusterReader::getFetchRids().
00292 { 00293 return 00294 (pCircularBuffer->empty() || 00295 currPos > pCircularBuffer->getLastPos()); 00296 }
bool CircularBufferIter< T >::done | ( | ) | [inline] |
Definition at line 302 of file CircularBuffer.h.
Referenced by LcsRowScanExecStream::execute(), and LcsClusterReader::getNextPageForPrefetch().
00303 { 00304 return end() && pCircularBuffer->isReadOnly(); 00305 }
uint CircularBufferIter< T >::getCurrPos | ( | ) | [inline] |
Definition at line 310 of file CircularBuffer.h.
Referenced by LcsClusterReader::catchUp(), and LcsRowScanExecStream::execute().
00311 { 00312 return currPos; 00313 }
void CircularBufferIter< T >::setCurrPos | ( | uint | pos | ) | [inline] |
Sets the current position of the iterator.
pos | the posititon to be set |
Definition at line 320 of file CircularBuffer.h.
Referenced by LcsClusterReader::catchUp().
00321 { 00322 currPos = pos; 00323 }
void CircularBufferIter< T >::removeFront | ( | ) | [inline] |
Removes the first entry from the underlying circular buffer.
Definition at line 328 of file CircularBuffer.h.
Referenced by LcsClusterReader::getFetchRids().
00329 { 00330 pCircularBuffer->pop_front(); 00331 }
CircularBuffer<T>* CircularBufferIter< T >::pCircularBuffer [private] |
Underlying circular buffer object.
Definition at line 242 of file CircularBuffer.h.
Referenced by CircularBufferIter< LcsRidRun >::CircularBufferIter(), CircularBufferIter< LcsRidRun >::done(), CircularBufferIter< LcsRidRun >::end(), CircularBufferIter< LcsRidRun >::operator *(), CircularBufferIter< LcsRidRun >::operator++(), and CircularBufferIter< LcsRidRun >::removeFront().
uint CircularBufferIter< T >::currPos [private] |
Current position of this iterator within the underlying circular buffer.
Definition at line 248 of file CircularBuffer.h.
Referenced by CircularBufferIter< LcsRidRun >::end(), CircularBufferIter< LcsRidRun >::getCurrPos(), CircularBufferIter< LcsRidRun >::operator *(), CircularBufferIter< LcsRidRun >::operator++(), CircularBufferIter< LcsRidRun >::reset(), and CircularBufferIter< LcsRidRun >::setCurrPos().