-
#include "tensorstore/codec_spec.h" - class tensorstore::CodecSpec;
Specifies compression and other encoding/decoding parameters for a TensorStore driver.
This allows compression options to be specified as part of a
Schemaindependent of other driver parameters and metadata.Since compression parameters are highly driver-specific, a
CodecSpecis always associated with a particular driver.Types¶
- using ToJsonOptions = JsonSerializationOptions;
- using FromJsonOptions = JsonSerializationOptions;
JSON serialization options.
Constructors¶
- CodecSpec();
Constructs a null codec spec.
Methods¶
- bool valid() const;
Returns
trueif not null.
-
Result<::nlohmann::json>
ToJson(const ToJsonOptions& options = ToJsonOptions{}) const; Converts to a JSON representation.
-
static Result<CodecSpec>
FromJson(::nlohmann::json j,
const FromJsonOptions& options = FromJsonOptions{}); Parses from a JSON representation.
Conversion operators¶
- explicit operator ::nlohmann::json() const;
Converts to a JSON representation.
Friend functions¶
- friend bool operator==(const CodecSpec& a, const CodecSpec& b);
- friend bool operator!=(const CodecSpec& a, const CodecSpec& b);
Compares two codec specs for equality by value.
- friend void AbslStringify(Sink& sink, const CodecSpec& codec);