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);
510 #endif // _FIFOQUEUE_H_2006_05_03 size_type size() const
Return the maximum number of elements in the queue.
FifoQueueBasic(const FifoQueueBasic< T > &q)
The copy constructor.
FifoQueue(const FifoQueue< T, E2 > &q)
The copy constructor.
size_type size() const
Return the maximum number of elements in the queue.
value_type & back()
Return the newest element in the queue.
const value_type & back() const
Return the newest element in the queue.
size_type length() const
Return the number of elements currnetly in the queue.
const value_type & operator[](size_t index) const
Return the index'th oldest item from the queue.
GLdouble GLdouble GLdouble GLdouble q
bool empty() const
Return true if the queue is empty.
const value_type & front() const
Return the oldest element in the queue.
void pop(void)
Remove the element at the front of the queue.
FifoQueue< T, E > & operator=(const FifoQueue< T, E2 > &q)
The assignment operator.
size_t size_type
The type of a 'size' value.
T value_type
The type of the value stored in this queue.
void push(const value_type &x)
Insert x at the back of the queue.
void push(const value_type &x)
Insert x at the back of the queue.
const value_type & operator[](size_t index) const
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.
~FifoQueue()
The destructor.
FifoQueue(size_type size=16, bool delOnOverwrite=true)
Create an empty queue with capacity size.
value_type & front()
Return the oldest element in the queue.
void popBack(void)
Remove the element at the back of the queue.
T value_type
The type of the value stored in this queue.
const value_type & front() const
Return the oldest element in the queue.
const value_type & back() const
Return the newest element in the queue.
size_t size_type
The type of a 'size' value.
FifoQueueBasic(size_type size=16)
Create an empty queue with capacity size.
bool empty() const
Return true if the queue is empty.
value_type & front()
Return the oldest element in the queue.
A FIFO queue with limited length (cyclic).
A FIFO queue with limited length (cyclic).
FifoQueueBasic< T > & operator=(const FifoQueueBasic< T > &q)
The assignment operator.
GLuint const GLchar * name
void resize(const size_t size)
Resize the queue, note that this function clears the queue.
void pop(void)
Remove the element at the front of the queue.
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.
size_type length() const
Return the number of elements currnetly in the queue.
void popBack(void)
Remove the element at the back of the queue.
~FifoQueueBasic()
The destructor.
void push_front(const value_type &x)
Insert x at the front of the queue (LIFO operation).
value_type & back()
Return the newest element in the queue.