#include "tensorstore/virtual_chunked.h"
template <typename Element = void,
          DimensionIndex Rank = dynamic_rank,
          typename ReadFunc>
  
requires virtual_chunked::IsReadFunction<ReadFunc, Element, Rank>
Result<TensorStore<Element, Rank, ReadWriteMode::read>>
tensorstore::VirtualChunked(ReadFunc read_function,
                            
virtual_chunked::OpenOptions&& options);
template <typename Element = void,
          DimensionIndex Rank = dynamic_rank,
          typename ReadFunc,
          typename... Option>
  
requires virtual_chunked::IsReadFunction<ReadFunc, Element, Rank> &&
           IsCompatibleOptionSequence<virtual_chunked::OpenOptions,
                                      Option...>
Result<TensorStore<Element, Rank, ReadWriteMode::read>>
tensorstore::VirtualChunked(ReadFunc read_function,
                            
Option&&... option);

Creates a read-only TensorStore where the content is read chunk-wise by the specified user-defined function.

Parameters:
ReadFunc read_function

Function called to read each chunk. Must be callable with (Array<Element, Rank, offset_origin>, virtual_chunked::ReadParameters) and have a return value convertible to Future<TimestampedStorageGeneration>. By default must be serializable. To specify a non-serializable function, wrap it in NonSerializable.

virtual_chunked::OpenOptions &&options

Open options. The domain must always be specified (either via an IndexDomain or tensorstore::Schema::Shape). If Element is void, the data type must also be specified.

Option&&... option

Option compatible with virtual_chunked::OpenOptions, which may be specified in any order.