-
#include "tensorstore/index_interval.h"
-
template <ContainerKind LabelCKind = container>
class tensorstore::IndexDomainDimension
: public OptionallyImplicitIndexInterval; Represents an index interval with optionally-implicit bounds and an optionally dimension label.
- Template Parameters:¶
- ContainerKind LabelCKind = container¶
Specifies how the dimension label is stored.
If
LabelCKind = container
, then the label is stored by value as anstd::string
.If
LabelCKind = view
, the label is stored by reference as anstd::string_view
.
Types¶
-
using Label = std::conditional_t<LabelCKind == container,
std::string,
std::string_view>; Dimension label representation.
Constructors¶
- IndexDomainDimension();
Constructs an unlabeled dimension with infinite, implicit bounds.
- IndexDomainDimension(const OptionallyImplicitIndexInterval& interval);
Constructs an unlabeled dimension with the specified bounds.
-
IndexDomainDimension(const OptionallyImplicitIndexInterval& interval,
Label label); Constructs a dimension with the given bounds and label.
- IndexDomainDimension(const IndexDomainDimension<OtherCKind>& other);
Converts the label storage kind.
Methods¶
-
IndexDomainDimension&
operator=(const IndexDomainDimension<OtherCKind>& other); Assigns the label and bounds.
-
const OptionallyImplicitIndexInterval&
optionally_implicit_interval() const; - OptionallyImplicitIndexInterval& optionally_implicit_interval();
Returns the dimension bounds.
- std::string_view label() const;
- Label& label();
Returns the dimension label.
Friend functions¶
-
friend bool operator==(const IndexDomainDimension<container>& a,
const IndexDomainDimension<container>& b); -
friend bool operator==(const IndexDomainDimension<view>& a,
const IndexDomainDimension<view>& b); -
friend bool operator==(const IndexDomainDimension<view>& a,
const IndexDomainDimension<container>& b); -
friend bool operator==(const IndexDomainDimension<container>& a,
const IndexDomainDimension<view>& b); Compares the bounds and labels.
Related Functions¶
-
Result<std::string_view>
tensorstore::MergeDimensionLabels(std::string_view a,
std::string_view b); Merges two dimension labels.