/// \file MonitoringException.hh /* * * MonitoringException.hh header template generated by fclass * Creation date : mar. d�c. 24 2013 * * This file is part of XXX libraries. * * XXX 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 3 of the License, or * (at your option) any later version. * based upon these libraries are permitted. Any copy of these libraries * must include this copyright notice. * * XXX 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 XXX. If not, see . * * @author : Remi Ete * @version * @copyright * * */ #ifndef MONITORINGEXCEPTION_HH #define MONITORINGEXCEPTION_HH #include "lcamore/ExceptionLevel.hh" #include #include #include namespace lcamore { class ExceptionLevel; /** * @brief MonitoringException class * Inherits from base class CalipsoException */ class MonitoringException { public: /** * @brief Ctor */ MonitoringException( ExceptionType type , const std::string &func , const std::string &message ) throw() : _message( message ) , _function( func ) { _exceptionType = _exceptionLevel( type ); } /** * @brief Ctor */ virtual ~MonitoringException() throw() { } /** * @brief Return the exception with a formated output */ virtual const char *what() const throw() { std::string what = std::string("LCAmore exception thrown. \n"); what += std::string(" Function : ") + _function + std::string("\n"); what += std::string(" Exception type : ") + _exceptionType + std::string("\n"); what += std::string(" What : ") + _message + std::string("\n"); return what.c_str(); } private: ExceptionLevel _exceptionLevel; std::string _exceptionType; std::string _message; std::string _function; }; // class } #endif // MONITORINGEXCEPTION_HH