TPIE

v1.1rc1-6-g0c97303
exception.h
Go to the documentation of this file.
1 // -*- mode: c++; tab-width: 4; indent-tabs-mode: t; eval: (progn (c-set-style "stroustrup") (c-set-offset 'innamespace 0)); -*-
2 // vi:set ts=4 sts=4 sw=4 noet :
3 // Copyright 2008, The TPIE development team
4 //
5 // This file is part of TPIE.
6 //
7 // TPIE is free software: you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License as published by the
9 // Free Software Foundation, either version 3 of the License, or (at your
10 // option) any later version.
11 //
12 // TPIE is distributed in the hope that it will be useful, but WITHOUT ANY
13 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 // License for more details.
16 //
17 // You should have received a copy of the GNU Lesser General Public License
18 // along with TPIE. If not, see <http://www.gnu.org/licenses/>
19 
25 
26 #ifndef __TPIE_EXCEPTION_H__
27 #define __TPIE_EXCEPTION_H__
28 #include <stdexcept>
29 
30 namespace tpie {
31 
32 struct exception: public std::runtime_error {
33  exception(const std::string & s): std::runtime_error(s) {};
34 };
35 
37  invalid_argument_exception(const std::string & s): exception(s) {};
38 };
39 
40 struct stream_exception : public exception {
41  stream_exception(): exception("") {};
42  stream_exception(const std::string & s): exception(s) {};
43 };
44 
46  io_exception(const std::string & s): stream_exception(s) {};
47 };
48 
50  out_of_space_exception(const std::string & s): io_exception(s) {};
51 };
52 
54  invalid_file_exception(const std::string & s): stream_exception(s) {};
55 };
56 
59 };
60 
63 };
64 
65 }
66 #endif //__TPIE_EXCEPTION_H__