linuxsampler 2.3.1
Exception.h
Go to the documentation of this file.
1/***************************************************************************
2 * *
3 * LinuxSampler - modular, streaming capable sampler *
4 * *
5 * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck *
6 * Copyright (C) 2005, 2006 Christian Schoenebeck *
7 * *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21 * MA 02111-1307 USA *
22 ***************************************************************************/
23
24#ifndef __LS_EXCEPTION_H
25#define __LS_EXCEPTION_H
26
27#include <stdexcept>
28#include <iostream>
29#include "global.h"
30
31namespace LinuxSampler {
32
37 class Exception : public std::runtime_error {
38 public:
44 Exception(const String& msg) : runtime_error(msg) {
45 }
46
51 return what();
52 }
53
58 void PrintMessage() {
59 std::cerr << what() << std::endl << std::flush;
60 }
61 };
62
63} // namespace LinuxSampler
64
65#endif // __LS_EXCEPTION_H
Exception that will be thrown in NON REAL TIME PARTS of the LinuxSampler application.
Definition Exception.h:37
Exception(const String &msg)
Constructor.
Definition Exception.h:44
String Message()
Returns the cause of the exception.
Definition Exception.h:50
void PrintMessage()
Print the cause of the exception to the standard error output channel.
Definition Exception.h:58
std::string String
Definition global.h:44