31 #ifndef ETL_SPSC_QUEUE_LOCKED_INCLUDED
32 #define ETL_SPSC_QUEUE_LOCKED_INCLUDED
51 template <
typename T, const
size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
62 #if ETL_CPP11_SUPPORTED
63 typedef T&& rvalue_reference;
74 #if ETL_CPP11_SUPPORTED
89 #if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKED_FORCE_CPP03)
90 template <
typename ... Args>
91 bool emplace_from_unlocked(Args&&... args)
105 #if ETL_CPP11_SUPPORTED
217 #if ETL_CPP11_SUPPORTED
239 #if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKED_FORCE_CPP03)
245 template <
typename ... Args>
267 template <
typename T1>
289 template <
typename T1,
typename T2>
311 template <
typename T1,
typename T2,
typename T3>
333 template <
typename T1,
typename T2,
typename T3,
typename T4>
374 #if ETL_CPP11_SUPPORTED
424 if (index == maximum)
443 #if defined(ETL_POLYMORPHIC_SPSC_QUEUE_ISR) || defined(ETL_POLYMORPHIC_CONTAINERS)
463 template <
typename T, const
size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
475 #if ETL_CPP11_SUPPORTED
476 typedef typename base_t::rvalue_reference rvalue_reference;
494 #if ETL_CPP11_SUPPORTED
498 bool push(rvalue_reference value)
514 #if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKED_FORCE_CPP03)
515 template <
typename ... Args>
531 template <
typename T1>
547 template <
typename T1,
typename T2>
548 bool emplace(
const T1& value1,
const T2& value2)
563 template <
typename T1,
typename T2,
typename T3>
564 bool emplace(
const T1& value1,
const T2& value2,
const T3& value3)
579 template <
typename T1,
typename T2,
typename T3,
typename T4>
580 bool emplace(
const T1& value1,
const T2& value2,
const T3& value3,
const T4& value4)
606 #if ETL_CPP11_SUPPORTED
610 bool pop(rvalue_reference value)
713 :
base_t(p_buffer_, max_size_)
725 #if ETL_CPP11_SUPPORTED
742 template <
typename T,
size_t SIZE, const
size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
755 static const size_type MAX_SIZE = size_type(SIZE);
763 :
base_t(reinterpret_cast<T*>(&buffer[0]), MAX_SIZE, lock, unlock)
780 #if ETL_CPP11_SUPPORTED
Definition: queue_spsc_locked.h:53
bool pop_from_unlocked()
Pop a value from the queue from an ISR, and discard.
Definition: queue_spsc_locked.h:118
size_type available_from_unlocked() const
Definition: queue_spsc_locked.h:127
bool emplace_implementation(const T1 &value1)
Definition: queue_spsc_locked.h:268
size_type read_index
Where to get the oldest data.
Definition: queue_spsc_locked.h:434
size_type max_size() const
How many items can the queue hold.
Definition: queue_spsc_locked.h:181
const size_type MAX_SIZE
The maximum number of items in the queue.
Definition: queue_spsc_locked.h:436
bool pop_implementation(reference value)
Pop a value from the queue.
Definition: queue_spsc_locked.h:356
bool push_implementation(const_reference value)
Push a value to the queue.
Definition: queue_spsc_locked.h:200
bool emplace_implementation(const T1 &value1, const T2 &value2, const T3 &value3)
Definition: queue_spsc_locked.h:312
size_type write_index
Where to input new data.
Definition: queue_spsc_locked.h:433
const T & const_reference
A const reference to the type used in the queue.
Definition: queue_spsc_locked.h:61
T & reference
A reference to the type used in the queue.
Definition: queue_spsc_locked.h:60
size_type current_size
The current size of the queue.
Definition: queue_spsc_locked.h:435
bool push_from_unlocked(const_reference value)
Push a value to the queue from an ISR.
Definition: queue_spsc_locked.h:69
void clear_from_unlocked()
Clear the queue from the ISR.
Definition: queue_spsc_locked.h:135
bool empty_from_unlocked() const
Definition: queue_spsc_locked.h:147
T value_type
The type stored in the queue.
Definition: queue_spsc_locked.h:59
~iqueue_spsc_locked_base()
Destructor.
Definition: queue_spsc_locked.h:450
T * p_buffer
The internal buffer.
Definition: queue_spsc_locked.h:432
size_type size_from_unlocked() const
Definition: queue_spsc_locked.h:165
etl::size_type_lookup< MEMORY_MODEL >::type size_type
The type used for determining the size of queue.
Definition: queue_spsc_locked.h:57
bool emplace_implementation(const T1 &value1, const T2 &value2)
Definition: queue_spsc_locked.h:290
bool emplace_implementation(const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
Definition: queue_spsc_locked.h:334
static size_type get_next_index(size_type index, size_type maximum)
Calculate the next index.
Definition: queue_spsc_locked.h:420
bool pop_implementation()
Pop a value from the queue and discard.
Definition: queue_spsc_locked.h:400
bool full_from_unlocked() const
Definition: queue_spsc_locked.h:156
bool pop_from_unlocked(reference value)
Pop a value from the queue from an ISR.
Definition: queue_spsc_locked.h:100
size_type capacity() const
How many items can the queue hold.
Definition: queue_spsc_locked.h:173
This is the base for all queue_spsc_isrs that contain a particular type.
Definition: queue_spsc_locked.h:465
bool emplace(const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
Definition: queue_spsc_locked.h:580
bool emplace(const T1 &value1)
Definition: queue_spsc_locked.h:532
bool emplace(const T1 &value1, const T2 &value2, const T3 &value3)
Definition: queue_spsc_locked.h:564
bool emplace(const T1 &value1, const T2 &value2)
Definition: queue_spsc_locked.h:548
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.
Definition: queue_spsc_locked.h:712
bool pop()
Pop a value from the queue and discard.
Definition: queue_spsc_locked.h:625
bool pop(reference value)
Pop a value from the queue.
Definition: queue_spsc_locked.h:595
void clear()
Clear the queue.
Definition: queue_spsc_locked.h:639
base_t::const_reference const_reference
A const reference to the type used in the queue.
Definition: queue_spsc_locked.h:474
base_t::reference reference
A reference to the type used in the queue.
Definition: queue_spsc_locked.h:473
base_t::value_type value_type
The type stored in the queue.
Definition: queue_spsc_locked.h:472
bool empty() const
Is the queue empty?
Definition: queue_spsc_locked.h:654
size_type size() const
How many items in the queue?
Definition: queue_spsc_locked.h:682
base_t::size_type size_type
The type used for determining the size of the queue.
Definition: queue_spsc_locked.h:478
bool full() const
Is the queue full?
Definition: queue_spsc_locked.h:668
bool push(const_reference value)
Push a value to the queue.
Definition: queue_spsc_locked.h:483
size_type available() const
How much free space available in the queue.
Definition: queue_spsc_locked.h:696
Definition: queue_spsc_locked.h:744
~queue_spsc_locked()
Destructor.
Definition: queue_spsc_locked.h:770
queue_spsc_locked(const etl::ifunction< void > &lock, const etl::ifunction< void > &unlock)
Default constructor.
Definition: queue_spsc_locked.h:761
Definition: alignment.h:116
Definition: function.h:73
Definition: integral_limits.h:54
add_rvalue_reference
Definition: type_traits_generator.h:1348
Definition: absolute.h:37
Definition: memory_model.h:48