source: trunk/SISCone/siscone_error.h@ 21

Last change on this file since 21 was 20, checked in by Pavel Demin, 16 years ago

add SISCone library

File size: 2.5 KB
RevLine 
[20]1// -*- C++ -*-
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 //
7// //
8// Copyright (c) 2006 Gavin Salam and Gregory Soyez //
9// //
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. //
14// //
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. //
19// //
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 //
23// //
24// $Revision: 1.1 $//
25// $Date: 2008-10-02 15:20:29 $//
26///////////////////////////////////////////////////////////////////////////////
27
28#ifndef __SISCONE_ERROR_H__
29#define __SISCONE_ERROR_H__
30
31#include<iostream>
32#include<string>
33
34namespace siscone{
35
36/// class corresponding to errors that will be thrown by siscone
37class Csiscone_error {
38public:
39 // constructors
40 Csiscone_error() {;};
41 Csiscone_error(const std::string & message) {
42 m_message = message;
43 if (m_print_errors) std::cerr << "siscone::Csiscone_error: "<<message << std::endl;
44 };
45
46 std::string message() const {return m_message;};
47
48 static void setm_print_errors(bool print_errors) {
49 m_print_errors = print_errors;};
50
51private:
52 std::string m_message;
53 static bool m_print_errors;
54};
55
56}
57#endif
Note: See TracBrowser for help on using the repository browser.