Template Class DBQueue

Class Documentation

template<class T>
class DBQueue

Double buffered, threadsafe queue for MPSC (multi-producer, single-consumer) comms.

Public Functions

inline DBQueue()
inline void Swap()

Clears foreground queue and swaps queues.

inline void Push(const T &item)

Pushes to the background queue. Copy constructor.

inline void Push(T &&item)

Pushes to the background queue. Move constructor.

inline T &Front()

Returns a reference to the front element in the foregrund queue.

inline const T &Front() const
inline void Pop()

Pops from the foreground queue.

inline T FrontAndPop()

Return the front element in the foreground queue by moving it and erase it from the queue.

inline bool Empty() const

Reports whether the foreground queue is empty.

inline bool BothEmpty() const

Reports whether the both queues are empty.

inline size_t Size() const

Reports the size of the foreground queue.

inline void Clear()

Clears foreground and background.