]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make get_attribute const
authorDaniel Garcia-Sanchez <daniel.garcia-sanchez@insp.upmc.fr>
Wed, 31 Oct 2018 16:16:17 +0000 (17:16 +0100)
committerDaniel Garcia-Sanchez <daniel.garcia-sanchez@insp.upmc.fr>
Wed, 9 Jan 2019 18:29:09 +0000 (19:29 +0100)
include/deal.II/base/hdf5.h
source/base/hdf5.cc
source/base/hdf5.inst.in

index bed768155527fe3f2b7c748fe6f98032e46d7000..d95b09b3ddb61132675cf5d218146f25b5bca266 100644 (file)
@@ -340,7 +340,7 @@ namespace HDF5
      */
     template <typename T>
     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<float>`,
index 17013e6b396afb2d6d2bcbccc290aafcaf6b82bc..db8f358137292d0cb8be2d55632630b701bc8b40 100644 (file)
@@ -392,7 +392,7 @@ namespace HDF5
 
   template <typename T>
   T
-  HDF5Object::get_attribute(const std::string &attr_name)
+  HDF5Object::get_attribute(const std::string &attr_name) const
   {
     const std::shared_ptr<hid_t> t_type = internal::get_hdf5_datatype<T>();
     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<float> and std::complex<double> in hdf5.inst
 
   template int
-  HDF5Object::get_attribute<int>(const std::string &attr_name);
+  HDF5Object::get_attribute<int>(const std::string &attr_name) const;
   template unsigned int
-  HDF5Object::get_attribute<unsigned int>(const std::string &attr_name);
+  HDF5Object::get_attribute<unsigned int>(const std::string &attr_name) const;
   // The specializations of HDF5Object::get_attribute<std::string>
   // and HDF5Object::get_attribute<bool> have been defined above
 
index 01aaa687f44ee771b0c65077cd171d5945c71599..c55408d5e6c1b141f7d8bc64492ff67e5e8224e7 100644 (file)
@@ -17,7 +17,7 @@
 for (number : REAL_AND_COMPLEX_SCALARS)
   {
     template number HDF5Object::get_attribute<number>(
-      const std::string &attr_name);
+      const std::string &attr_name) const;
     template void HDF5Object::set_attribute<number>(
       const std::string &attr_name, number value);
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.