SPH
Public Member Functions | List of all members
ConcurrentQueue< Type > Class Template Reference

#include <ConcurrentQueue.h>

Public Member Functions

 ConcurrentQueue ()=default
 
template<typename T >
void push (T &&value)
 Pushes the element to the back of the queue. This is a thread-safe operation. More...
 
Optional< Type > pop ()
 
bool empty ()
 Checks whether the queue is empty. This is a thread-safe operation. More...
 

Detailed Description

template<typename Type>
class ConcurrentQueue< Type >

Concurrent queue Pavel Sevecek 2017 sevec.nosp@m.ek@s.nosp@m.irrah.nosp@m..tro.nosp@m.ja.mf.nosp@m.f.cu.nosp@m.ni.cz

Todo:
can be implemented as lock-free queue, see boost::lockfree::queue

Definition at line 16 of file ConcurrentQueue.h.

Constructor & Destructor Documentation

◆ ConcurrentQueue()

template<typename Type >
ConcurrentQueue< Type >::ConcurrentQueue ( )
default

Member Function Documentation

◆ empty()

template<typename Type >
bool ConcurrentQueue< Type >::empty ( )
inline

Checks whether the queue is empty. This is a thread-safe operation.

Definition at line 45 of file ConcurrentQueue.h.

◆ pop()

template<typename Type >
Optional<Type> ConcurrentQueue< Type >::pop ( )
inline

Removes and returns element from the front of the queue. If the queue is empty, returns NOTHING. This is a thread-safe operation.

Definition at line 34 of file ConcurrentQueue.h.

◆ push()

template<typename Type >
template<typename T >
void ConcurrentQueue< Type >::push ( T &&  value)
inline

Pushes the element to the back of the queue. This is a thread-safe operation.

Definition at line 27 of file ConcurrentQueue.h.


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