|
SISCone
2.0.5
|
00001 // -*- C++ -*- 00003 // File: siscone_error.h // 00004 // Description: header file for SISCone error messages (Csiscone_error) // 00005 // This file is part of the SISCone project. // 00006 // For more details, see http://projects.hepforge.org/siscone // 00007 // // 00008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez // 00009 // // 00010 // This program is free software; you can redistribute it and/or modify // 00011 // it under the terms of the GNU General Public License as published by // 00012 // the Free Software Foundation; either version 2 of the License, or // 00013 // (at your option) any later version. // 00014 // // 00015 // This program is distributed in the hope that it will be useful, // 00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of // 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // 00018 // GNU General Public License for more details. // 00019 // // 00020 // You should have received a copy of the GNU General Public License // 00021 // along with this program; if not, write to the Free Software // 00022 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // 00023 // // 00024 // $Revision:: 327 $// 00025 // $Date:: 2011-11-25 15:19:39 +0100 (Fri, 25 Nov 2011) $// 00027 00028 #ifndef __SISCONE_ERROR_H__ 00029 #define __SISCONE_ERROR_H__ 00030 00031 #include<iostream> 00032 #include<string> 00033 00034 namespace siscone{ 00035 00038 class Csiscone_error { 00039 public: 00041 Csiscone_error() {;}; 00042 00045 Csiscone_error(const std::string & message_in) { 00046 m_message = message_in; 00047 if (m_print_errors) std::cerr << "siscone::Csiscone_error: "<< message_in << std::endl; 00048 }; 00049 00051 std::string message() const {return m_message;}; 00052 00055 static void setm_print_errors(bool print_errors) { 00056 m_print_errors = print_errors;}; 00057 00058 private: 00059 std::string m_message; 00060 static bool m_print_errors; 00061 }; 00062 00063 } 00064 #endif