diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-09-13 15:44:56 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-09-13 15:44:56 (GMT) |
commit | 579284f422b6ed25b7a5f4a518c19740fff297c8 (patch) | |
tree | 564b2a7b4c13854a19ffaf465f94e6abd52d6340 /c++ | |
parent | 15d118faedd8e61e8ec2a715cf8fcea5b1afab35 (diff) | |
download | hdf5-579284f422b6ed25b7a5f4a518c19740fff297c8.zip hdf5-579284f422b6ed25b7a5f4a518c19740fff297c8.tar.gz hdf5-579284f422b6ed25b7a5f4a518c19740fff297c8.tar.bz2 |
[svn-r14144] Description:
Move H5Gget_objinfo() to deprecated symbols section and retarget
internal usage to H5Lget_info()/H5Oget_info().
Misc. other code cleanups...
Tested on:
FreeBSD/32 6.2 (duty)
FreeBSD/64 6.2 (liberty)
Linux/32 2.6 (kagiso)
Linux/64 2.6 (smirom)
AIX/32 5.3 (copper)
Solaris/32 2.10 (linew)
Mac OS X/32 10.4.10 (amazon)
Diffstat (limited to 'c++')
-rw-r--r-- | c++/src/H5CommonFG.cpp | 2 | ||||
-rw-r--r-- | c++/src/H5CommonFG.h | 14 | ||||
-rw-r--r-- | c++/test/tattr.cpp | 16 |
3 files changed, 25 insertions, 7 deletions
diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 0ea3923..b76d8b0 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -341,6 +341,7 @@ void CommonFG::move( const H5std_string& src, const H5std_string& dst ) const move( src.c_str(), dst.c_str() ); } +#ifndef H5_NO_DEPRECATED_SYMBOLS //-------------------------------------------------------------------------- // Function: CommonFG::getObjinfo ///\brief Returns information about an object. @@ -402,6 +403,7 @@ void CommonFG::getObjinfo( const H5std_string& name, H5G_stat_t& statbuf ) const { getObjinfo( name.c_str(), statbuf ); } +#endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- // Function: CommonFG::getLinkval diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index ed1c132..2a2e6cd 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -69,13 +69,6 @@ class H5_DLLCPP CommonFG { // Returns the number of objects in this group. hsize_t getNumObjs() const; - // Returns information about an HDF5 object, given by its name, - // at this location. - void getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const; - void getObjinfo(const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf) const; - void getObjinfo(const char* name, H5G_stat_t& statbuf) const; - void getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const; - // Retrieves the name of an object in this group, given the // object's index. ssize_t getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) const; @@ -87,6 +80,13 @@ class H5_DLLCPP CommonFG { H5G_obj_t getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const; #ifndef H5_NO_DEPRECATED_SYMBOLS + // Returns information about an HDF5 object, given by its name, + // at this location. + void getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const; + void getObjinfo(const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf) const; + void getObjinfo(const char* name, H5G_stat_t& statbuf) const; + void getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const; + // Iterates over the elements of this group - not implemented in // C++ style yet. int iterateElems(const char* name, int *idx, H5G_iterate_t op, void *op_data); diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index ca0516a..0d545d7 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -1026,7 +1026,9 @@ static void test_attr_dtype_shared() { int data=8; /* Data to write */ int rdata=0; /* Read read in */ +#ifndef H5_NO_DEPRECATED_SYMBOLS H5G_stat_t statbuf; /* Object's information */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ h5_stat_size_t filesize; /* Size of file after modifications */ // Output message about test being performed @@ -1054,9 +1056,11 @@ static void test_attr_dtype_shared() // Commit datatype to file dtype.commit(fid1, TYPE1_NAME); +#ifndef H5_NO_DEPRECATED_SYMBOLS // Check reference count on named datatype fid1.getObjinfo(TYPE1_NAME, statbuf); verify_val((int)statbuf.nlink, 1, "DataType::getObjinfo", __LINE__, __FILE__); +#endif /* H5_NO_DEPRECATED_SYMBOLS */ // Create dataspace for dataset DataSpace dspace; @@ -1070,16 +1074,20 @@ static void test_attr_dtype_shared() // Create dataset DataSet dset = fid1.createDataSet(DSET1_NAME, dtype, dspace); +#ifndef H5_NO_DEPRECATED_SYMBOLS // Check reference count on named datatype fid1.getObjinfo(TYPE1_NAME, statbuf); verify_val((int)statbuf.nlink, 2, "H5File::getObjinfo", __LINE__, __FILE__); +#endif /* H5_NO_DEPRECATED_SYMBOLS */ // Create attribute on dataset Attribute attr = dset.createAttribute(ATTR1_NAME,dtype,dspace); +#ifndef H5_NO_DEPRECATED_SYMBOLS // Check reference count on named datatype fid1.getObjinfo(TYPE1_NAME, statbuf); verify_val((int)statbuf.nlink, 3, "DataSet::getObjinfo", __LINE__, __FILE__); +#endif /* H5_NO_DEPRECATED_SYMBOLS */ // Close attribute attr.close(); @@ -1087,16 +1095,20 @@ static void test_attr_dtype_shared() // Delete attribute dset.removeAttr(ATTR1_NAME); +#ifndef H5_NO_DEPRECATED_SYMBOLS // Check reference count on named datatype fid1.getObjinfo(TYPE1_NAME, statbuf); verify_val((int)statbuf.nlink, 2, "DataSet::getObjinfo after DataSet::removeAttr", __LINE__, __FILE__); +#endif /* H5_NO_DEPRECATED_SYMBOLS */ // Create attribute on dataset attr = dset.createAttribute(ATTR1_NAME,dtype,dspace); +#ifndef H5_NO_DEPRECATED_SYMBOLS // Check reference count on named datatype fid1.getObjinfo(TYPE1_NAME, statbuf); verify_val((int)statbuf.nlink, 3, "DataSet::createAttribute", __LINE__, __FILE__); +#endif /* H5_NO_DEPRECATED_SYMBOLS */ // Write data into the attribute attr.write(PredType::NATIVE_INT,&data); @@ -1125,18 +1137,22 @@ static void test_attr_dtype_shared() delete attr2; delete dset2; +#ifndef H5_NO_DEPRECATED_SYMBOLS // Check reference count on named datatype fid1.getObjinfo(TYPE1_NAME, statbuf); verify_val((int)statbuf.nlink, 3, "DataSet::openAttribute", __LINE__, __FILE__); +#endif /* H5_NO_DEPRECATED_SYMBOLS */ // Unlink the dataset fid1.unlink(DSET1_NAME); } // end of enclosing to test reference counts +#ifndef H5_NO_DEPRECATED_SYMBOLS // Check reference count on named datatype fid1.getObjinfo(TYPE1_NAME, statbuf); verify_val((int)statbuf.nlink, 1, "H5File::unlink", __LINE__, __FILE__); +#endif /* H5_NO_DEPRECATED_SYMBOLS */ // Unlink the named datatype fid1.unlink(TYPE1_NAME); |