mn::container::basic_atomic_queue< T, TMAXITEMS > Class Template Reference
A basic lockfree atomic queue. More...
#include <mn_atomic_queue.hpp>
Collaboration diagram for mn::container::basic_atomic_queue< T, TMAXITEMS >:
Classes | |
struct | node |
Public Types | |
using | value_type = T |
using | reference = T & |
using | lreference = T && |
using | pointer = node * |
using | const_value_type = const T |
using | const_reference = const T & |
using | self_type = basic_atomic_queue< T, TMAXITEMS > |
Public Member Functions | |
basic_atomic_queue () | |
basic_atomic_queue (const self_type &other)=delete | |
basic_atomic_queue (const self_type &&other)=delete | |
bool | push (reference _Element) noexcept |
Push a element to the queue. More... | |
pointer | pop_all (void) noexcept |
constexpr void | clear () noexcept |
Clear the queue. More... | |
constexpr bool | empty () noexcept |
Check, if queue is empty. More... | |
constexpr bool | full () noexcept |
constexpr mn::size_t | length () noexcept |
How many items can queue. More... | |
constexpr mn::size_t | size () noexcept |
constexpr mn::size_t | left () noexcept |
void | swap (const self_type &other) |
self_type & | operator= (const self_type &other) |
Protected Attributes | |
mn::_atomic< pointer > | m_atHead |
mn::atomic_size_t | m_curItems |
Detailed Description
template<class T, mn::size_t TMAXITEMS>
class mn::container::basic_atomic_queue< T, TMAXITEMS >
A basic lockfree atomic queue.
- Template Parameters
-
T The type of an element TMAXITEMS Maximal items can queue
Class Documentation
◆ mn::container::basic_atomic_queue::node
struct mn::container::basic_atomic_queue::node |
template<class T, mn::size_t TMAXITEMS>
struct mn::container::basic_atomic_queue< T, TMAXITEMS >::node
Collaboration diagram for mn::container::basic_atomic_queue< T, TMAXITEMS >::node:
Class Members | ||
---|---|---|
T | data | |
node * | next |
Member Typedef Documentation
◆ const_reference
template<class T , mn::size_t TMAXITEMS>
using mn::container::basic_atomic_queue< T, TMAXITEMS >::const_reference = const T& |
◆ const_value_type
template<class T , mn::size_t TMAXITEMS>
using mn::container::basic_atomic_queue< T, TMAXITEMS >::const_value_type = const T |
◆ lreference
template<class T , mn::size_t TMAXITEMS>
using mn::container::basic_atomic_queue< T, TMAXITEMS >::lreference = T&& |
◆ pointer
template<class T , mn::size_t TMAXITEMS>
using mn::container::basic_atomic_queue< T, TMAXITEMS >::pointer = node* |
◆ reference
template<class T , mn::size_t TMAXITEMS>
using mn::container::basic_atomic_queue< T, TMAXITEMS >::reference = T& |
◆ self_type
template<class T , mn::size_t TMAXITEMS>
using mn::container::basic_atomic_queue< T, TMAXITEMS >::self_type = basic_atomic_queue<T, TMAXITEMS> |
◆ value_type
template<class T , mn::size_t TMAXITEMS>
using mn::container::basic_atomic_queue< T, TMAXITEMS >::value_type = T |
Constructor & Destructor Documentation
◆ basic_atomic_queue() [1/3]
template<class T , mn::size_t TMAXITEMS>
|
inline |
◆ basic_atomic_queue() [2/3]
template<class T , mn::size_t TMAXITEMS>
|
delete |
◆ basic_atomic_queue() [3/3]
template<class T , mn::size_t TMAXITEMS>
|
delete |
Member Function Documentation
◆ clear()
template<class T , mn::size_t TMAXITEMS>
|
inlineconstexprnoexcept |
Clear the queue.
◆ empty()
template<class T , mn::size_t TMAXITEMS>
|
inlineconstexprnoexcept |
Check, if queue is empty.
- Returns
- true The queue is empty and false when not
◆ full()
template<class T , mn::size_t TMAXITEMS>
|
inlineconstexprnoexcept |
◆ left()
template<class T , mn::size_t TMAXITEMS>
|
inlineconstexprnoexcept |
How many empty spaves are currently left in the queue.
- Returns
- the number of remaining spaces.
◆ length()
template<class T , mn::size_t TMAXITEMS>
|
inlineconstexprnoexcept |
How many items can queue.
- Returns
- The maximal number of entries can queue
◆ operator=()
template<class T , mn::size_t TMAXITEMS>
|
inline |
◆ pop_all()
template<class T , mn::size_t TMAXITEMS>
|
inlinenoexcept |
◆ push()
template<class T , mn::size_t TMAXITEMS>
|
inlinenoexcept |
Push a element to the queue.
- Parameters
-
pElement The element
◆ size()
template<class T , mn::size_t TMAXITEMS>
|
inlineconstexprnoexcept |
How many items are currently in the queue.
- Returns
- the number of items in the queue.
◆ swap()
template<class T , mn::size_t TMAXITEMS>
|
inline |
Member Data Documentation
◆ m_atHead
template<class T , mn::size_t TMAXITEMS>
|
protected |
◆ m_curItems
template<class T , mn::size_t TMAXITEMS>
|
protected |
The documentation for this class was generated from the following file: