some missing query function implemented, see issue#1 in Gitlab

This commit is contained in:
2016-04-22 18:06:58 +02:00
parent 44ffea4fd5
commit 3d6230629c
8 changed files with 166 additions and 49 deletions
+55
View File
@@ -88,6 +88,9 @@ H5PartGetDatasetName (
\return \c H5_SUCCESS on success
\return \c H5_FAILURE on error
\see H5PartGetNumDatasets()
\see H5PartGetDatasetInfoByName()
*/
static inline h5_err_t
H5PartGetDatasetInfo (
@@ -110,6 +113,58 @@ H5PartGetDatasetInfo (
H5_API_RETURN (h5u_get_dataset_info (
f, idx, name, len_name, type, nelems));
}
/**
Determines whether a dataset with given name exists in current step.
\return true (value \c >0) if step exists
\return false (\c 0) if step does not exist
\return \c H5_FAILURE on error
*/
static inline h5_err_t
H5PartHasDataset (
const h5_file_t f, ///< [in] file handle
const char* const name ///< [in] name of dataset
) {
H5_API_ENTER (h5_int64_t,
"f=%p, name='%s'",
(h5_file_p)f, name);
H5_API_RETURN (h5u_has_dataset (f, name));
}
/**
Gets the type and number of elements of a dataset based on its
name in the current timestep.
Type is one of the following values:
- \c H5_FLOAT64_T (for \c h5_float64_t)
- \c H5_FLOAT32_T (for \c h5_float32_t)
- \c H5_INT64_T (for \c h5_int64_t)
- \c H5_INT32_T (for \c h5_int32_t)
\return \c H5_SUCCESS on success
\return \c H5_FAILURE on error
\see H5PartHasDataset()
\see H5PartGetDatasetInfo()
*/
static inline h5_err_t
H5PartGetDatasetInfoByName (
const h5_file_t f, ///< [in] file handle
const char* const name, ///< [in] name of dataset
h5_int64_t* type, ///< [out] type of data in dataset
h5_size_t* nelems ///< [out] number of elements
) {
H5_API_ENTER (h5_int64_t,
"f=%p, "
"name='%s', "
"type=%p, nelems=%p",
(h5_file_p)f,
name,
type, nelems);
H5_API_RETURN (h5u_get_dataset_info_by_name (
f, name, type, nelems));
}
/**
This function returns the number of particles in this processor's view,
+18
View File
@@ -235,6 +235,24 @@ H5GetAttachmentInfoByIdx (
f, idx, fname, len_fname, fsize));
}
/**
Query whether a particular attachment exists in the file.
\return true (value \c >0) if attachment exists
\return false (\c 0) if attachment does not exist
\return \c H5_FAILURE on error
*/
static inline h5_err_t
H5HasAttachment (
const h5_file_t f, ///< [in] file handle.
const char* const fname ///< [in] original file name.
) {
H5_API_ENTER (h5_err_t,
"f=%p, name='%s'",
(h5_file_p)f, fname);
H5_API_RETURN (h5_has_attachment (f, fname));
}
/**
Get size of attached file with name \c fname.
+8
View File
@@ -26,6 +26,14 @@ h5_err_t
h5_add_attachment (
const h5_file_t, const char* const);
h5_err_t
h5_has_attachments (
const h5_file_t);
h5_err_t
h5_has_attachment (
const h5_file_t, const char* const);
h5_ssize_t
h5_get_num_attachments (
const h5_file_t);
+11
View File
@@ -142,6 +142,17 @@ typedef struct h5_glb_idxlist {
h5_glb_idx_t items[1];
} h5_glb_idxlist_t;
enum h5_iterators {
step_iterator
};
struct h5_iterator;
typedef struct {
enum h5_iterators it_type;
h5_file_t file;
h5_int64_t (*iter)(struct h5_iterator*);
} h5_iterator_t;
struct h5_idxmap;
typedef struct h5_idxmap h5_idxmap_t;
+7 -1
View File
@@ -75,9 +75,15 @@ h5u_get_dataset_info (
const h5_id_t, char* const, const h5_size_t, h5_int64_t* const,
h5_size_t* const);
h5_err_t
h5u_has_dataset (
const h5_file_t fh,
const char* const name
);
h5_err_t
h5u_get_dataset_info_by_name (
const h5_file_p f,
const h5_file_t f,
const char* const dataset_name,
h5_int64_t* const type,
h5_size_t* const nelem