Arduino DLNA Server
Classes | Public Member Functions | Protected Attributes | List of all members
tiny_dlna::QueueLockFree< T > Class Template Reference

A simple single producer, single consumer lock free queue. More...

#include <QueueLockFree.h>

Collaboration diagram for tiny_dlna::QueueLockFree< T >:
Collaboration graph
[legend]

Classes

struct  Node
 

Public Member Functions

 QueueLockFree (size_t capacity, Allocator &allocator=DefaultAllocator)
 
 ~QueueLockFree ()
 
void setAllocator (Allocator &allocator)
 
void resize (size_t capacity)
 
size_t capacity () const
 
size_t size () const
 
bool enqueue (T &&data)
 
bool enqueue (T &data)
 
bool dequeue (const T &&data)
 
bool dequeue (T &result)
 
void clear ()
 

Protected Attributes

Nodep_node
 
size_t capacity_mask
 
size_t capacity_value
 
std::atomic< size_t > tail_pos
 
std::atomic< size_t > head_pos
 
Vector< Nodevector
 

Detailed Description

template<typename T>
class tiny_dlna::QueueLockFree< T >

A simple single producer, single consumer lock free queue.

Constructor & Destructor Documentation

◆ QueueLockFree()

template<typename T >
tiny_dlna::QueueLockFree< T >::QueueLockFree ( size_t  capacity,
Allocator allocator = DefaultAllocator 
)
inline

◆ ~QueueLockFree()

template<typename T >
tiny_dlna::QueueLockFree< T >::~QueueLockFree ( )
inline

Member Function Documentation

◆ capacity()

template<typename T >
size_t tiny_dlna::QueueLockFree< T >::capacity ( ) const
inline

◆ clear()

template<typename T >
void tiny_dlna::QueueLockFree< T >::clear ( )
inline

◆ dequeue() [1/2]

template<typename T >
bool tiny_dlna::QueueLockFree< T >::dequeue ( const T &&  data)
inline

◆ dequeue() [2/2]

template<typename T >
bool tiny_dlna::QueueLockFree< T >::dequeue ( T &  result)
inline

◆ enqueue() [1/2]

template<typename T >
bool tiny_dlna::QueueLockFree< T >::enqueue ( T &&  data)
inline

◆ enqueue() [2/2]

template<typename T >
bool tiny_dlna::QueueLockFree< T >::enqueue ( T &  data)
inline

◆ resize()

template<typename T >
void tiny_dlna::QueueLockFree< T >::resize ( size_t  capacity)
inline

◆ setAllocator()

template<typename T >
void tiny_dlna::QueueLockFree< T >::setAllocator ( Allocator allocator)
inline

◆ size()

template<typename T >
size_t tiny_dlna::QueueLockFree< T >::size ( ) const
inline

Member Data Documentation

◆ capacity_mask

template<typename T >
size_t tiny_dlna::QueueLockFree< T >::capacity_mask
protected

◆ capacity_value

template<typename T >
size_t tiny_dlna::QueueLockFree< T >::capacity_value
protected

◆ head_pos

template<typename T >
std::atomic<size_t> tiny_dlna::QueueLockFree< T >::head_pos
protected

◆ p_node

template<typename T >
Node* tiny_dlna::QueueLockFree< T >::p_node
protected

◆ tail_pos

template<typename T >
std::atomic<size_t> tiny_dlna::QueueLockFree< T >::tail_pos
protected

◆ vector

template<typename T >
Vector<Node> tiny_dlna::QueueLockFree< T >::vector
protected

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