// Copyright 2021 The TensorStore Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package tensorstore.proto;

message Array {
  optional string dtype = 1;
  repeated int64 shape = 2 [packed = true];
  repeated int64 origin = 3 [packed = true];
  optional int32 zero_byte_strides_bitset = 5;

  /// The following fields are logically a oneof, however protobuf does not
  /// allow repeeated fields in a oneof.
  repeated double double_data = 10 [packed = true];
  repeated float float_data = 11 [packed = true];
  repeated int64 int_data = 12 [packed = true];    // int16_t .. int64_t
  repeated uint64 uint_data = 13 [packed = true];  // uint16_t .. uint64_t

  /// When the above array types don't suffice, fall back to the serialization
  /// mechanism and store the value in void_data.
  optional bytes void_data = 18;
}
