From 1099d7f06ae3c9f782b28e04c807676a22e51c4b Mon Sep 17 00:00:00 2001 From: David Wells Date: Mon, 18 Jan 2016 15:46:24 -0500 Subject: [PATCH] Remove some unneeded virtual functions. These functions immediately call the base class versions of themselves so there is no need for them to be reimplemented. --- include/deal.II/base/parameter_handler.h | 29 +++++++++--------------- source/base/parameter_handler.cc | 22 ------------------ 2 files changed, 11 insertions(+), 40 deletions(-) diff --git a/include/deal.II/base/parameter_handler.h b/include/deal.II/base/parameter_handler.h index 696075e610..0e7349386d 100644 --- a/include/deal.II/base/parameter_handler.h +++ b/include/deal.II/base/parameter_handler.h @@ -2264,30 +2264,23 @@ public: * from; this is only used when creating output for error messages. * * Return whether the read was successful. + * + * @note Of the three read_input functions implemented by + * ParameterHandler, this is the only one overridden with new behavior by + * this class. This is because the other two read_input functions + * just reformat their inputs and then call this version. */ virtual bool read_input (std::istream &input, const std::string &filename = "input file"); /** - * Read input from a file the name of which is given. The PathSearch class - * "PARAMETERS" is used to find the file. - * - * Return whether the read was successful. - * - * Unless optional is true, this function will - * automatically generate the requested file with default values if the file - * did not exist. This file will not contain additional comments if - * write_stripped_file is true. - */ - virtual bool read_input (const std::string &FileName, - const bool optional = false, - const bool write_stripped_file = false); - - /** - * Read input from a string in memory. The lines in memory have to be - * separated by @\n characters. + * Overriding virtual functions which are overloaded (like + * ParameterHandler::read_input, which has two different sets of input + * argument types) causes the non-overridden functions to be hidden. Get + * around this by explicitly using both variants of + * ParameterHandler::read_input and then overriding the one we care about. */ - virtual bool read_input_from_string (const char *s); + using ParameterHandler::read_input; /** * run the central loop. diff --git a/source/base/parameter_handler.cc b/source/base/parameter_handler.cc index fa072ed560..221bc3d045 100644 --- a/source/base/parameter_handler.cc +++ b/source/base/parameter_handler.cc @@ -2820,28 +2820,6 @@ bool MultipleParameterLoop::read_input (std::istream &input, -bool MultipleParameterLoop::read_input (const std::string &filename, - bool optional, - bool write_compact) -{ - return ParameterHandler::read_input (filename, optional, write_compact); - // don't call init_branches, since this read_input - // function calls - // MultipleParameterLoop::read_input(std::istream &, std::ostream &) - // which itself calls init_branches. -} - - - -bool MultipleParameterLoop::read_input_from_string (const char *s) -{ - bool x = ParameterHandler::read_input (s); - init_branches (); - return x; -} - - - void MultipleParameterLoop::loop (MultipleParameterLoop::UserClass &uc) { for (unsigned int run_no=0; run_no