2 ///////////////////////////////////////////////////////////////////////////////
3 // File: siscone_error.h //
4 // Description: header file for SISCone error messages (Csiscone_error) //
5 // This file is part of the SISCone project. //
6 // For more details, see http://projects.hepforge.org/siscone //
8 // Copyright (c) 2006 Gavin Salam and Gregory Soyez //
10 // This program is free software; you can redistribute it and/or modify //
11 // it under the terms of the GNU General Public License as published by //
12 // the Free Software Foundation; either version 2 of the License, or //
13 // (at your option) any later version. //
15 // This program is distributed in the hope that it will be useful, //
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
18 // GNU General Public License for more details. //
20 // You should have received a copy of the GNU General Public License //
21 // along with this program; if not, write to the Free Software //
22 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
24 // $Revision:: 268 $//
25 // $Date:: 2009-03-12 21:24:16 +0100 (Thu, 12 Mar 2009) $//
26 ///////////////////////////////////////////////////////////////////////////////
28 #ifndef __SISCONE_ERROR_H__
29 #define __SISCONE_ERROR_H__
36 /// \class Csiscone_error
37 /// class corresponding to errors that will be thrown by siscone
38 class Csiscone_error {
43 /// ctor with a given error message
44 /// \param message the error message to be printed
45 Csiscone_error(const std::string & message) {
47 if (m_print_errors) std::cerr << "siscone::Csiscone_error: "<<message << std::endl;
50 /// access to the error message
51 std::string message() const {return m_message;};
53 /// switch on/off the error message printing
54 /// \param print_errors errors will be printed when true
55 static void setm_print_errors(bool print_errors) {
56 m_print_errors = print_errors;};
59 std::string m_message; ///< the error message
60 static bool m_print_errors; ///< do we print error messages?