MCPcopy Create free account
hub / github.com/Kitware/VTK / CreateUnlimitedSimpleDataspace

Method CreateUnlimitedSimpleDataspace

IO/HDF/vtkHDFWriterImplementation.cxx:341–361  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

339
340//------------------------------------------------------------------------------
341vtkHDF::ScopedH5SHandle vtkHDFWriter::Implementation::CreateUnlimitedSimpleDataspace(
342 hsize_t numCols)
343{
344 int numDims = (numCols == 1) ? 1 : 2;
345 std::vector<hsize_t> dims{ 0 };
346 std::vector<hsize_t> max_dims{ H5S_UNLIMITED };
347
348 if (numDims == 2)
349 {
350 dims.emplace_back(numCols);
351 // as the number of cols cannot change, ensure to block it to the initial number of column
352 max_dims.emplace_back(numCols);
353 }
354
355 vtkHDF::ScopedH5SHandle dataspace{ H5Screate_simple(numDims, dims.data(), max_dims.data()) };
356 if (dataspace == H5I_INVALID_HID)
357 {
358 return H5I_INVALID_HID;
359 }
360 return dataspace;
361}
362
363//------------------------------------------------------------------------------
364vtkHDF::ScopedH5GHandle vtkHDFWriter::Implementation::CreateHdfGroup(hid_t group, const char* name)

Callers 1

InitDynamicDatasetMethod · 0.95

Calls 2

emplace_backMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected