class contiguous_index_queue

Declaration

template <typename T = std::uint32_t>
class contiguous_index_queue { /* full declaration omitted */ };

Description

A concurrent queue which can only hold contiguous ranges of integers.

A concurrent queue which can be initialized with a range of integers. Items can be popped from both ends of the queue. Popping from the right decrements the next element that will be popped from the right, if there are items left. Popping from the left increments the next element that will be popped from the left, if there are items left.

Declared at: libs/pika/concurrency/include/pika/concurrency/detail/contiguous_index_queue.hpp:27

Method Overview

Methods

constexpr contiguous_index_queue<T>() noexcept

Description

Construct a new contiguous_index_queue.

Construct a new queue with an empty range.

Declared at: libs/pika/concurrency/include/pika/concurrency/detail/contiguous_index_queue.hpp:83

constexpr contiguous_index_queue<T>(
    T first,
    T last) noexcept

Description

Construct a new contiguous_index_queue with the given range.

Construct a new queue with the given range as the initial range.

Declared at: libs/pika/concurrency/include/pika/concurrency/detail/contiguous_index_queue.hpp:92

Parameters

T first
T last

constexpr contiguous_index_queue<T>(
    const contiguous_index_queue<T>& other)

Description

Copy-construct a queue.

No additional synchronization is done to ensure that other threads are not accessing elements from the queue being copied. It is the callees responsibility to ensure that it is safe to copy the queue.

Declared at: libs/pika/concurrency/include/pika/concurrency/detail/contiguous_index_queue.hpp:104

Parameters

const contiguous_index_queue<T>& other

constexpr bool empty() noexcept

Declared at: libs/pika/concurrency/include/pika/concurrency/detail/contiguous_index_queue.hpp:179

constexpr pika::util::optional<T>
pop_left() noexcept

Description

Attempt to pop an item from the left of the queue.

Attempt to pop an item from the left (beginning) of the queue. If no items are left pika::util::nullopt is returned.

Declared at: libs/pika/concurrency/include/pika/concurrency/detail/contiguous_index_queue.hpp:129

constexpr pika::util::optional<T>
pop_right() noexcept

Description

Attempt to pop an item from the right of the queue.

Attempt to pop an item from the right (end) of the queue. If no items are left pika::util::nullopt is returned.

Declared at: libs/pika/concurrency/include/pika/concurrency/detail/contiguous_index_queue.hpp:156

constexpr void reset(T first, T last) noexcept

Description

Reset the queue with the given range.

Reset the queue with the given range. No additional synchronization is done to ensure that other threads are not accessing elements from the queue. It is the callees responsibility to ensure that it is safe to reset the queue.

Declared at: libs/pika/concurrency/include/pika/concurrency/detail/contiguous_index_queue.hpp:73

Parameters

T first
Beginning of the new range.
T last