DOLFIN
DOLFIN C++ interface
XMLParameters.h
1 // Copyright (C) 2011 Ola Skavhaug, Anders Logg and Garth N. Wells
2 //
3 // This file is part of DOLFIN.
4 //
5 // DOLFIN is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // DOLFIN is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // First added: 2009-03-16
19 // Last changed: 2011-03-28
20 
21 #ifndef __XML_PARAMETERS_H
22 #define __XML_PARAMETERS_H
23 
24 #include <ostream>
25 #include <string>
26 
27 namespace pugi
28 {
29  class xml_node;
30 }
31 
32 namespace dolfin
33 {
34 
35  class Parameters;
36 
37  // FIXME: Need to test nested parameters and ranges in XML format
38 
40 
42  {
43  public:
44 
46  static void read(Parameters& parameters, const pugi::xml_node xml_dolfin);
47 
49  static void write(const Parameters& parameters, pugi::xml_node xml_node);
50 
51  private:
52 
53  static void read_parameter_nest(Parameters& p, const pugi::xml_node xml_node);
54 
55  template<typename T>
56  static void add_parameter(Parameters& p, const std::string& key, T value);
57 
58  };
59 
60 }
61 
62 #endif
Definition: adapt.h:29
I/O of Parameters in XML format.
Definition: XMLParameters.h:41
Definition: Parameters.h:94
Definition: VTKFile.h:27
GlobalParameters parameters
The global parameter database.
Definition: GlobalParameters.cpp:32