22 LB_TS_SCOPED( _reader );
29 LBASSERT( isEmpty( ));
32 _data.resize( size + 1 );
37 LB_TS_SCOPED( _reader );
38 if( _readPos == _writePos )
41 result = _data[ _readPos ];
42 _readPos = (_readPos + 1) % _data.size();
48 LB_TS_SCOPED( _reader );
49 if( _readPos == _writePos )
52 result = _data[ _readPos ];
58 LB_TS_SCOPED( _writer );
59 int32_t nextPos = (_writePos + 1) % _data.size();
60 if( nextPos == _readPos )
63 _data[ _writePos ] = element;
bool pop(T &result)
Retrieve and pop the front element from the queue.
void clear()
Reset (empty) the queue.
void resize(const int32_t size)
Resize and reset the queue.
bool getFront(T &result)
Retrieve the front element from the queue.
Abstraction layer and common utilities for multi-threaded programming.
bool push(const T &element)
Push a new element to the back of the queue.