Particle Identification and Tracking
read_config.h
Go to the documentation of this file.
1 //Copyright 2010 Thomas A Caswell
2 //tcaswell@uchicago.edu
3 //http://jfi.uchicago.edu/~tcaswell
4 //
5 //This program is free software; you can redistribute it and/or modify
6 //it under the terms of the GNU General Public License as published by
7 //the Free Software Foundation; either version 3 of the License, or (at
8 //your option) any later version.
9 //
10 //This program is distributed in the hope that it will be useful, but
11 //WITHOUT ANY WARRANTY; without even the implied warranty of
12 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 //General Public License for more details.
14 //
15 //You should have received a copy of the GNU General Public License
16 //along with this program; if not, see <http://www.gnu.org/licenses>.
17 //
18 //Additional permission under GNU GPL version 3 section 7
19 //
20 //If you modify this Program, or any covered work, by linking or
21 //combining it with MATLAB (or a modified version of that library),
22 //containing parts covered by the terms of MATLAB User License, the
23 //licensors of this Program grant you additional permission to convey
24 //the resulting work.
25 
26 #ifndef READ_XML
27 #define READ_XML
28 #include <vector>
29 #include <string>
30 #include "enum_utils.h"
31 #include "md_store.h"
32 namespace utilities{
33 
34 
35 
36 
45 public:
52  Read_config(std::string fname, std::string elm_name);
56  ~Read_config();
57 
65  template <class T>
66  T get_value(const std::string & attr_name,T & val)const;
67 
68 
69 
74  template <class T>
75  T get_value(int j,T& val)const;
76 
77 
81  bool contains_key(const std::string& key)const;
85  int get_key_index(const std::string& key)const;
86 
87 
88 
92  void print()const;
93 
97  int size() const
98  {
99  return md_store_.size();
100  }
101 
105  std::string get_key(int j) const
106  {
107  return md_store_.get_key(j);
108 
109  }
114  {
115  return md_store_.get_type(j);
116  }
117 
121  const Md_store * get_store()const
122  {
123  return &md_store_;
124  }
125 
126 private:
131 
132 
133 };
134 
135 
136 
137 }
138 
139 
140 
141 #endif
142 
143