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:: 123 $// 00025 // $Date:: 2007-02-28 20:52:16 -0500 (Wed, 28 Feb 2007) $// 00027 00028 #ifndef __SISCONE_ERROR_H__ 00029 #define __SISCONE_ERROR_H__ 00030 00031 #include<iostream> 00032 #include<string> 00033 00034 namespace siscone{ 00035 00037 class Csiscone_error { 00038 public: 00039 // constructors 00040 Csiscone_error() {;}; 00041 Csiscone_error(const std::string & message) { 00042 m_message = message; 00043 if (m_print_errors) std::cerr << "siscone::Csiscone_error: "<<message << std::endl; 00044 }; 00045 00046 std::string message() const {return m_message;}; 00047 00048 static void setm_print_errors(bool print_errors) { 00049 m_print_errors = print_errors;}; 00050 00051 private: 00052 std::string m_message; 00053 static bool m_print_errors; 00054 }; 00055 00056 } 00057 #endif