From: Daniel Garcia-Sanchez Date: Wed, 31 Oct 2018 16:16:17 +0000 (+0100) Subject: Make get_attribute const X-Git-Tag: v9.1.0-rc1~453^2~14 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=310d2486129a29ed642979f1e600a873d8b222f4;p=dealii.git Make get_attribute const --- diff --git a/include/deal.II/base/hdf5.h b/include/deal.II/base/hdf5.h index bed7681555..d95b09b3dd 100644 --- a/include/deal.II/base/hdf5.h +++ b/include/deal.II/base/hdf5.h @@ -340,7 +340,7 @@ namespace HDF5 */ template T - get_attribute(const std::string &attr_name); + get_attribute(const std::string &attr_name) const; /** * Writes an attribute. @p T can be `float`, `double`, `std::complex`, diff --git a/source/base/hdf5.cc b/source/base/hdf5.cc index 17013e6b39..db8f358137 100644 --- a/source/base/hdf5.cc +++ b/source/base/hdf5.cc @@ -392,7 +392,7 @@ namespace HDF5 template T - HDF5Object::get_attribute(const std::string &attr_name) + HDF5Object::get_attribute(const std::string &attr_name) const { const std::shared_ptr t_type = internal::get_hdf5_datatype(); T value; @@ -416,7 +416,7 @@ namespace HDF5 template <> bool - HDF5Object::get_attribute(const std::string &attr_name) + HDF5Object::get_attribute(const std::string &attr_name) const { // The enum field generated by h5py can be casted to int int int_value; @@ -440,7 +440,7 @@ namespace HDF5 template <> std::string - HDF5Object::get_attribute(const std::string &attr_name) + HDF5Object::get_attribute(const std::string &attr_name) const { // Reads a UTF8 variable string // @@ -1623,9 +1623,9 @@ namespace HDF5 // std::complex and std::complex in hdf5.inst template int - HDF5Object::get_attribute(const std::string &attr_name); + HDF5Object::get_attribute(const std::string &attr_name) const; template unsigned int - HDF5Object::get_attribute(const std::string &attr_name); + HDF5Object::get_attribute(const std::string &attr_name) const; // The specializations of HDF5Object::get_attribute // and HDF5Object::get_attribute have been defined above diff --git a/source/base/hdf5.inst.in b/source/base/hdf5.inst.in index 01aaa687f4..c55408d5e6 100644 --- a/source/base/hdf5.inst.in +++ b/source/base/hdf5.inst.in @@ -17,7 +17,7 @@ for (number : REAL_AND_COMPLEX_SCALARS) { template number HDF5Object::get_attribute( - const std::string &attr_name); + const std::string &attr_name) const; template void HDF5Object::set_attribute( const std::string &attr_name, number value);