summaryrefslogtreecommitdiffstats
path: root/c++/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-10-04 15:06:28 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-10-04 15:06:28 (GMT)
commit59b51a2ea72ff98586372a454adfd8c790a62734 (patch)
tree74173cf2dab79097c9dc8f116a22ad0138d310a2 /c++/src
parent302830e60108513d9ff2e710444dc0d0188c92ee (diff)
downloadhdf5-59b51a2ea72ff98586372a454adfd8c790a62734.zip
hdf5-59b51a2ea72ff98586372a454adfd8c790a62734.tar.gz
hdf5-59b51a2ea72ff98586372a454adfd8c790a62734.tar.bz2
[svn-r14180] Description:
Make H5Aiterate() versioned and change all internal use to H5Aiterate2() Leave some regression tests that exercise H5Aiterate1() Fix attribute display in h5dump & h5ls to be "by name" by default Tested on: FreeBSD/32 6.2 (duty) in debug mode FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Mac OS X/32 10.4.10 (amazon) in debug mode
Diffstat (limited to 'c++/src')
-rw-r--r--c++/src/H5Object.cpp24
-rw-r--r--c++/src/H5Object.h1
2 files changed, 14 insertions, 11 deletions
diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp
index 894cfef..494ee2c 100644
--- a/c++/src/H5Object.cpp
+++ b/c++/src/H5Object.cpp
@@ -33,9 +33,10 @@ namespace H5 {
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// userAttrOpWrpr simply interfaces between the user's function and the
-// C library function H5Aiterate; used to resolve the different prototype
+// C library function H5Aiterate2; used to resolve the different prototype
// problem. May be moved to Iterator later.
-extern "C" herr_t userAttrOpWrpr( hid_t loc_id, const char* attr_name, void* op_data )
+extern "C" herr_t userAttrOpWrpr(hid_t loc_id, const char *attr_name,
+ const H5A_info_t *ainfo, void *op_data)
{
H5std_string s_attr_name = H5std_string( attr_name );
#ifdef NO_STATIC_CAST
@@ -200,26 +201,29 @@ Attribute H5Object::openAttribute( const unsigned int idx ) const
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5A.html#Annot-Iterate
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-int H5Object::iterateAttrs( attr_operator_t user_op, unsigned * idx, void *op_data )
+int H5Object::iterateAttrs( attr_operator_t user_op, unsigned *_idx, void *op_data )
{
// store the user's function and data
UserData4Aiterate* userData = new UserData4Aiterate;
userData->opData = op_data;
- userData->idx = idx;
userData->op = user_op;
userData->object = this;
- // call the C library routine H5Aiterate to iterate the attributes
- int ret_value = H5Aiterate( id, idx, userAttrOpWrpr, (void *) userData );
+ // call the C library routine H5Aiterate2 to iterate the attributes
+ hsize_t idx = (hsize_t)*_idx;
+ int ret_value = H5Aiterate2(id, ".", H5_INDEX_NAME, H5_ITER_INC, &idx, userAttrOpWrpr, (void *) userData, H5P_DEFAULT);
+
// release memory
delete userData;
- if( ret_value >= 0 )
+ if( ret_value >= 0 ) {
+ /* Pass back update index value to calling code */
+ *_idx = (unsigned)idx;
+
return( ret_value );
- else // raise exception when H5Aiterate returns a negative value
- {
- throw AttributeIException(inMemFunc("iterateAttrs"), "H5Aiterate failed");
}
+ else // raise exception when H5Aiterate returns a negative value
+ throw AttributeIException(inMemFunc("iterateAttrs"), "H5Aiterate2 failed");
}
//--------------------------------------------------------------------------
diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h
index b576621..77de529 100644
--- a/c++/src/H5Object.h
+++ b/c++/src/H5Object.h
@@ -38,7 +38,6 @@ typedef void (*attr_operator_t)( H5Object& loc/*in*/,
class UserData4Aiterate { // user data for attribute iteration
public:
- unsigned int* idx;
attr_operator_t op;
void* opData;
H5Object* object;