#include "tensorstore/tensorstore.h"
template <typename SourceTensorstore, typename TargetArray>
  
requires CanReadTensorstoreToArray<
      
UnwrapResultType<SourceTensorstore>,
     
 UnwrapResultType<TargetArray>>
Future<void> tensorstore::Read(SourceTensorstore&source,
                               
TargetArray&target,
                               
ReadOptions options);
template <typename SourceTensorstore,
         
 typename TargetArray,
         
 typename... Option>
  
requires IsCompatibleOptionSequence<ReadOptions, Option...> &&
          
 CanReadTensorstoreToArray<
               
UnwrapResultType<SourceTensorstore>,
              
 UnwrapResultType<TargetArray>>
Future<void> tensorstore::Read(SourceTensorstore&source,
                               
TargetArray&target,
                               
Option&&... option);

Copies from source TensorStore to target array.

The domain of source is resolved via ResolveBounds and then aligned/broadcast to the domain of target via AlignDomainTo.

The target array must be a SharedArray; it must remain valid until the Future has completed. If an error occurs while reading, the target array may be left in a partially-written state.

Options compatible with ReadOptions are specified in any order after target. The meaning of each option is determined by its type.

Supported option types are:

Example:

TensorReader<int32_t, 3> store = ...;
auto array = AllocateArray<int32_t>({25, 30});
Read(store | AllDims().TranslateSizedInterval({100, 200},
                                              {25, 30})),
     array).value();
Parameters:
SourceTensorstore &&source

Source TensorStore object that supports reading. May be Result-wrapped.

TargetArray &&target

Array or TransformedArray with a non-const element type. May be Result-wrapped. This array must remain valid until the returned future becomes ready.

ReadOptions options

Any option compatible with ReadOptions.

Returns:

A future that becomes ready when the read has completed successfully or has failed.

struct tensorstore::ReadProgress;

Specifies progress statistics for Read operations.

struct tensorstore::ReadOptions;

Options for tensorstore::Read into an existing target array.

constexpr bool tensorstore::CanReadTensorstoreToArray<Source, Dest>;

Evaluates whether the constraints required for tensorstore::Read are satisfied.