libStatGen Software
1
|
00001 /* 00002 * Copyright (C) 2010 Regents of the University of Michigan 00003 * 00004 * This program is free software: you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation, either version 3 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 #ifndef __GLF_EXCEPTION_H__ 00019 #define __GLF_EXCEPTION_H__ 00020 00021 #include <stdexcept> // stdexcept header file 00022 00023 #include "GlfStatus.h" 00024 00025 /// GlfException objects should be thrown by functions that operate on 00026 /// Glf files for exceptions. 00027 class GlfException : public std::exception 00028 { 00029 public: 00030 /// Constructor that sets the exception to a default status 00031 /// and error message. 00032 GlfException(); 00033 00034 /// Constructor that sets the exception to a default status 00035 /// and the specified error message. 00036 /// \param what_arg error message associated with this exception. 00037 GlfException(const std::string& what_arg); 00038 00039 /// Constructor that sets the exception to the specified status 00040 /// and error message. 00041 /// \param status glf status associated with this exception. 00042 /// \param errorMsg error message associated with this exception. 00043 GlfException(GlfStatus::Status status, const std::string& errorMsg); 00044 00045 /// Constructor that sets the exception to the specified status. 00046 /// \param status glf status associated with this exception. 00047 GlfException(const GlfStatus& status); 00048 00049 virtual ~GlfException() throw(); 00050 00051 /// Returns the error message of this exception. 00052 /// \return errror message 00053 virtual const char* what() const throw(); 00054 00055 private: 00056 GlfStatus myStatus; 00057 }; // end class GlfException 00058 00059 00060 #endif