summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2017-03-17 21:55:32 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2017-03-17 21:55:32 (GMT)
commitc89e53431bff1fd584aabbe6d326df7d69361219 (patch)
tree77cc3601485dafd963ea81d93776f0feb3c4017f
parent983658973b514fa25a831e31d5dc22e585d00b47 (diff)
parent5acc8b9e169e6416e353433791321bc9c4e7b725 (diff)
downloadhdf5-c89e53431bff1fd584aabbe6d326df7d69361219.zip
hdf5-c89e53431bff1fd584aabbe6d326df7d69361219.tar.gz
hdf5-c89e53431bff1fd584aabbe6d326df7d69361219.tar.bz2
Merge pull request #344 in HDFFV/hdf5 from ~BMRIBLER/hdf5_bmr_cpp2:develop to develop
* commit '5acc8b9e169e6416e353433791321bc9c4e7b725': Description: Fixed typos. Platforms tested: Linux/64 (jelly) Description: Deprecating versions of PropList::setProperty that have arguments that miss "const" Platforms tested: Linux/64 (jelly) Linux/64 (platypus) Darwin (osx1010test)
-rw-r--r--c++/src/H5PropList.cpp61
-rw-r--r--c++/src/H5PropList.h7
2 files changed, 66 insertions, 2 deletions
diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp
index c4176c2..0df0a9f 100644
--- a/c++/src/H5PropList.cpp
+++ b/c++/src/H5PropList.cpp
@@ -565,8 +565,27 @@ size_t PropList::getNumProps() const
///\param name - IN: Name of property to set - \c char pointer
///\param value - IN: Void pointer to the value for the property
///\exception H5::PropListIException
+// Description
+// Revision svn r29815 changed 'value' to const, hence, deprecated
+// the non-const setProperty.
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
+void PropList::setProperty(const char* name, const void* value) const
+{
+ herr_t ret_value = H5Pset(id, name, value);
+ if (ret_value < 0)
+ {
+ throw PropListIException(inMemFunc("setProperty"), "H5Pset failed");
+ }
+}
+
+//--------------------------------------------------------------------------
+// Function: PropList::setProperty
+///\brief Deprecated due to missing const in prototype. (1.10.1)
+// Programmer: Binh-Minh Ribler - March, 2017
+// Modification
+// Planned for removal. -BMR, 2017/03/17 1.10.1
+//--------------------------------------------------------------------------
void PropList::setProperty(const char* name, void* value) const
{
herr_t ret_value = H5Pset(id, name, value);
@@ -575,6 +594,7 @@ void PropList::setProperty(const char* name, void* value) const
throw PropListIException(inMemFunc("setProperty"), "H5Pset failed");
}
}
+
//--------------------------------------------------------------------------
// Function: PropList::setProperty
///\brief This is an overloaded member function, provided for convenience.
@@ -582,11 +602,14 @@ void PropList::setProperty(const char* name, void* value) const
/// accepts.
///\param name - IN: Name of property to set - \c char pointer
///\param charptr - IN: Char pointer to the value for the property
+// Description
+// Revision svn r29815 changed 'value' to const, hence, deprecated
+// the non-const setProperty.
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void PropList::setProperty(const char* name, const char* charptr) const
{
- herr_t ret_value = H5Pset(id, name, (void*)charptr);
+ herr_t ret_value = H5Pset(id, name, (const void*)charptr);
if (ret_value < 0)
{
throw PropListIException(inMemFunc("setProperty"), "H5Pset failed");
@@ -601,6 +624,18 @@ void PropList::setProperty(const char* name, const char* charptr) const
///\param strg - IN: Value for the property is a \c H5std_string
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
+void PropList::setProperty(const char* name, const H5std_string& strg) const
+{
+ setProperty(name, strg.c_str());
+}
+
+//--------------------------------------------------------------------------
+// Function: PropList::setProperty
+///\brief Deprecated due to missing const in prototype. (1.10.1)
+// Programmer: Binh-Minh Ribler - March, 2017
+// Modification
+// Planned for removal. -BMR, 2017/03/17 1.10.1
+//--------------------------------------------------------------------------
void PropList::setProperty(const char* name, H5std_string& strg) const
{
setProperty(name, strg.c_str());
@@ -615,6 +650,18 @@ void PropList::setProperty(const char* name, H5std_string& strg) const
///\param value - IN: Void pointer to the value for the property
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
+void PropList::setProperty(const H5std_string& name, const void* value) const
+{
+ setProperty(name.c_str(), value);
+}
+
+//--------------------------------------------------------------------------
+// Function: PropList::setProperty
+///\brief Deprecated due to missing const in prototype. (1.10.1)
+// Programmer: Binh-Minh Ribler - March, 2017
+// Modification
+// Planned for removal. -BMR, 2017/03/17 1.10.1
+//--------------------------------------------------------------------------
void PropList::setProperty(const H5std_string& name, void* value) const
{
setProperty(name.c_str(), value);
@@ -629,6 +676,18 @@ void PropList::setProperty(const H5std_string& name, void* value) const
///\param strg - IN: Value for the property is a \c H5std_string
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
+void PropList::setProperty(const H5std_string& name, const H5std_string& strg) const
+{
+ setProperty(name.c_str(), strg.c_str());
+}
+
+//--------------------------------------------------------------------------
+// Function: PropList::setProperty
+///\brief Deprecated due to missing const in prototype. (1.10.1)
+// Programmer: Binh-Minh Ribler - March, 2017
+// Modification
+// Planned for removal. -BMR, 2017/03/17 1.10.1
+//--------------------------------------------------------------------------
void PropList::setProperty(const H5std_string& name, H5std_string& strg) const
{
setProperty(name.c_str(), strg.c_str());
diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h
index 0ceaabd..772e96c 100644
--- a/c++/src/H5PropList.h
+++ b/c++/src/H5PropList.h
@@ -78,8 +78,13 @@ class H5_DLLCPP PropList : public IdComponent {
H5std_string getProperty(const H5std_string& name) const;
// Set a property's value in a property list.
- void setProperty(const char* name, void* value) const;
void setProperty(const char* name, const char* charptr) const;
+ void setProperty(const char* name, const void* value) const;
+ void setProperty(const char* name, const H5std_string& strg) const;
+ void setProperty(const H5std_string& name, const void* value) const;
+ void setProperty(const H5std_string& name, const H5std_string& strg) const;
+ // Deprecated after 1.10.1, missing const
+ void setProperty(const char* name, void* value) const;
void setProperty(const char* name, H5std_string& strg) const;
void setProperty(const H5std_string& name, void* value) const;
void setProperty(const H5std_string& name, H5std_string& strg) const;