#include "tensorstore/open_mode.h"
enum class tensorstore::OpenMode;

Specifies the mode to use when opening a TensorStore.

enumerator unknown = 0;

Open mode is not known.

enumerator open = 1;

Open an existing TensorStore. Unless create is also specified, a non-existent TensorStore will result in an error.

enumerator create = 2;

Create a new TensorStore. Unless open is also specified, an existing TensorStore will result in an error.

enumerator delete_existing = 4;

If the TensorStore already exists, delete it. This is only valid in conjunction with create.

enumerator open_or_create = open + create;

Open an existing TensorStore or create a new TensorStore if it does not exist.

enumerator assume_metadata = 8;

Neither read nor write stored metadata. Instead, just assume any necessary metadata based on constraints in the spec and any defaults used by TensorStore. This option requires care as it can lead to data corruption if the assumed metadata does not match the stored metadata, or multiple concurrent writers use different assumed metadata. The stored metadata need not even exist. Operations such as resizing that modify the stored metadata will fail with an error.

This option must be specified in conjunction with open, must not be specified in conjunction with delete_existing, and takes precedence over assume_cached_metadata.

enumerator assume_cached_metadata = 16;

Skip reading the metadata when opening. Instead, just assume any necessary metadata based on constraints in the spec, using the same defaults for any unspecified metadata as when creating a new TensorStore. The stored metadata may still be accessed by subsequent operations that need to re-validate or modify the metadata.

This option must be specified in conjunction with open and must not be specified in conjunction with delete_existing.

constexpr OpenMode tensorstore::operator&(OpenMode aOpenMode b);

Returns the intersection of two open modes.

constexpr OpenMode tensorstore::operator|(OpenMode aOpenMode b);

Returns the union of two open modes.

constexpr bool tensorstore::operator!(OpenMode a);

Checks if any open mode has been set.

constexpr OpenMode tensorstore::operator~(OpenMode a);

Returns the complement of a mode.

std::ostream&
tensorstore::operator<<(std::ostreamosOpenMode mode);

Prints a string representation the mode to an std::ostream.