Class threading_common::blocked_range

template<typename Value>
class blocked_range

A range over which to iterate.

Public Types

template<>
using const_iterator = Value

Type of a value.

Called a const_iterator for sake of algorithms that need to treat a blocked_range as an STL container.

template<>
using size_type = std::size_t

Type for size of a range.

Public Functions

blocked_range(Value begin_, Value end_)

Construct range over half-open interval [begin,end), with the given grainsize.

const_iterator begin() const

Beginning of range.

const_iterator end() const

One past last value in range.

size_type size() const

Size of the range.

Unspecified if end()<begin().

size_type grainsize() const

The grain size for this range.

bool empty() const

True if range is empty.

bool is_divisible() const

True if range is divisible.

Unspecified if end()<begin().

blocked_range(blocked_range &r, split)

Split range.

The new Range *this has the second part, the old range r has the first part. Unspecified if end()<begin() or !is_divisible().

Private Members

Value my_end

NOTE: my_end MUST be declared before my_begin, otherwise the splitting constructor will break.

Value my_begin

Private Static Functions

static Value do_split(blocked_range &r, split)

Auxiliary function used by the splitting constructor.