summaryrefslogtreecommitdiffstats
path: root/java/src/hdf/hdf5lib/H5.java
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2020-01-16 21:29:34 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2020-01-16 21:29:34 (GMT)
commita92c735c9b57049e8c4037d3490f7e10f8eef4d6 (patch)
tree74da25151de6d1e32329dfcd62e17c863e2e3de1 /java/src/hdf/hdf5lib/H5.java
parent024f7ba09250110c19b070c9699cfbc0f9dc2b96 (diff)
downloadhdf5-a92c735c9b57049e8c4037d3490f7e10f8eef4d6.zip
hdf5-a92c735c9b57049e8c4037d3490f7e10f8eef4d6.tar.gz
hdf5-a92c735c9b57049e8c4037d3490f7e10f8eef4d6.tar.bz2
Squashed commit of the token_refactoring branch:
Diffstat (limited to 'java/src/hdf/hdf5lib/H5.java')
-rw-r--r--java/src/hdf/hdf5lib/H5.java245
1 files changed, 203 insertions, 42 deletions
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java
index ba10f5e..5b704dd 100644
--- a/java/src/hdf/hdf5lib/H5.java
+++ b/java/src/hdf/hdf5lib/H5.java
@@ -24,10 +24,10 @@ import hdf.hdf5lib.callbacks.H5D_iterate_cb;
import hdf.hdf5lib.callbacks.H5D_iterate_t;
import hdf.hdf5lib.callbacks.H5E_walk_cb;
import hdf.hdf5lib.callbacks.H5E_walk_t;
-import hdf.hdf5lib.callbacks.H5L_iterate_cb;
import hdf.hdf5lib.callbacks.H5L_iterate_t;
-import hdf.hdf5lib.callbacks.H5O_iterate_cb;
+import hdf.hdf5lib.callbacks.H5L_iterate_opdata_t;
import hdf.hdf5lib.callbacks.H5O_iterate_t;
+import hdf.hdf5lib.callbacks.H5O_iterate_opdata_t;
import hdf.hdf5lib.callbacks.H5P_cls_close_func_cb;
import hdf.hdf5lib.callbacks.H5P_cls_close_func_t;
import hdf.hdf5lib.callbacks.H5P_cls_copy_func_cb;
@@ -55,6 +55,8 @@ import hdf.hdf5lib.structs.H5FD_ros3_fapl_t;
import hdf.hdf5lib.structs.H5G_info_t;
import hdf.hdf5lib.structs.H5L_info_t;
import hdf.hdf5lib.structs.H5O_info_t;
+import hdf.hdf5lib.structs.H5O_native_info_t;
+import hdf.hdf5lib.structs.H5O_token_t;
/**
* This class is the Java interface for the HDF5 library.
@@ -3577,8 +3579,8 @@ public class H5 implements java.io.Serializable {
* OUT: Names of all objects under the group, name.
* @param objTypes
* OUT: Types of all objects under the group, name.
- * @param objRef
- * OUT: Reference number of all objects under the group, name.
+ * @param tokens
+ * OUT: Object token of all objects under the group, name.
*
* @return the number of items found
*
@@ -3588,26 +3590,26 @@ public class H5 implements java.io.Serializable {
* - name is null.
*/
public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] objNames, int[] objTypes,
- long[] objRef) throws HDF5LibraryException, NullPointerException {
+ H5O_token_t[] tokens) throws HDF5LibraryException, NullPointerException {
if (objNames == null) {
throw new NullPointerException("H5Gget_obj_info_all(): name array is null");
}
- return H5Gget_obj_info_all(loc_id, name, objNames, objTypes, null, null, objRef, HDF5Constants.H5_INDEX_NAME);
+ return H5Gget_obj_info_all(loc_id, name, objNames, objTypes, null, null, tokens, HDF5Constants.H5_INDEX_NAME);
}
public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] oname, int[] otype,
- int[] ltype, long[] ref, int indx_type) throws HDF5LibraryException, NullPointerException {
- return H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, null, ref, indx_type, -1);
+ int[] ltype, H5O_token_t[] tokens, int indx_type) throws HDF5LibraryException, NullPointerException {
+ return H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, null, tokens, indx_type, -1);
}
public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] oname, int[] otype,
- int[] ltype, long[] fno, long[] ref, int indx_type) throws HDF5LibraryException, NullPointerException {
- return H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, fno, ref, oname.length, indx_type, -1);
+ int[] ltype, long[] fno, H5O_token_t[] tokens, int indx_type) throws HDF5LibraryException, NullPointerException {
+ return H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, fno, tokens, oname.length, indx_type, -1);
}
public synchronized static int H5Gget_obj_info_full(long loc_id, String name, String[] oname, int[] otype,
- int[] ltype, long[] fno, long[] ref, int indx_type, int indx_order) throws HDF5LibraryException,
+ int[] ltype, long[] fno, H5O_token_t[] tokens, int indx_type, int indx_order) throws HDF5LibraryException,
NullPointerException {
if (oname == null) {
throw new NullPointerException("H5Gget_obj_info_full(): name array is null");
@@ -3629,7 +3631,7 @@ public class H5 implements java.io.Serializable {
ltype = new int[otype.length];
if (fno == null)
- fno = new long[ref.length];
+ fno = new long[tokens.length];
if (indx_type < 0)
indx_type = HDF5Constants.H5_INDEX_NAME;
@@ -3638,7 +3640,7 @@ public class H5 implements java.io.Serializable {
indx_order = HDF5Constants.H5_ITER_INC;
log.trace("H5Gget_obj_info_full: oname_len={}", oname.length);
- int status = H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, fno, ref, oname.length, indx_type,
+ int status = H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, fno, tokens, oname.length, indx_type,
indx_order);
for (int indx = 0; indx < oname.length; indx++)
log.trace("H5Gget_obj_info_full: oname={}", oname[indx]);
@@ -3646,7 +3648,7 @@ public class H5 implements java.io.Serializable {
}
private synchronized static native int H5Gget_obj_info_full(long loc_id, String name, String[] oname, int[] otype,
- int[] ltype, long[] fno, long[] ref, int n, int indx_type, int indx_order) throws HDF5LibraryException,
+ int[] ltype, long[] fno, H5O_token_t[] tokens, int n, int indx_type, int indx_order) throws HDF5LibraryException,
NullPointerException;
/**
@@ -3701,8 +3703,8 @@ public class H5 implements java.io.Serializable {
* OUT: Types of all objects under the group, name.
* @param lnkTypes
* OUT: Types of all links under the group, name.
- * @param objRef
- * OUT: Reference number of all objects under the group, name.
+ * @param objToken
+ * OUT: Object token of all objects under the group, name.
* @param objMax
* IN: Maximum number of all objects under the group, name.
*
@@ -3714,7 +3716,7 @@ public class H5 implements java.io.Serializable {
* - name is null.
*/
public synchronized static int H5Gget_obj_info_max(long loc_id, String[] objNames, int[] objTypes, int[] lnkTypes,
- long[] objRef, long objMax) throws HDF5LibraryException, NullPointerException {
+ H5O_token_t[] objToken, long objMax) throws HDF5LibraryException, NullPointerException {
if (objNames == null) {
throw new NullPointerException("H5Gget_obj_info_max(): name array is null");
}
@@ -3739,11 +3741,11 @@ public class H5 implements java.io.Serializable {
throw new HDF5LibraryException("H5Gget_obj_info_max(): name and type array sizes are different");
}
- return H5Gget_obj_info_max(loc_id, objNames, objTypes, lnkTypes, objRef, objMax, objNames.length);
+ return H5Gget_obj_info_max(loc_id, objNames, objTypes, lnkTypes, objToken, objMax, objNames.length);
}
private synchronized static native int H5Gget_obj_info_max(long loc_id, String[] oname, int[] otype, int[] ltype,
- long[] ref, long amax, int n) throws HDF5LibraryException, NullPointerException;
+ H5O_token_t[] tokens, long amax, int n) throws HDF5LibraryException, NullPointerException;
/**
* H5Gn_members report the number of objects in a Group. The 'objects' include everything that will be visited by
@@ -4340,8 +4342,8 @@ public class H5 implements java.io.Serializable {
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
**/
- public synchronized static native int H5Literate(long grp_id, int idx_type, int order, long idx, H5L_iterate_cb op,
- H5L_iterate_t op_data) throws HDF5LibraryException;
+ public synchronized static native int H5Literate(long grp_id, int idx_type, int order, long idx, H5L_iterate_t op,
+ H5L_iterate_opdata_t op_data) throws HDF5LibraryException;
/**
* H5Literate_by_name iterates through links in a group.
@@ -4372,7 +4374,7 @@ public class H5 implements java.io.Serializable {
* - group_name is null.
**/
public synchronized static native int H5Literate_by_name(long grp_id, String group_name, int idx_type, int order,
- long idx, H5L_iterate_cb op, H5L_iterate_t op_data, long lapl_id) throws HDF5LibraryException,
+ long idx, H5L_iterate_t op, H5L_iterate_opdata_t op_data, long lapl_id) throws HDF5LibraryException,
NullPointerException;
/**
@@ -4419,8 +4421,8 @@ public class H5 implements java.io.Serializable {
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
**/
- public synchronized static native int H5Lvisit(long grp_id, int idx_type, int order, H5L_iterate_cb op,
- H5L_iterate_t op_data) throws HDF5LibraryException;
+ public synchronized static native int H5Lvisit(long grp_id, int idx_type, int order, H5L_iterate_t op,
+ H5L_iterate_opdata_t op_data) throws HDF5LibraryException;
/**
* H5Lvisit_by_name recursively visits all links starting from a specified group.
@@ -4449,7 +4451,7 @@ public class H5 implements java.io.Serializable {
* - group_name is null.
**/
public synchronized static native int H5Lvisit_by_name(long loc_id, String group_name, int idx_type, int order,
- H5L_iterate_cb op, H5L_iterate_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException;
+ H5L_iterate_t op, H5L_iterate_opdata_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException;
/**
@@ -4666,6 +4668,52 @@ public class H5 implements java.io.Serializable {
NullPointerException;
/**
+ * H5Oget_info_by_name retrieves the metadata for an object, identifying the object by location and relative name.
+ *
+ * @param loc_id
+ * IN: File or group identifier specifying location of group in which object is located
+ * @param name
+ * IN: Relative name of group
+ * @param lapl_id
+ * IN: Access property list identifier for the link pointing to the object (Not currently used; pass as
+ * H5P_DEFAULT.)
+ *
+ * @return object information
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ **/
+ public static H5O_info_t H5Oget_info_by_name(long loc_id, String name, long lapl_id)
+ throws HDF5LibraryException, NullPointerException {
+ return H5Oget_info_by_name(loc_id, name, HDF5Constants.H5O_INFO_ALL, lapl_id);
+ }
+
+ /**
+ * H5Oget_info_by_name retrieves the metadata for an object, identifying the object by location and relative name.
+ *
+ * @param loc_id
+ * IN: File or group identifier specifying location of group in which object is located
+ * @param name
+ * IN: Relative name of group
+ * @param fields
+ * IN: Object fields to select
+ * @param lapl_id
+ * IN: Access property list identifier for the link pointing to the object (Not currently used; pass as
+ * H5P_DEFAULT.)
+ *
+ * @return object information
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ **/
+ public synchronized static native H5O_info_t H5Oget_info_by_name(long loc_id, String name, int fields, long lapl_id)
+ throws HDF5LibraryException, NullPointerException;
+
+ /**
* H5Oget_info_by_idx retrieves the metadata for an object, identifying the object by an index position.
*
* @param loc_id
@@ -4724,7 +4772,47 @@ public class H5 implements java.io.Serializable {
int order, long n, int fields, long lapl_id) throws HDF5LibraryException, NullPointerException;
/**
- * H5Oget_info_by_name retrieves the metadata for an object, identifying the object by location and relative name.
+ * H5Oget_native_info retrieves the native HDF5-specific metadata for an HDF5 object specified by an identifier.
+ * Native HDF5-specific metadata includes things like object header information and object storage layout information.
+ *
+ * @param loc_id
+ * IN: Identifier for target object
+ *
+ * @return object information
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ **/
+ public static H5O_native_info_t H5Oget_native_info(long loc_id) throws HDF5LibraryException,
+ NullPointerException {
+ return H5Oget_native_info(loc_id, HDF5Constants.H5O_NATIVE_INFO_ALL);
+ }
+
+ /**
+ * H5Oget_native_info retrieves the native HDF5-specific metadata for an HDF5 object specified by an identifier.
+ * Native HDF5-specific metadata includes things like object header information and object storage layout information.
+ *
+ * @param loc_id
+ * IN: Identifier for target object
+ * @param fields
+ * IN: Object fields to select
+ *
+ * @return object information
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ **/
+ public synchronized static native H5O_native_info_t H5Oget_native_info(long loc_id, int fields) throws HDF5LibraryException,
+ NullPointerException;
+
+ /**
+ * H5Oget_native_info_by_name retrieves the native HDF5-specific metadata for an HDF5 object, identifying the object
+ * by location and relative name. Native HDF5-specific metadata includes things like object header information and
+ * object storage layout information.
*
* @param loc_id
* IN: File or group identifier specifying location of group in which object is located
@@ -4741,13 +4829,15 @@ public class H5 implements java.io.Serializable {
* @exception NullPointerException
* - name is null.
**/
- public static H5O_info_t H5Oget_info_by_name(long loc_id, String name, long lapl_id)
+ public static H5O_native_info_t H5Oget_native_info_by_name(long loc_id, String name, long lapl_id)
throws HDF5LibraryException, NullPointerException {
- return H5Oget_info_by_name(loc_id, name, HDF5Constants.H5O_INFO_ALL, lapl_id);
+ return H5Oget_native_info_by_name(loc_id, name, HDF5Constants.H5O_NATIVE_INFO_ALL, lapl_id);
}
/**
- * H5Oget_info_by_name retrieves the metadata for an object, identifying the object by location and relative name.
+ * H5Oget_native_info_by_name retrieves the native HDF5-specific metadata for an HDF5 object, identifying the object
+ * by location and relative name. Native HDF5-specific metadata includes things like object header information and
+ * object storage layout information.
*
* @param loc_id
* IN: File or group identifier specifying location of group in which object is located
@@ -4766,10 +4856,72 @@ public class H5 implements java.io.Serializable {
* @exception NullPointerException
* - name is null.
**/
- public synchronized static native H5O_info_t H5Oget_info_by_name(long loc_id, String name, int fields, long lapl_id)
+ public synchronized static native H5O_native_info_t H5Oget_native_info_by_name(long loc_id, String name, int fields, long lapl_id)
throws HDF5LibraryException, NullPointerException;
/**
+ * H5Oget_native_info_by_idx retrieves the native HDF5-specific metadata for an HDF5 object, identifying the object
+ * by an index position. Native HDF5-specific metadata includes things like object header information and
+ * object storage layout information.
+ *
+ * @param loc_id
+ * IN: File or group identifier
+ * @param group_name
+ * IN: Name of group, relative to loc_id, in which object is located
+ * @param idx_type
+ * IN: Type of index by which objects are ordered
+ * @param order
+ * IN: Order of iteration within index
+ * @param n
+ * IN: Object to open
+ * @param lapl_id
+ * IN: Access property list identifier for the link pointing to the object (Not currently used; pass as
+ * H5P_DEFAULT.)
+ *
+ * @return object information
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ **/
+ public static H5O_native_info_t H5Oget_native_info_by_idx(long loc_id, String group_name, int idx_type,
+ int order, long n, long lapl_id) throws HDF5LibraryException, NullPointerException {
+ return H5Oget_native_info_by_idx(loc_id, group_name, idx_type, order, n, HDF5Constants.H5O_NATIVE_INFO_ALL, lapl_id);
+ }
+
+ /**
+ * H5Oget_native_info_by_idx retrieves the native HDF5-specific metadata for an HDF5 object, identifying the object
+ * by an index position. Native HDF5-specific metadata includes things like object header information and
+ * object storage layout information.
+ *
+ * @param loc_id
+ * IN: File or group identifier
+ * @param group_name
+ * IN: Name of group, relative to loc_id, in which object is located
+ * @param idx_type
+ * IN: Type of index by which objects are ordered
+ * @param order
+ * IN: Order of iteration within index
+ * @param n
+ * IN: Object to open
+ * @param fields
+ * IN: Object fields to select
+ * @param lapl_id
+ * IN: Access property list identifier for the link pointing to the object (Not currently used; pass as
+ * H5P_DEFAULT.)
+ *
+ * @return object information
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ **/
+ public synchronized static native H5O_native_info_t H5Oget_native_info_by_idx(long loc_id, String group_name, int idx_type,
+ int order, long n, int fields, long lapl_id) throws HDF5LibraryException, NullPointerException;
+
+ /**
* H5Olink creates a new hard link to an object in an HDF5 file.
*
* @param obj_id
@@ -4843,7 +4995,7 @@ public class H5 implements java.io.Serializable {
* @exception NullPointerException
* - name is null.
**/
- public static int H5Ovisit(long obj_id, int idx_type, int order, H5O_iterate_cb op, H5O_iterate_t op_data)
+ public static int H5Ovisit(long obj_id, int idx_type, int order, H5O_iterate_t op, H5O_iterate_opdata_t op_data)
throws HDF5LibraryException, NullPointerException {
return H5Ovisit(obj_id, idx_type, order, op, op_data, HDF5Constants.H5O_INFO_ALL);
}
@@ -4872,8 +5024,8 @@ public class H5 implements java.io.Serializable {
* @exception NullPointerException
* - name is null.
**/
- public synchronized static native int H5Ovisit(long obj_id, int idx_type, int order, H5O_iterate_cb op,
- H5O_iterate_t op_data, int fields) throws HDF5LibraryException, NullPointerException;
+ public synchronized static native int H5Ovisit(long obj_id, int idx_type, int order, H5O_iterate_t op,
+ H5O_iterate_opdata_t op_data, int fields) throws HDF5LibraryException, NullPointerException;
/**
* H5Ovisit_by_name recursively visits all objects starting from a specified object.
@@ -4902,7 +5054,7 @@ public class H5 implements java.io.Serializable {
* - name is null.
**/
public static int H5Ovisit_by_name(long loc_id, String obj_name, int idx_type, int order,
- H5O_iterate_cb op, H5O_iterate_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException {
+ H5O_iterate_t op, H5O_iterate_opdata_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException {
return H5Ovisit_by_name(loc_id, obj_name, idx_type, order, op, op_data, HDF5Constants.H5O_INFO_ALL, lapl_id);
}
@@ -4935,7 +5087,7 @@ public class H5 implements java.io.Serializable {
* - name is null.
**/
public synchronized static native int H5Ovisit_by_name(long loc_id, String obj_name, int idx_type, int order,
- H5O_iterate_cb op, H5O_iterate_t op_data, int fields, long lapl_id) throws HDF5LibraryException, NullPointerException;
+ H5O_iterate_t op, H5O_iterate_opdata_t op_data, int fields, long lapl_id) throws HDF5LibraryException, NullPointerException;
/**
@@ -4977,26 +5129,28 @@ public class H5 implements java.io.Serializable {
public synchronized static native void H5Oincr_refcount(long object_id) throws HDF5LibraryException;
/**
- * H5Oopen_by_addr opens a group, dataset, or named datatype using its address within an HDF5 file.
+ * H5Oopen_by_token opens a group, dataset, or named datatype using its object token within an HDF5 file.
*
* @param loc_id IN: File or group identifier
- * @param addr IN: Object's address in the file
+ * @param token IN: Object's token in the file
*
* @return an object identifier for the opened object
*
* @exception HDF5LibraryException - Error from the HDF-5 Library.
**/
- public static long H5Oopen_by_addr(long loc_id, long addr) throws HDF5LibraryException {
- long id = _H5Oopen_by_addr(loc_id, addr);
+ public static long H5Oopen_by_token(long loc_id, H5O_token_t token) throws HDF5LibraryException {
+ long id = _H5Oopen_by_token(loc_id, token);
+
if (id > 0) {
- log.trace("OPEN_IDS: H5Oopen_by_addr add {}", id);
+ log.trace("OPEN_IDS: H5Oopen_by_token add {}", id);
OPEN_IDS.add(id);
log.trace("OPEN_IDS: {}", OPEN_IDS.size());
}
+
return id;
}
- private synchronized static native long _H5Oopen_by_addr(long loc_id, long addr)
+ private synchronized static native long _H5Oopen_by_token(long loc_id, H5O_token_t token)
throws HDF5LibraryException, NullPointerException;
/**
@@ -5060,6 +5214,12 @@ public class H5 implements java.io.Serializable {
public synchronized static native void H5Oenable_mdc_flushes(long object_id);
public synchronized static native boolean H5Oare_mdc_flushes_disabled(long object_id);
+ // /////// unimplemented ////////
+ // herr_t H5Otoken_cmp(hid_t loc_id, const H5O_token_t *token1, const H5O_token_t *token2,
+ // int *cmp_value);
+ // herr_t H5Otoken_to_str(hid_t loc_id, const H5O_token_t *token, char **token_str);
+ // herr_t H5Otoken_from_str(hid_t loc_id, const char *token_str, H5O_token_t *token);
+
// ////////////////////////////////////////////////////////////
// //
// H5P: Property List Interface Functions //
@@ -10736,7 +10896,8 @@ public class H5 implements java.io.Serializable {
public synchronized static native long H5VLregister_connector_by_name(String connector_name, long vipl_id);
public synchronized static native long H5VLregister_connector_by_value(int connector_value, long vipl_id);
public synchronized static native boolean H5VLis_connector_registered(String name);
- public synchronized static native long H5VLget_connector_id(String name);
+ public synchronized static native long H5VLget_connector_id(long object_id);
+ public synchronized static native long H5VLget_connector_id_by_name(String name);
public synchronized static native String H5VLget_connector_name(long object_id);
public synchronized static native void H5VLclose(long connector_id);
public synchronized static native void H5VLunregister_connector(long connector_id);