#include "tensorstore/util/maybe_hard_constraint.h"
template <typename T>
class tensorstore::MaybeHardConstraintSpan : public span<const T>;

Combines a span (with length assumed to be a valid rank) with a bit vector indicating which values are hard constraints as opposed to soft constraints.

This type serves as a base class for option types like ChunkLayout::GridOrigin.

Constructors

explicit MaybeHardConstraintSpan();

Constructs a zero-length span with no hard constraints.

explicit MaybeHardConstraintSpan(
    
span<const T> s,
    
DimensionSet hard_constraint = DimensionSet(true));
explicit MaybeHardConstraintSpan(
    
const T (&s)[N],
    
DimensionSet hard_constraint = DimensionSet(true));

Constructs from a vector and hard constraint dimension set.

Methods

constexpr bool valid() const;

Checks if the span has non-zero length.

Friend functions

friend bool operator==(const MaybeHardConstraintSpana,
                       
const MaybeHardConstraintSpanb);
friend bool operator!=(const MaybeHardConstraintSpana,
                       
const MaybeHardConstraintSpanb);

Compares two constraints for equality.

Data members

DimensionSet hard_constraint;

Set of dimensions for which the corresponding constraint value should be treated as a hard constraint.