--- /dev/null
+//-----------------------------------------------------------
+//
+// Copyright (C) 2015 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+//-----------------------------------------------------------
+
+
+
+#include "../tests.h"
+#include <deal.II/base/path_search.h>
+#include <deal.II/base/utilities.h>
+#include <deal.II/base/parameter_acceptor.h>
+
+class FirstClass : public ParameterAcceptor
+{
+public:
+ FirstClass(const std::string &name = "First Class"):
+ ParameterAcceptor(name)
+ {
+ add_parameter("First int", f_i);
+ add_parameter("First double",f_d);
+ add_parameter("First bool", f_b);
+ add_parameter("First string",f_s);
+ };
+
+private:
+ int f_i = 3;
+ double f_d = 7.7;
+ bool f_b = true;
+ std::string f_s = "hello";
+};
+
+class SecondClass : public ParameterAcceptor
+{
+public:
+ SecondClass(const std::string &name = "Second Class"):
+ ParameterAcceptor(name)
+ {
+ add_parameter("Second int", s_i);
+ add_parameter("Second double",s_d);
+ add_parameter("Second bool", s_b);
+ add_parameter("Second string",s_s);
+ };
+
+private:
+ int s_i = 5;
+ double s_d = 9.9;
+ bool s_b = false;
+ std::string s_s = "bye bye";
+};
+
+int main ()
+{
+ initlog();
+
+ FirstClass f;
+ SecondClass s;
+ std::string output_name = "used_parameter_acceptor_05.xml";
+ ParameterAcceptor::initialize(SOURCE_DIR "/parameter_acceptor_parameters/parameter_acceptor_05.prm", output_name);
+ ParameterAcceptor::prm.log_parameters(deallog);
+ std::ifstream file (output_name.c_str());
+
+ std::string str;
+ deallog << "reading " << output_name << std::endl;
+ while (std::getline(file, str))
+ deallog << str << std::endl;
+
+
+}
--- /dev/null
+
+DEAL:parameters:First Class::First bool: true
+DEAL:parameters:First Class::First double: 7.7
+DEAL:parameters:First Class::First int: 3
+DEAL:parameters:First Class::First string: hello
+DEAL:parameters:Second Class::Second bool: false
+DEAL:parameters:Second Class::Second double: 9.9
+DEAL:parameters:Second Class::Second int: 5
+DEAL:parameters:Second Class::Second string: bye bye
+DEAL::reading used_parameter_acceptor_05.xml
+DEAL::<?xml version="1.0" encoding="utf-8"?>
+DEAL::<ParameterHandler><First_20Class><First_20int><value>3</value><default_value>3</default_value><documentation/><pattern>0</pattern><pattern_description>[Integer range -2147483648...2147483647 (inclusive)]</pattern_description><actions>0</actions></First_20int><First_20double><value>7.7</value><default_value>7.700000</default_value><documentation/><pattern>1</pattern><pattern_description>[Double -MAX_DOUBLE...MAX_DOUBLE (inclusive)]</pattern_description><actions>1</actions></First_20double><First_20bool><value>true</value><default_value>true</default_value><documentation/><pattern>2</pattern><pattern_description>[Bool]</pattern_description><actions>2</actions></First_20bool><First_20string><value>hello</value><default_value>hello</default_value><documentation/><pattern>3</pattern><pattern_description>[Anything]</pattern_description><actions>3</actions></First_20string></First_20Class><Second_20Class><Second_20int><value>5</value><default_value>5</default_value><documentation/><pattern>4</pattern><pattern_description>[Integer range -2147483648...2147483647 (inclusive)]</pattern_description><actions>4</actions></Second_20int><Second_20double><value>9.9</value><default_value>9.900000</default_value><documentation/><pattern>5</pattern><pattern_description>[Double -MAX_DOUBLE...MAX_DOUBLE (inclusive)]</pattern_description><actions>5</actions></Second_20double><Second_20bool><value>false</value><default_value>false</default_value><documentation/><pattern>6</pattern><pattern_description>[Bool]</pattern_description><actions>6</actions></Second_20bool><Second_20string><value>bye bye</value><default_value>bye bye</default_value><documentation/><pattern>7</pattern><pattern_description>[Anything]</pattern_description><actions>7</actions></Second_20string></Second_20Class></ParameterHandler>