Gaia
baseexception.h
1 /*
2  * Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
3  *
4  * This file is part of Gaia
5  *
6  * Gaia is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License as published by the Free
8  * Software Foundation (FSF), either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14  * details.
15  *
16  * You should have received a copy of the Affero GNU General Public License
17  * version 3 along with this program. If not, see http://www.gnu.org/licenses/
18  */
19 
20 #ifndef GAIA_BASEEXCEPTION_H
21 #define GAIA_BASEEXCEPTION_H
22 
23 #include <exception>
24 #include <string>
25 
26 namespace gaia2std {
27 
28 class GException : public std::exception {
29  protected:
30  std::string _message;
31 
32  public:
33  GException() : exception() {}
34  GException(const char* msg) : exception(), _message(msg) {}
35  GException(const std::string& msg) : exception(), _message(msg) {}
36 
37  virtual ~GException() throw() {}
38  virtual const char* what() const throw() { return _message.c_str(); }
39 
40  const std::string& message() const throw() { return _message; }
41 };
42 
43 } // namespace gaia2std
44 
45 #endif // GAIA_BASEEXCEPTION_H
Definition: baseexception.h:26
Definition: baseexception.h:28