diff --git a/tensorstore/array.h b/tensorstore/array.h index 3e13c9be..aa94ed56 100644 --- a/tensorstore/array.h +++ b/tensorstore/array.h @@ -2079,6 +2079,9 @@ bool IsBroadcastScalar( } /// Returns minimum number of contiguous bytes into which the array fits. +/// +/// \relates Array +/// \id array template Index GetByteExtent( diff --git a/tensorstore/array_storage_statistics.h b/tensorstore/array_storage_statistics.h index 61608d6a..ab6412ad 100644 --- a/tensorstore/array_storage_statistics.h +++ b/tensorstore/array_storage_statistics.h @@ -25,7 +25,11 @@ namespace tensorstore { +/// Response from a storage statistics query. +/// +/// \relates GetStorageStatistics struct ArrayStorageStatistics { + /// Indicates the information to request. enum Mask { /// Query if no data is stored. query_not_stored = 1, @@ -34,25 +38,22 @@ struct ArrayStorageStatistics { query_fully_stored = 2, }; + /// Set operations. friend constexpr Mask operator~(Mask a) { return static_cast(~static_cast>(a)); } - friend constexpr Mask operator|(Mask a, Mask b) { using U = std::underlying_type_t; return static_cast(static_cast(a) | static_cast(b)); } - friend constexpr Mask& operator|=(Mask& a, Mask b) { using U = std::underlying_type_t; return a = static_cast(static_cast(a) | static_cast(b)); } - friend constexpr Mask operator&(Mask a, Mask b) { using U = std::underlying_type_t; return static_cast(static_cast(a) & static_cast(b)); } - friend constexpr Mask operator&=(Mask& a, Mask b) { using U = std::underlying_type_t; return a = static_cast(static_cast(a) & static_cast(b)); @@ -88,6 +89,7 @@ struct ArrayStorageStatistics { return !(a == b); } + /// Prints a debug representation. friend std::ostream& operator<<(std::ostream& os, const ArrayStorageStatistics& a); @@ -96,6 +98,14 @@ struct ArrayStorageStatistics { }; }; +/// Specifies options for computing array storage statistics. +/// +/// Supported option types are: +/// +/// - `Batch` +/// - `ArrayStorageStatistics::Mask` +/// +/// \relates GetStorageStatistics struct GetArrayStorageStatisticsOptions { ArrayStorageStatistics::Mask mask = {}; diff --git a/tensorstore/batch.h b/tensorstore/batch.h index 04fd5520..7a90f328 100644 --- a/tensorstore/batch.h +++ b/tensorstore/batch.h @@ -29,6 +29,8 @@ namespace tensorstore { /// /// For some operations, there are batch implementations there are batch /// implementations that reduce the number of separate I/O requests performed. +/// +/// \ingroup core class Batch { class ImplBase { public: @@ -55,10 +57,14 @@ class Batch { class View { public: /// Constructs a view that refers to `no_batch`. + /// + /// \id no_batch constexpr View() = default; constexpr View(no_batch_t) {} /// Constructs a view that refers to an existing batch. + /// + /// \id batch constexpr View(const Batch& batch) : impl_(batch.impl_.get()) {} /// Returns `true` if this refers to a batch (as opposed to `no_batch`). @@ -113,6 +119,9 @@ class Batch { internal::IntrusivePtr impl_; }; +/// Alias for indicating not to use a batch. +/// +/// \relates Batch constexpr inline Batch::no_batch_t no_batch = Batch::no_batch_t{}; } // namespace tensorstore diff --git a/tensorstore/box.h b/tensorstore/box.h index b3af8d5e..3b0aa523 100644 --- a/tensorstore/box.h +++ b/tensorstore/box.h @@ -96,7 +96,7 @@ constexpr inline bool IsMutableBoxLike = /// type with `Box::static_rank` implicitly convertible to `Rank`. /// /// \relates Box -template +template constexpr inline bool IsBoxLikeImplicitlyConvertibleToRank = false; template @@ -108,7 +108,7 @@ constexpr inline bool IsBoxLikeImplicitlyConvertibleToRank< /// type with `Box::static_rank` explicitly convertible to `Rank`. /// /// \relates Box -template +template constexpr inline bool IsBoxLikeExplicitlyConvertibleToRank = false; template @@ -439,8 +439,8 @@ Box(const Index (&shape)[Rank]) -> Box; template && IsIndexConvertibleVector)>* = nullptr> -Box(const Origin& origin, const Shape& shape) - -> Box::value>; +Box(const Origin& origin, + const Shape& shape) -> Box::value>; template Box(const Index (&origin)[Rank], const Index (&shape)[Rank]) -> Box; @@ -557,12 +557,11 @@ class BoxView : public internal_box::BoxViewStorage { /// \requires If `Mutable == true`, `BoxType` must be a mutable Box-like type /// (such as a non-const `Box` reference or a `MutableBoxView`). /// \id convert - template < - typename BoxType, - typename = std::enable_if_t< - (IsBoxLike && - (!Mutable || IsMutableBoxLike)&&RankConstraint::Implies( - absl::remove_cvref_t::static_rank, Rank))>> + template && (!Mutable || IsMutableBoxLike) && + RankConstraint::Implies( + absl::remove_cvref_t::static_rank, Rank))>> // NONITPICK: std::remove_cvref_t::static_rank BoxView(BoxType&& other) : BoxView(other.rank(), other.origin().data(), other.shape().data()) {} @@ -587,7 +586,7 @@ class BoxView : public internal_box::BoxViewStorage { typename BoxType, std::enable_if_t< (IsBoxLike> && - (!Mutable || IsMutableBoxLike>)&& + (!Mutable || IsMutableBoxLike>) && RankConstraint::Implies(absl::remove_cvref_t::static_rank, Rank))>* = nullptr> @@ -704,8 +703,8 @@ BoxView(Origin&& origin, Shape&& shape) (IsMutableIndexVector && IsMutableIndexVector)>; template -BoxView(const Index (&origin)[Rank], const Index (&shape)[Rank]) - -> BoxView; +BoxView(const Index (&origin)[Rank], + const Index (&shape)[Rank]) -> BoxView; template struct StaticCastTraits> @@ -897,10 +896,12 @@ std::enable_if_t, bool> ContainsPartial( /// Returns a view of the sub-box corresponding to the specified dimension /// range. /// -/// \params box The existing box from which to extract the sub-box. -/// \param begin Inclusive start dimension of the sub-box. -/// \param end Exclusive end dimension of the sub-box. The default value of -/// `-1` is treated the same as `box.rank()`. +/// \param box The existing box from which to extract the sub-box. +/// \param begin Inclusive start dimension of the sub-box. +/// \param end Exclusive end dimension of the sub-box. +/// The default value of ``-1`` is treated the same as `box.rank()`. +/// +/// \relates Box template std::enable_if_t, BoxView>> diff --git a/tensorstore/cast.h b/tensorstore/cast.h index 9d00a892..508dd674 100644 --- a/tensorstore/cast.h +++ b/tensorstore/cast.h @@ -61,6 +61,7 @@ namespace tensorstore { /// \error `absl::StatusCode::kInvalidArgument` if neither reading nor writing /// would be supported by the returned `TensorStore`. /// \relates TensorStore +/// \id TensorStore template Result store, DataType target_dtype) { /// \error `absl::StatusCode::kInvalidArgument` if the conversion is not /// supported. /// \relates Spec +/// \id Spec Result Cast(const Spec& base_spec, DataType target_dtype); } // namespace tensorstore diff --git a/tensorstore/data_type.h b/tensorstore/data_type.h index f8be9fac..7fb63286 100644 --- a/tensorstore/data_type.h +++ b/tensorstore/data_type.h @@ -466,6 +466,8 @@ inline constexpr DataTypeConversionFlags operator&(DataTypeConversionFlags a, } /// Specifies an equality comparison method. +/// +/// \relates DataType enum class EqualityComparisonKind { /// Compare using regular equality (``operator==``). For floating point /// types, this considers positive and negative zero equal, and NaN unequal to @@ -476,7 +478,7 @@ enum class EqualityComparisonKind { /// /// For integer and floating point types, this performs a bitwise comparison. /// - /// For integer types this is equivalent to `kCompareEqual`. + /// For integer types this is equivalent to `equal`. identical, }; @@ -1551,6 +1553,7 @@ constexpr DataType kDataTypes[] = { /// /// \relates ElementPointer template +// NONITPICK: std::pointer_traits>::element_type using pointee_dtype_t = dtype_t< typename std::pointer_traits>::element_type>; diff --git a/tensorstore/index_space/dim_expression.h b/tensorstore/index_space/dim_expression.h index 7efc0670..04c2c3db 100644 --- a/tensorstore/index_space/dim_expression.h +++ b/tensorstore/index_space/dim_expression.h @@ -148,42 +148,44 @@ class DimExpression { // with compatible static ranks, that are compatible with the static // selection rank. template