libzarr
Header-only C++17 Zarr v2/v3, WASM-compatible
Loading...
Searching...
No Matches
Static Public Member Functions | Public Attributes | Friends | List of all members
zarr::DataType Struct Reference

A concrete element type: kind plus size (the size only varies for raw). More...

#include <types.hpp>

Static Public Member Functions

static constexpr DataType of (DType kind)
 
static constexpr DataType raw_bytes (std::uint32_t size)
 A raw byte-string type of size bytes (v2 |V<size>).
 

Public Attributes

DType kind = DType::uint8
 Element type kind.
 
std::uint32_t itemsize = 1
 Element size in bytes.
 

Friends

constexpr bool operator== (DataType a, DataType b)
 Equal kind and size.
 
constexpr bool operator!= (DataType a, DataType b)
 Differing kind or size.
 

Detailed Description

A concrete element type: kind plus size (the size only varies for raw).

Member Function Documentation

◆ of()

static constexpr DataType zarr::DataType::of ( DType  kind)
inlinestaticconstexpr

A DataType of fixed-size kind (anything but raw). DType::raw has no fixed size and must be built with raw_bytes(); passing it throws rather than asserting, because the kind can originate from parsed metadata.


The documentation for this struct was generated from the following file: