10 #ifndef _FIFOQUEUE_H_2006_05_03
11 #define _FIFOQUEUE_H_2006_05_03
14 #if (defined(_DEBUG) || defined(_LOG_ALWAYS)) && defined(_LOG_QUEUE)
15 # include <typeinfo.h>
17 # define QUEUELOG(...)
30 template <
class T,
bool E=true>
33 #if !defined(QUEUELOG)
37 #if defined(_LOG_TO_STDOUT)
49 OutputDebugString(buf);
67 QUEUELOG(
"[%p]FifoQueue.new (base), T=%s, size=%d, del=%d\n",
this,
typeid(T).
name(),
size,delOnOverwrite);
83 QUEUELOG(
"[%p]FifoQueue.new (copy), T=%s, size=%d, count=%d, del=%d\n",
this,
typeid(T).
name(),
q.m_maxCount,
q.m_currentCount,
q.m_deleteOnOverwrite);
116 QUEUELOG(
"[%p]FifoQueue.operator =, T=%s, max=%d, count=%d, smax=%d, scount=%d\n",
this,
typeid(T).
name(),
m_maxCount,
m_currentCount,
q.m_maxCount,
q.m_currentCount);
275 #if !defined(QUEUELOG)
279 #if defined(_LOG_TO_STDOUT)
291 OutputDebugString(buf);
308 QUEUELOG(
"[%p]FifoQueueBase.new (base), T=%s, size=%d\n",
this,
typeid(T).
name(),
size);
321 QUEUELOG(
"[%p]FifoQueueBase.new (copy), T=%s, size=%d\n",
this,
typeid(T).
name(),
q.m_maxCount);
350 QUEUELOG(
"[%p]FifoQueueBase.operator =, T=%s, max=%d, count=%d, smax=%d, scount=%d\n",
this,
typeid(T).
name(),
m_maxCount,
m_currentCount,
q.m_maxCount,
q.m_currentCount);
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).
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.
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.
FifoQueue< T, E > & operator=(const FifoQueue< T, E2 > &q)
The assignment operator.
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.
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 BASE_IMPEXP int BASE_IMPEXP vsprintf(char *buf, size_t bufSize, const char *format, va_list args) MRPT_NO_THROWS
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.