10 #ifndef _FIFOQUEUE_H_2006_05_03
11 #define _FIFOQUEUE_H_2006_05_03
14 #if (defined(_DEBUG) || defined(_LOG_ALWAYS)) && defined(_LOG_QUEUE)
32 template <
class T,
bool E = true>
36 #if !defined(QUEUELOG)
40 #if defined(_LOG_TO_STDOUT)
52 OutputDebugString(buf);
74 "[%p]FifoQueue.new (base), T=%s, size=%d, del=%d\n",
this,
75 typeid(T).
name(),
size, delOnOverwrite);
92 "[%p]FifoQueue.new (copy), T=%s, size=%d, count=%d, del=%d\n",
this,
93 typeid(T).
name(),
q.m_maxCount,
q.m_currentCount,
94 q.m_deleteOnOverwrite);
107 "[%p]FifoQueue.eraseAndClear, T=%s, count=%d\n",
this,
119 "[%p]FifoQueue.delete, T=%s, count=%d\n",
this,
typeid(T).
name(),
131 "[%p]FifoQueue.operator =, T=%s, max=%d, count=%d, smax=%d, "
153 "[%p]FifoQueue.resize, T=%s, max=%d, count=%d, size=%d\n",
this,
192 "[%p]FifoQueue.push, T=%s, max=%d, count=%d, x=%p\n",
this,
211 "[%p]FifoQueue.pop, T=%s, max=%d, count=%d\n",
this,
221 "[%p]FifoQueue.popBack, T=%s, max=%d, count=%d\n",
this,
247 "[%p]FifoQueue.clear, T=%s, max=%d, count=%d\n",
this,
256 "[%p]FifoQueue.remove, T=%s, max=%d, count=%d, index=%d\n",
this,
285 #if !defined(QUEUELOG)
289 #if defined(_LOG_TO_STDOUT)
301 OutputDebugString(buf);
322 "[%p]FifoQueueBase.new (base), T=%s, size=%d\n",
this,
337 "[%p]FifoQueueBase.new (copy), T=%s, size=%d\n",
this,
338 typeid(T).
name(),
q.m_maxCount);
350 "[%p]FifoQueueBase.eraseAndClear, T=%s, count=%d\n",
this,
362 "[%p]FifoQueueBase.delete, T=%s, count=%d\n",
this,
372 "[%p]FifoQueueBase.operator =, T=%s, max=%d, count=%d, smax=%d, "
394 "[%p]FifoQueueBase.resize, T=%s, max=%d, count=%d, size=%d\n",
this,
432 "[%p]FifoQueueBase.push, T=%s, max=%d, count=%d, x=%p\n",
this,
449 "[%p]FifoQueueBase.push_front, T=%s, max=%d, count=%d, x=%p\n",
461 "[%p]FifoQueueBase.pop, T=%s, max=%d, count=%d\n",
this,
474 "[%p]FifoQueueBase.popBack, T=%s, max=%d, count=%d\n",
this,
500 "[%p]FifoQueueBase.clear, T=%s, max=%d, count=%d\n",
this,
509 "[%p]FifoQueueBase.remove, T=%s, max=%d, count=%d, index=%d\n",
A FIFO queue with limited length (cyclic).
~FifoQueueBasic()
The destructor.
const value_type & operator[](size_t index) const
Return the index'th oldest item from the queue.
value_type & back()
Return the newest element in the queue.
void popBack(void)
Remove the element at the back of the queue.
FifoQueueBasic(size_type size=16)
Create an empty queue with capacity size.
T value_type
The type of the value stored in this queue.
const value_type & back() const
Return the newest element in the queue.
void resize(const size_t size)
Resize the queue, note that this function clears the queue.
value_type & front()
Return the oldest element in the queue.
size_type size() const
Return the maximum number of elements in the queue.
void push(const value_type &x)
Insert x at the back of the queue.
FifoQueueBasic(const FifoQueueBasic< T > &q)
The copy constructor.
void pop(void)
Remove the element at the front of the queue.
FifoQueueBasic< T > & operator=(const FifoQueueBasic< T > &q)
The assignment operator.
void remove(size_t index)
size_t size_type
The type of a 'size' value.
void push_front(const value_type &x)
Insert x at the front of the queue (LIFO operation).
value_type & operator[](size_t index)
Return the index'th oldest item from the queue.
const value_type & front() const
Return the oldest element in the queue.
bool empty() const
Return true if the queue is empty.
size_type length() const
Return the number of elements currnetly in the queue.
A FIFO queue with limited length (cyclic).
void push(const value_type &x)
Insert x at the back of the queue.
value_type & operator[](size_t index)
Return the index'th oldest item from the queue.
void resize(const size_t size)
Resize the queue, note that this function clears the queue.
bool empty() const
Return true if the queue is empty.
value_type & front()
Return the oldest element in the queue.
T value_type
The type of the value stored in this queue.
size_type size() const
Return the maximum number of elements in the queue.
size_t size_type
The type of a 'size' value.
value_type & back()
Return the newest element in the queue.
const value_type & back() const
Return the newest element in the queue.
const value_type & front() const
Return the oldest element in the queue.
FifoQueue(const FifoQueue< T, E2 > &q)
The copy constructor.
void pop(void)
Remove the element at the front of the queue.
~FifoQueue()
The destructor.
FifoQueue(size_type size=16, bool delOnOverwrite=true)
Create an empty queue with capacity size.
void popBack(void)
Remove the element at the back of the queue.
const value_type & operator[](size_t index) const
Return the index'th oldest item from the queue.
FifoQueue< T, E > & operator=(const FifoQueue< T, E2 > &q)
The assignment operator.
void remove(size_t index)
size_type length() const
Return the number of elements currnetly in the queue.
GLuint const GLchar * name
GLdouble GLdouble GLdouble GLdouble q
int int vsprintf(char *buf, size_t bufSize, const char *format, va_list args) noexcept
An OS-independent version of vsprintf (Notice the bufSize param, which may be ignored in some compile...
The namespace of all Xsens software since 2006.