]>
Commit | Line | Data |
---|---|---|
370be031 | 1 | //STARTHEADER |
2 | // $Id: Error.hh 389 2006-12-14 18:29:16Z salam $ | |
3 | // | |
4 | // Copyright (c) 2005-2006, Matteo Cacciari and Gavin Salam | |
5 | // | |
6 | //---------------------------------------------------------------------- | |
7 | // This file is part of FastJet. | |
8 | // | |
9 | // FastJet is free software; you can redistribute it and/or modify | |
10 | // it under the terms of the GNU General Public License as published by | |
11 | // the Free Software Foundation; either version 2 of the License, or | |
12 | // (at your option) any later version. | |
13 | // | |
14 | // The algorithms that underlie FastJet have required considerable | |
15 | // development and are described in hep-ph/0512210. If you use | |
16 | // FastJet as part of work towards a scientific publication, please | |
17 | // include a citation to the FastJet paper. | |
18 | // | |
19 | // FastJet is distributed in the hope that it will be useful, | |
20 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
21 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
22 | // GNU General Public License for more details. | |
23 | // | |
24 | // You should have received a copy of the GNU General Public License | |
25 | // along with FastJet; if not, write to the Free Software | |
26 | // Foundation, Inc.: | |
27 | // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
28 | //---------------------------------------------------------------------- | |
29 | //ENDHEADER | |
30 | ||
31 | ||
32 | ||
33 | #ifndef __FASTJET_ERROR_HH__ | |
34 | #define __FASTJET_ERROR_HH__ | |
35 | ||
36 | #include<iostream> | |
37 | #include<string> | |
38 | #include "fastjet/internal/base.hh" | |
39 | ||
40 | namespace fastjet { // defined in fastjet/internal/base.hh | |
41 | ||
42 | /// class corresponding to errors that will be thrown by fastjet | |
43 | class Error { | |
44 | public: | |
45 | // constructors | |
46 | Error() {;}; | |
47 | Error(const std::string & message) { | |
48 | _message = message; | |
49 | if (_print_errors) std::cerr << "fastjet::Error: "<<message << std::endl; | |
50 | }; | |
51 | ||
52 | std::string message() const {return _message;}; | |
53 | ||
54 | static void set_print_errors(bool print_errors) { | |
55 | _print_errors = print_errors;}; | |
56 | ||
57 | private: | |
58 | std::string _message; | |
59 | static bool _print_errors; | |
60 | }; | |
61 | ||
62 | ||
63 | } // fastjet namespace | |
64 | ||
65 | #endif // __FASTJET_ERROR_HH__ |