summaryrefslogtreecommitdiffstats
path: root/c++/src/H5Object.cpp
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2018-06-07 16:30:08 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2018-06-07 16:30:08 (GMT)
commit551f15f8ae02ca9c995619b216121081eb07633e (patch)
tree995de8be59b4d8524753eba6b542ce4039d54c79 /c++/src/H5Object.cpp
parentb8c6b68c35fa2be23ef488a1d81097ff3ed55000 (diff)
parent664186b91d9198915baca4c6dca3f7b03695d316 (diff)
downloadhdf5-hdf5-1_8_21.zip
hdf5-hdf5-1_8_21.tar.gz
hdf5-hdf5-1_8_21.tar.bz2
Merge pull request #1106 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:1.8/master to 1.8/masterhdf5-1_8_21
* commit '664186b91d9198915baca4c6dca3f7b03695d316': (124 commits) Commit HDF5 1.8.21 release version strings. Update INSTALL and INSTALL_parallel files to remove references to ancient systems and add generic steps for building HDF5 on HPC clusters. Update various INSTALL files for 1.8.21 release. Add missing space and correct typo. Modified a section for newly supported systems and compilers (vs. 1.8.20 release); Brought edits for tools bug fixes from 1.10.2 RELEASE.txt as we agreed with Allen. It is my test under Larry's guidance. Remove build directory which was unintentionally committed. Updated MANIFEST Switch default build mode to production. Update version to 1.8.21 in anticipation of release. Fixed EED-319 Description: Added an html version for the C++ function mapping table and removed the single web page version. Updated cpp_doc_config to use the html file. Fixed some typos. Running "doxygen cpp_doc_config" successfully. HDFFV-10473 fix HDFFV-10398 attribute location Add missing C++ entries to RELEASE.txt. pre1 release. Add missing RELEASE.txt entries for C++. Update Windows test machines Fix soversion naming and update cmake scripts Update version in RELEASE.txt. Correct merge errors from hdf5_1_8. Fixed typos Fixed typos Fixed typos ...
Diffstat (limited to 'c++/src/H5Object.cpp')
-rw-r--r--c++/src/H5Object.cpp67
1 files changed, 31 insertions, 36 deletions
diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp
index 8fe8e56..868a5d3 100644
--- a/c++/src/H5Object.cpp
+++ b/c++/src/H5Object.cpp
@@ -11,6 +11,12 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#ifdef OLD_HEADER_FILENAME
+#include <iostream.h>
+#else
+#include <iostream>
+#endif
+
#include <string>
#include "H5private.h" // for HDmemset
@@ -19,6 +25,8 @@
#include "H5IdComponent.h"
#include "H5PropList.h"
#include "H5DataSpace.h"
+#include "H5StrcreatProp.h"
+#include "H5LcreatProp.h"
#include "H5AbstractDs.h"
#include "H5LaccProp.h"
#include "H5Location.h"
@@ -53,32 +61,19 @@ namespace H5 {
H5Object::H5Object() : H5Location() {}
//--------------------------------------------------------------------------
-// Function: H5Object overloaded constructor (protected)
-// Purpose Creates an H5Object object using the id of an existing HDF5
-// object.
-// Parameters object_id - IN: Id of an existing HDF5 object
-// Programmer Binh-Minh Ribler - 2000
-// *** Deprecation warning ***
-// This constructor is no longer appropriate because the data member "id" had
-// been moved to the sub-classes. It will be removed in 1.10 release. If its
-// removal does not raise any problems in 1.10, it will be removed from 1.8 in
-// subsequent releases.
-// Removed in 1.8.18 and 1.10.1 - Aug 2016
-//--------------------------------------------------------------------------
-//H5Object::H5Object(const hid_t object_id) : H5Location() {}
-
-//--------------------------------------------------------------------------
-// Function: H5Object copy constructor
-///\brief Copy constructor: makes a copy of the original H5Object
-/// instance.
-///\param original - IN: H5Object instance to copy
-// Programmer Binh-Minh Ribler - 2000
-// *** Deprecation warning ***
-// This constructor is no longer appropriate because the data member "id" had
-// been moved to the sub-classes. It is removed from 1.8.15 because it is
-// a noop and it can be generated by the compiler if needed.
+// Function: f_Attribute_setId - friend
+// Purpose: This function is friend to class H5::Attribute so that it
+// can set Attribute::id in order to work around a problem
+// described in the JIRA issue HDFFV-7947.
+// Applications shouldn't need to use it.
+// param attr - IN/OUT: Attribute object to be changed
+// param new_id - IN: New id to set
+// Programmer Binh-Minh Ribler - 2015
//--------------------------------------------------------------------------
-// H5Object::H5Object(const H5Object& original) : H5Location() {}
+void f_Attribute_setId(Attribute* attr, hid_t new_id)
+{
+ attr->p_setId(new_id);
+}
/***************************************************************************
Notes for H5A wrappers
@@ -290,21 +285,22 @@ void H5Object::renameAttr(const H5std_string& oldname, const H5std_string& newna
//--------------------------------------------------------------------------
// Function: H5Object::getNumAttrs
-///\brief Returns the number of attributes attached to this HDF5 object.
+///\brief Deprecated - replaced by H5Location::getNumAttrs()
+// brief Returns the number of attributes attached to this HDF5 object.
///\return Number of attributes
///\exception H5::AttributeIException
// Programmer Binh-Minh Ribler - 2000
// Modification
-// - Moved from H5Location in 1.8.20. -BMR Oct, 2017
+// - Moved to H5Location to allow passing an attribute id to the
+// C API, in 1.8.20.
//--------------------------------------------------------------------------
int H5Object::getNumAttrs() const
{
- H5O_info_t oinfo; /* Object info */
+ H5O_info_t oinfo; /* Object info */
if(H5Oget_info(getId(), &oinfo) < 0)
- throw AttributeIException(inMemFunc("getNumAttrs"), "H5Oget_info failed");
- else
- return(static_cast<int>(oinfo.num_attrs));
+ throwException("getNumAttrs", "H5Oget_info failed");
+ return(static_cast<int>(oinfo.num_attrs));
}
//--------------------------------------------------------------------------
@@ -321,11 +317,11 @@ ssize_t H5Object::getObjName(char *obj_name, size_t buf_size) const
// If H5Iget_name returns a negative value, raise an exception
if (name_size < 0)
{
- throw Exception(inMemFunc("getObjName"), "H5Iget_name failed");
+ throwException("getObjName", "H5Iget_name failed");
}
else if (name_size == 0)
{
- throw Exception(inMemFunc("getObjName"), "Object must have a name, but name length is 0");
+ throwException("getObjName", "Object must have a name, but name length is 0");
}
// Return length of the name
return(name_size);
@@ -337,7 +333,6 @@ ssize_t H5Object::getObjName(char *obj_name, size_t buf_size) const
///\return Name of the object
///\exception H5::Exception
// Programmer Binh-Minh Ribler - Mar, 2014
-// Modification
//--------------------------------------------------------------------------
H5std_string H5Object::getObjName() const
{
@@ -349,11 +344,11 @@ H5std_string H5Object::getObjName() const
// If H5Iget_name failed, throw exception
if (name_size < 0)
{
- throw Exception(inMemFunc("getObjName"), "H5Iget_name failed");
+ throwException("getObjName", "H5Iget_name failed");
}
else if (name_size == 0)
{
- throw Exception(inMemFunc("getObjName"), "Object must have a name, but name length is 0");
+ throwException("getObjName", "Object must have a name, but name length is 0");
}
// Object's name exists, retrieve it
else if (name_size > 0)