Read variable-length data from 1-D array dataset. More...
#include <ReadHDF5VarLen.hpp>
Collaboration diagram for moab::ReadHDF5VarLen:Public Member Functions | |
| ReadHDF5VarLen (DebugOutput &debug_output, void *buffer, size_t buffer_size) | |
| Constructor. More... | |
| virtual | ~ReadHDF5VarLen () |
| ErrorCode | read_data (ReadHDF5Dataset &data_set, const Range &offsets, EntityHandle start_offset, hid_t data_type, const Range &file_ids, const std::vector< unsigned > &vals_per_ent, const Range &ranged_file_ids) |
| Do actual read of data set. More... | |
| ErrorCode | read_offsets (ReadHDF5Dataset &data_set, const Range &file_ids, EntityHandle start_file_id, EntityHandle nudge, Range &offsets_out, std::vector< unsigned > &counts_out) |
| Read set description table or offset vector for var-len tags or old-format poly(gon|hedra) connectivity. More... | |
| ErrorCode | read (ReadHDF5Dataset &offset_data, ReadHDF5Dataset &value_data, const Range &file_ids, EntityHandle start_file_id, hid_t data_type, const Range *ranged=0) |
Protected Member Functions | |
| virtual ErrorCode | store_data (EntityHandle file_id, void *data, long num_data, bool ranged)=0 |
| Store data list for a single entity. More... | |
Protected Attributes | |
| DebugOutput & | dbgOut |
Static Private Member Functions | |
| static bool | is_ranged (EntityHandle file_id, Range::const_iterator &ranged_iter, Range::const_iterator ranged_end) |
| Test if passed file_id is value pointed to by ranged_iter, and if so, incremenet ranged_iter. More... | |
Private Attributes | |
| void *const | dataBuffer |
| const size_t | bufferSize |
Read variable-length data from 1-D array dataset.
Utility class for reading variable-length data from an HDF5 dataset. Used for reading set contents, set parents, set children, polygon and polyhedron connectivity, and variable-length tag data.
This is an abstract class. The pure virtual store_data method must be implemented to create a concrete instance.
Definition at line 32 of file ReadHDF5VarLen.hpp.
|
inline |
Constructor.
| buffer | A temporary buffer to use during read |
| buffer_size | Size of buffer, in bytes. |
Definition at line 68 of file ReadHDF5VarLen.hpp.
|
inlinevirtual |
Definition at line 73 of file ReadHDF5VarLen.hpp.
|
staticprivate |
Test if passed file_id is value pointed to by ranged_iter, and if so, incremenet ranged_iter.
Definition at line 14 of file ReadHDF5VarLen.cpp.
Referenced by read_data().
|
inline |
Definition at line 135 of file ReadHDF5VarLen.hpp.
References ErrorCode, MB_SUCCESS, read_data(), and read_offsets().
| ErrorCode moab::ReadHDF5VarLen::read_data | ( | ReadHDF5Dataset & | data_set, |
| const Range & | offsets, | ||
| EntityHandle | start_offset, | ||
| hid_t | data_type, | ||
| const Range & | file_ids, | ||
| const std::vector< unsigned > & | vals_per_ent, | ||
| const Range & | ranged_file_ids | ||
| ) |
Do actual read of data set.
| data_set | The data set to read. |
| file_ids | The file ids of the entities to read. |
| start_file_id | The file id corresponding to the first row of the dataset |
| data_type | The desired, in-memory data type for values |
| vals_per_ent | The number of values for each entity |
| ranged_file_ids | Those file ids for which the 'ranged' argument to storedata should be passed as true. |
Definition at line 27 of file ReadHDF5VarLen.cpp.
References moab::Range::begin(), bufferSize, dataBuffer, dbgOut, moab::ReadHDF5Dataset::done(), moab::Range::end(), ErrorCode, moab::ReadHDF5Dataset::get_debug_desc(), moab::ReadHDF5Dataset::get_read_count(), is_ranged(), MB_SUCCESS, moab::DebugOutput::printf(), moab::ReadHDF5Dataset::read(), moab::ReadHDF5Dataset::set_file_ids(), moab::Range::size(), and store_data().
Referenced by read().
| ErrorCode moab::ReadHDF5VarLen::read_offsets | ( | ReadHDF5Dataset & | data_set, |
| const Range & | file_ids, | ||
| EntityHandle | start_file_id, | ||
| EntityHandle | nudge, | ||
| Range & | offsets_out, | ||
| std::vector< unsigned > & | counts_out | ||
| ) |
Read set description table or offset vector for var-len tags or old-format poly(gon|hedra) connectivity.
| data_set | The data set to read. |
| file_ids | The file ids of the entities to read. |
| start_file_id | The file id corresponding to the first row of the dataset |
| num_columns | The number of columns of offsets in the dataset |
| indices | Array of length num_columns contaning the indices of the columns to read. |
| nudge | Amount by which to offset values in offset_out to avoid putting zeros in Range. Must be greater than 0. Probably 1. |
| offsets_out | An array of length num_columns which will be populated with the resulting list of offsets into the contents list calculated from reading the offsets from the passed data set. |
| counts_out | An array of length num_columns of std::vectors, where each vector will be filled with one value per file ID indicating the length of the data for the corresponding file ID. |
| ranged_file_ids | If non-null, the last column of the table will be read and tested for the ranged bit. For all file_ids for which the range bit is set, the file ID will be added to this list. |
Definition at line 291 of file ReadHDF5VarLen.cpp.
References moab::Range::begin(), buffer, bufferSize, moab::Range::clear(), moab::Range::const_pair_begin(), moab::Range::const_pair_end(), dataBuffer, dbgOut, moab::ReadHDF5Dataset::done(), moab::Range::empty(), moab::Range::end(), moab::Range::front(), moab::ReadHDF5Dataset::get_debug_desc(), moab::ReadHDF5Dataset::get_read_count(), moab::Range::insert(), MB_SUCCESS, moab::DebugOutput::printf(), moab::ReadHDF5Dataset::read(), moab::ReadHDF5Dataset::set_file_ids(), moab::Range::size(), and moab::Range::const_iterator::start_of_block().
Referenced by read().
|
protectedpure virtual |
Store data list for a single entity.
The is the pure virtual method that must be provided. It is responsible for storing the data read for a single entity.
This function will always be called in the order of the file_ids in the range passed to the read method.
| file_id | The file ID for the entity |
| data | A pointer to the data for the entity |
| num_data | Number of values for the entity |
| ranged | For set contents, true if in ranged format. |
Referenced by read_data().
|
private |
Definition at line 39 of file ReadHDF5VarLen.hpp.
Referenced by read_data(), and read_offsets().
|
private |
Definition at line 38 of file ReadHDF5VarLen.hpp.
Referenced by read_data(), and read_offsets().
|
protected |
Definition at line 35 of file ReadHDF5VarLen.hpp.
Referenced by read_data(), and read_offsets().