#ifndef LAGSHTEXCEPTIONS_SEEN #define LAGSHTEXCEPTIONS_SEEN /* * This file is part of LagSHT. * * LagSHT is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * LagSHT is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with libsharp; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* * LagSHT is being developed at the Linear Accelerateur Laboratory (LAL) * 91898 ORSAY CEDEX - FRANCE * main author: J.E Campagne */ #include #include namespace LagSHT { class LagSHTError : public std::exception { public: explicit LagSHTError(const std::string& m) : msg_(m) { } explicit LagSHTError(const char* m): msg_(m) { } virtual ~LagSHTError() throw() {} //! Implementation of std::exception what() method, returning the exception message virtual const char* what() const throw() { return msg_.c_str(); } private: std::string msg_; };//LagSHTError #define lagsht_assert(testval,msg) \ do { if (testval); else throw LagSHTError(msg); } while(0) }//end namespace #endif //LAGSHTEXCEPTIONS_SEEN