4 #include <initializer_list> 10 template <
class T,
class Lock = std::mutex,
template<
class>
class Guard = std::lock_guard,
class Container = std::deque<T>>
34 for(
auto&& elem : list)
35 queue.emplace(std::move(elem));
62 return this->
size() <= 0;
116 queue.emplace(std::move(elem));
127 template <
class... Args>
130 queue.emplace(std::forward<Args>(args)...);
AsyncQueue & push(const value_type &elem)
Add an element to the queue by copy.
AsyncQueue & operator=(AsyncQueue &&) noexcept=default
optional_type pop()
Removes the first element of the queue.
optional_type front() const
Retrieve the front element of the queue.
optional_type last() const
Alias for AsyncQueue::back.
AsyncQueue & queue(const value_type &elem)
Alias for AsyncQueue::push.
optional_type back() const
Retrieve the back element of the queue.
Global namespace of the SCL.
AsyncQueue & enqueue(const value_type &elem)
optional_type first() const
Alias for AsyncQueue::front.
AsyncQueue & queue(value_type &&elem)
bool isEmpty() const
Determine whether or not the queue is empty.
optional_type tail() const
typename queue_type::value_type value_type
AsyncQueue & enqueue(value_type &&elem)
AsyncQueue & pushEmplace(Args &&... args)
Construct and add an element to the queue.
typename queue_type::size_type size_type
AsyncQueue & push(value_type &&elem)
Add an element to the queue by move.
auto with(Resource &&res, F &&f) -> scl::tools::meta ::return_t< F >
Execute a transaction in a guarded manner.
size_type size() const
Determine the size of the queue.
optional_type dequeue()
Alias for AsyncQueue::pop.
size_type length() const
Alias for AsyncQueue::size.
optional_type head() const
std::queue< T, Container > queue_type
AsyncQueue(std::initializer_list< value_type > list)