From 5bdfb3d7839887e87a12730b1b9614dcfdc4018f Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 7 Jun 2004 14:37:43 +0000 Subject: [PATCH] Remove a truly old remnant in the ParameterHandler class that has never been used. git-svn-id: https://svn.dealii.org/trunk@9390 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/parameter_handler.h | 23 +------------------ deal.II/base/source/parameter_handler.cc | 20 ++++++---------- deal.II/doc/news/c-5.0.html | 12 ++++++++++ 3 files changed, 20 insertions(+), 35 deletions(-) diff --git a/deal.II/base/include/base/parameter_handler.h b/deal.II/base/include/base/parameter_handler.h index 50920c0f25..c179b0cc42 100644 --- a/deal.II/base/include/base/parameter_handler.h +++ b/deal.II/base/include/base/parameter_handler.h @@ -1288,14 +1288,7 @@ class ParameterHandler virtual bool read_input_from_string (const char *s); /** - * Return status of this object: - * true=clean or - * false=error occured. - */ - bool ok () const; - - /** - * clear status bit and contents. + * Clear all contents. */ void clear (); @@ -1504,11 +1497,6 @@ class ParameterHandler << "Error when trying to convert the following string: " << arg1); private: - /** - * ok bit - */ - bool status; - /** * Whatever is in a section: * map of entry names together with @@ -2059,14 +2047,5 @@ class MultipleParameterLoop : public ParameterHandler }; -/*------------------------------ Inline functions ------------------------------*/ - -inline -bool -ParameterHandler::ok() const -{ - return status; -} - #endif diff --git a/deal.II/base/source/parameter_handler.cc b/deal.II/base/source/parameter_handler.cc index e65eb980c5..e4ea78be53 100644 --- a/deal.II/base/source/parameter_handler.cc +++ b/deal.II/base/source/parameter_handler.cc @@ -31,7 +31,6 @@ # include #endif -//TODO[WB]: Remove the "status" flag -- it's only a remnant of the DiffPack past of this class and doesn't really serve any useful purpose any more namespace Patterns { @@ -542,11 +541,6 @@ namespace Patterns -ParameterHandler::ParameterHandler () - : - status(true) {} - - ParameterHandler::~ParameterHandler () {} @@ -559,13 +553,15 @@ bool ParameterHandler::read_input (std::istream &input) std::string line; int lineno=0; + bool status = true; + while (input) { ++lineno; getline (input, line); if (!scan_line (line, lineno)) status = false; - }; + } return status; } @@ -608,7 +604,8 @@ bool ParameterHandler::read_input_from_string (const char *s) // to make all lines equal if (input[input.length()-1] != '\n') input += '\n'; - + + bool status = true; while (input.size() != 0) { // get one line from Input (=s) @@ -629,8 +626,6 @@ bool ParameterHandler::read_input_from_string (const char *s) void ParameterHandler::clear () { - status = true; - subsection_path.clear (); defaults.entries.clear (); changed_entries.entries.clear (); @@ -1283,7 +1278,7 @@ const ParameterHandler::Section* ParameterHandler::get_present_changed_subsectio { sec = sec->subsections[*SecName]; ++SecName; - }; + } return sec; } @@ -1293,8 +1288,7 @@ const ParameterHandler::Section* ParameterHandler::get_present_changed_subsectio unsigned int ParameterHandler::memory_consumption () const { - return (MemoryConsumption::memory_consumption (status) + - MemoryConsumption::memory_consumption (subsection_path) + + return (MemoryConsumption::memory_consumption (subsection_path) + MemoryConsumption::memory_consumption (defaults) + MemoryConsumption::memory_consumption (changed_entries)); } diff --git a/deal.II/doc/news/c-5.0.html b/deal.II/doc/news/c-5.0.html index 15d2422e37..bbfd42ede1 100644 --- a/deal.II/doc/news/c-5.0.html +++ b/deal.II/doc/news/c-5.0.html @@ -68,6 +68,18 @@ inconvenience this causes.

base

    +
  1. + Removed: The ParameterHandler class contained a remnant from + back in 1997 when it was modeled after a similar class in DiffPack: it + had a status flag that one could obtain via the ok function. It was never really used for + anything, and has thus finally been removed. The ok is consequently gone as well. +
    + (WB 2004/06/06) +

    +
  2. New: An object of the new ConditionalOStream class allows to print -- 2.39.5