Fast RTPS  Version 2.14.1
Fast RTPS
Loading...
Searching...
No Matches
DBQueue< T > Class Template Reference

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

#include <DBQueue.h>

Public Member Functions

 DBQueue ()
 
void Swap ()
 Clears foreground queue and swaps queues.
 
void Push (const T &item)
 Pushes to the background queue. Copy constructor.
 
void Push (T &&item)
 Pushes to the background queue. Move constructor.
 
T & Front ()
 Returns a reference to the front element in the foregrund queue.
 
const T & Front () const
 
void Pop ()
 Pops from the foreground queue.
 
FrontAndPop ()
 Return the front element in the foreground queue by moving it and erase it from the queue.
 
bool Empty () const
 Reports whether the foreground queue is empty.
 
bool BothEmpty () const
 Reports whether the both queues are empty.
 
size_t Size () const
 Reports the size of the foreground queue.
 
void Clear ()
 Clears foreground and background.
 

Detailed Description

template<class T>
class eprosima::fastrtps::DBQueue< T >

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

Constructor & Destructor Documentation

◆ DBQueue()

template<class T >
DBQueue ( )
inline

Member Function Documentation

◆ BothEmpty()

template<class T >
bool BothEmpty ( ) const
inline

Reports whether the both queues are empty.

◆ Clear()

template<class T >
void Clear ( )
inline

Clears foreground and background.

◆ Empty()

template<class T >
bool Empty ( ) const
inline

Reports whether the foreground queue is empty.

◆ Front() [1/2]

template<class T >
T & Front ( )
inline

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

◆ Front() [2/2]

template<class T >
const T & Front ( ) const
inline

◆ FrontAndPop()

template<class T >
T FrontAndPop ( )
inline

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

◆ Pop()

template<class T >
void Pop ( )
inline

Pops from the foreground queue.

◆ Push() [1/2]

template<class T >
void Push ( const T &  item)
inline

Pushes to the background queue. Copy constructor.

◆ Push() [2/2]

template<class T >
void Push ( T &&  item)
inline

Pushes to the background queue. Move constructor.

◆ Size()

template<class T >
size_t Size ( ) const
inline

Reports the size of the foreground queue.

◆ Swap()

template<class T >
void Swap ( )
inline

Clears foreground queue and swaps queues.


The documentation for this class was generated from the following file: