#include "tensorstore/context.h"
enum class tensorstore::ContextBindingMode;

Specifies how context bindings should be handled for Spec-like types, such as tensorstore::kvstore::Spec and tensorstore::Spec.

This is an “option” type that can be used with TensorStore::spec, KvStore::spec, and related methods.

enumerator unspecified;

Context binding mode is unspecified.

enumerator retain;

Retain all bound context resources and unbound context resource specs.

enumerator unbind;

Any bound context resources are converted to context resource specs that fully capture the graph of shared context resources and interdependencies. Re-binding/re-opening the resultant spec will result in a new graph of new context resources that is isomorphic to the original graph of context resources. The resultant spec will not refer to any external context resources; consequently, binding it to any specific context will have the same effect as binding it to a default context.

enumerator strip;

Any bound context resources and unbound context resource specs are replaced by default context resource specs. If the resultant spec is re-opened with/re-bound to a new context, it will use the default context resources specified by that context.

constexpr const ContextBindingMode tensorstore::retain_context =
   
 ContextBindingMode::retain;
constexpr const ContextBindingMode tensorstore::unbind_context =
   
 ContextBindingMode::unbind;
constexpr const ContextBindingMode tensorstore::strip_context =
   
 ContextBindingMode::strip;