From 76150fba85785ac33e2a172aa62de727c8a14246 Mon Sep 17 00:00:00 2001 From: Daniel Garcia-Sanchez Date: Thu, 4 Oct 2018 19:16:26 +0200 Subject: [PATCH] Pass parameters by reference --- include/deal.II/base/hdf5.h | 60 ++++++++++----------- source/base/hdf5.cc | 103 ++++++++++++++++++------------------ source/base/hdf5.inst.in | 18 +++---- 3 files changed, 91 insertions(+), 90 deletions(-) diff --git a/include/deal.II/base/hdf5.h b/include/deal.II/base/hdf5.h index 8301af3b7b..84945e3e0a 100644 --- a/include/deal.II/base/hdf5.h +++ b/include/deal.II/base/hdf5.h @@ -282,7 +282,7 @@ namespace HDF5 */ template T - attr(const std::string attr_name); + attr(const std::string &attr_name); /** * Writes an attribute. `T` can be `float`, `double`, `std::complex`, @@ -298,7 +298,7 @@ namespace HDF5 */ template void - write_attr(const std::string attr_name, const T value); + write_attr(const std::string &attr_name, const T value); const std::string name; @@ -340,14 +340,14 @@ namespace HDF5 protected: // Open dataset - DataSet(const std::string name, const hid_t &parent_group_id, bool mpi); + DataSet(const std::string &name, const hid_t &parent_group_id, bool mpi); // Create dataset - DataSet(const std::string name, - const hid_t & parent_group_id, - std::vector dimensions, - std::shared_ptr t_type, - bool mpi); + DataSet(const std::string & name, + const hid_t & parent_group_id, + const std::vector &dimensions, + std::shared_ptr t_type, + const bool mpi); public: /** @@ -392,7 +392,7 @@ namespace HDF5 */ template std::vector - read_selection(const std::vector coordinates); + read_selection(const std::vector &coordinates); /** * Reads a hyperslab from the dataset. The parameters are summarized @@ -477,8 +477,8 @@ namespace HDF5 */ template void - write_selection(const std::vector &data, - const std::vector coordinates); + write_selection(const std::vector & data, + const std::vector &coordinates); /** * Writes a data hyperslab to the dataset. The parameters are summarized @@ -713,32 +713,32 @@ namespace HDF5 open }; - Group(const std::string name, - const Group & parent_group, - const bool mpi, - const Mode mode); + Group(const std::string &name, + const Group & parent_group, + const bool mpi, + const Mode mode); // This constructor is used by File - Group(const std::string name, const bool mpi); + Group(const std::string &name, const bool mpi); public: /** * Opens a group. */ Group - group(const std::string name); + group(const std::string &name); /** * Creates a group. */ Group - create_group(const std::string name); + create_group(const std::string &name); /** * Opens a dataset. */ DataSet - dataset(const std::string name); + dataset(const std::string &name); /** * Creates a dataset. Number can be `float`, `double`, @@ -752,8 +752,8 @@ namespace HDF5 */ template DataSet - create_dataset(const std::string name, - const std::vector dimensions) const; + create_dataset(const std::string & name, + const std::vector &dimensions) const; /** * Creates and writes data to a dataset. Number can be `float`, `double`, @@ -767,7 +767,7 @@ namespace HDF5 */ template