Embedded Template Library 1.0
Loading...
Searching...
No Matches
etl::iqueue_spsc_locked< T, MEMORY_MODEL > Class Template Reference

This is the base for all queue_spsc_locked that contain a particular type. More...

#include <queue_spsc_locked.h>

Public Types

typedef T value_type
 The type stored in the queue.
 
typedef Treference
 A reference to the type used in the queue.
 
typedef const Tconst_reference
 A const reference to the type used in the queue.
 
typedef base_t::size_type size_type
 The type used for determining the size of the queue.
 
- Public Types inherited from etl::iqueue_spsc_locked_base< MEMORY_MODEL >
typedef etl::size_type_lookup< MEMORY_MODEL >::type size_type
 The type used for determining the size of queue.
 

Public Member Functions

bool push_from_unlocked (const_reference value)
 Push a value to the queue.
 
bool push (const_reference value)
 Push a value to the queue.
 
template<typename T1 >
bool emplace_from_unlocked (const T1 &value1)
 
template<typename T1 , typename T2 >
bool emplace_from_unlocked (const T1 &value1, const T2 &value2)
 
template<typename T1 , typename T2 , typename T3 >
bool emplace_from_unlocked (const T1 &value1, const T2 &value2, const T3 &value3)
 
template<typename T1 , typename T2 , typename T3 , typename T4 >
bool emplace_from_unlocked (const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
 
bool emplace ()
 
template<typename T1 >
bool emplace (const T1 &value1)
 
template<typename T1 , typename T2 >
bool emplace (const T1 &value1, const T2 &value2)
 
template<typename T1 , typename T2 , typename T3 >
bool emplace (const T1 &value1, const T2 &value2, const T3 &value3)
 
template<typename T1 , typename T2 , typename T3 , typename T4 >
bool emplace (const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
 
bool pop_from_unlocked (reference value)
 
bool pop (reference value)
 Pop a value from the queue.
 
bool pop_from_unlocked ()
 
bool pop ()
 Pop a value from the queue and discard.
 
reference front_from_unlocked ()
 
const_reference front_from_unlocked () const
 
reference front ()
 Peek a value from the front of the queue.
 
const_reference front () const
 Peek a value from the front of the queue.
 
void clear_from_unlocked ()
 Clear the queue from the ISR.
 
void clear ()
 Clear the queue.
 
size_type available () const
 How much free space available in the queue.
 
bool full () const
 Is the queue full?
 
size_type size () const
 How many items in the queue?
 
bool empty () const
 Is the queue empty?
 
- Public Member Functions inherited from etl::iqueue_spsc_locked_base< MEMORY_MODEL >
size_type available_from_unlocked () const
 How much free space available in the queue.
 
bool full_from_unlocked () const
 Is the queue full?
 
size_type size_from_unlocked () const
 How many items in the queue?
 
bool empty_from_unlocked () const
 Is the queue empty?
 
size_type capacity () const
 How many items can the queue hold.
 
size_type max_size () const
 How many items can the queue hold.
 

Protected Member Functions

 iqueue_spsc_locked (T *p_buffer_, size_type max_size_, const etl::ifunction< void > &lock_, const etl::ifunction< void > &unlock_)
 The constructor that is called from derived classes.
 
- Protected Member Functions inherited from etl::iqueue_spsc_locked_base< MEMORY_MODEL >
 iqueue_spsc_locked_base (size_type max_size_)
 
size_type available_implementation () const
 How much free space available in the queue.
 
bool full_implementation () const
 Is the queue full?
 
size_type size_implementation () const
 How many items in the queue?
 
bool empty_implementation () const
 Is the queue empty?
 
 ~iqueue_spsc_locked_base ()
 Destructor.
 

Additional Inherited Members

- Static Protected Member Functions inherited from etl::iqueue_spsc_locked_base< MEMORY_MODEL >
static size_type get_next_index (size_type index, size_type maximum)
 Calculate the next index.
 
- Protected Attributes inherited from etl::iqueue_spsc_locked_base< MEMORY_MODEL >
size_type write_index
 Where to input new data.
 
size_type read_index
 Where to get the oldest data.
 
size_type current_size
 The current size of the queue.
 
const size_type MAX_SIZE
 The maximum number of items in the queue.
 

Detailed Description

template<typename T, const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
class etl::iqueue_spsc_locked< T, MEMORY_MODEL >

This is the base for all queue_spsc_locked that contain a particular type.

Normally a reference to this type will be taken from a derived queue_spsc_locked. This queue supports concurrent access by one producer and one consumer.

Template Parameters
TThe type of value that the queue_spsc_locked holds.

Member Function Documentation

◆ emplace() [1/5]

template<typename T , const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
bool etl::iqueue_spsc_locked< T, MEMORY_MODEL >::emplace ( )
inline

Constructs a value in the queue 'in place'. If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full.

◆ emplace() [2/5]

template<typename T , const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
template<typename T1 >
bool etl::iqueue_spsc_locked< T, MEMORY_MODEL >::emplace ( const T1 value1)
inline

Constructs a value in the queue 'in place'. If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full.

◆ emplace() [3/5]

template<typename T , const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
template<typename T1 , typename T2 >
bool etl::iqueue_spsc_locked< T, MEMORY_MODEL >::emplace ( const T1 value1,
const T2 value2 
)
inline

Constructs a value in the queue 'in place'. If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full.

◆ emplace() [4/5]

template<typename T , const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
template<typename T1 , typename T2 , typename T3 >
bool etl::iqueue_spsc_locked< T, MEMORY_MODEL >::emplace ( const T1 value1,
const T2 value2,
const T3 value3 
)
inline

Constructs a value in the queue 'in place'. If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full.

◆ emplace() [5/5]

template<typename T , const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
bool etl::iqueue_spsc_locked< T, MEMORY_MODEL >::emplace ( const T1 value1,
const T2 value2,
const T3 value3,
const T4 value4 
)
inline

Constructs a value in the queue 'in place'. If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full.

◆ emplace_from_unlocked() [1/4]

template<typename T , const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
template<typename T1 >
bool etl::iqueue_spsc_locked< T, MEMORY_MODEL >::emplace_from_unlocked ( const T1 value1)
inline

Constructs a value in the queue 'in place'. If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full.

◆ emplace_from_unlocked() [2/4]

template<typename T , const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
template<typename T1 , typename T2 >
bool etl::iqueue_spsc_locked< T, MEMORY_MODEL >::emplace_from_unlocked ( const T1 value1,
const T2 value2 
)
inline

Constructs a value in the queue 'in place'. If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full.

◆ emplace_from_unlocked() [3/4]

template<typename T , const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
template<typename T1 , typename T2 , typename T3 >
bool etl::iqueue_spsc_locked< T, MEMORY_MODEL >::emplace_from_unlocked ( const T1 value1,
const T2 value2,
const T3 value3 
)
inline

Constructs a value in the queue 'in place'. If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full.

◆ emplace_from_unlocked() [4/4]

template<typename T , const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
bool etl::iqueue_spsc_locked< T, MEMORY_MODEL >::emplace_from_unlocked ( const T1 value1,
const T2 value2,
const T3 value3,
const T4 value4 
)
inline

Constructs a value in the queue 'in place'. If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full.

◆ front_from_unlocked() [1/2]

template<typename T , const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
reference etl::iqueue_spsc_locked< T, MEMORY_MODEL >::front_from_unlocked ( )
inline

Peek a value from the front of the queue. Unlocked

◆ front_from_unlocked() [2/2]

template<typename T , const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
const_reference etl::iqueue_spsc_locked< T, MEMORY_MODEL >::front_from_unlocked ( ) const
inline

Peek a value from the front of the queue. Unlocked

◆ pop_from_unlocked() [1/2]

template<typename T , const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
bool etl::iqueue_spsc_locked< T, MEMORY_MODEL >::pop_from_unlocked ( )
inline

Pop a value from the queue and discard. Unlocked

◆ pop_from_unlocked() [2/2]

template<typename T , const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
bool etl::iqueue_spsc_locked< T, MEMORY_MODEL >::pop_from_unlocked ( reference  value)
inline

Pop a value from the queue. Unlocked


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