libwreport  2.9
options.h
Go to the documentation of this file.
1 /*
2  * wreport/options - Library configuration
3  *
4  * Copyright (C) 2012 ARPA-SIM <urpsim@smr.arpa.emr.it>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License.
9  *
10  * This program 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 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, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * Author: Enrico Zini <enrico@enricozini.com>
20  */
21 
22 #ifndef WREPORT_OPTIONS_H
23 #define WREPORT_OPTIONS_H
24 
30 namespace wreport {
31 namespace options {
32 
39 extern bool var_silent_domain_errors;
40 
41 template<typename T>
43 {
44  T old_value;
45  T& param;
46 
47  LocalOverride(T& param, const T& new_value)
48  : old_value(param), param(param)
49  {
50  param = new_value;
51  }
52  ~LocalOverride()
53  {
54  param = old_value;
55  }
56 };
57 
58 }
59 }
60 
61 #endif
62 /* vim:set ts=4 sw=4: */