* Creates a TileDB Subarray object. * * **Example:** * * @code{.cpp} * // Open the array for writing * tiledb::Context ctx; * tiledb::Array array(ctx, "my_array", TILEDB_WRITE); * tiledb::Subarray subarray(ctx, array); * @endcode * * @param ctx TileDB context * @param array Open Array object * @param coalesce_ranges When enabled, ranges will attempt to coales
| 105 | * with existing ranges as they are added. |
| 106 | */ |
| 107 | Subarray( |
| 108 | const tiledb::Context& ctx, |
| 109 | const tiledb::Array& array, |
| 110 | bool coalesce_ranges = true) |
| 111 | : ctx_(ctx) |
| 112 | , array_(array) |
| 113 | , schema_(array.schema()) { |
| 114 | tiledb_subarray_t* capi_subarray; |
| 115 | ctx.handle_error(tiledb_subarray_alloc( |
| 116 | ctx.ptr().get(), array.ptr().get(), &capi_subarray)); |
| 117 | tiledb_subarray_set_coalesce_ranges( |
| 118 | ctx.ptr().get(), capi_subarray, coalesce_ranges); |
| 119 | subarray_ = std::shared_ptr<tiledb_subarray_t>(capi_subarray, deleter_); |
| 120 | } |
| 121 | |
| 122 | /** Set the coalesce_ranges flag for the subarray. */ |
| 123 | Subarray& set_coalesce_ranges(bool coalesce_ranges) { |
nothing calls this directly
no test coverage detected