Stxxl  1.2.1
exceptions.h
1 /***************************************************************************
2  * include/stxxl/bits/common/exceptions.h
3  *
4  * Part of the STXXL. See http://stxxl.sourceforge.net
5  *
6  * Copyright (C) 2006 Roman Dementiev <dementiev@ira.uka.de>
7  *
8  * Distributed under the Boost Software License, Version 1.0.
9  * (See accompanying file LICENSE_1_0.txt or copy at
10  * http://www.boost.org/LICENSE_1_0.txt)
11  **************************************************************************/
12 
13 #ifndef STXXL_EXCEPTIONS_H_
14 #define STXXL_EXCEPTIONS_H_
15 
16 #include <iostream>
17 #include <string>
18 #include <stdexcept>
19 
20 #include <stxxl/bits/namespace.h>
21 
22 
23 __STXXL_BEGIN_NAMESPACE
24 
25 class io_error : public std::ios_base::failure
26 {
27 public:
28  io_error() throw () : std::ios_base::failure("") { }
29  io_error(const std::string & msg_) throw () :
30  std::ios_base::failure(msg_)
31  { }
32 };
33 
34 class resource_error : public std::runtime_error
35 {
36 public:
37  resource_error() throw () : std::runtime_error("") { }
38  resource_error(const std::string & msg_) throw () :
39  std::runtime_error(msg_)
40  { }
41 };
42 
43 class bad_ext_alloc : public std::runtime_error
44 {
45 public:
46  bad_ext_alloc() throw () : std::runtime_error("") { }
47  bad_ext_alloc(const std::string & msg_) throw () :
48  std::runtime_error(msg_)
49  { }
50 };
51 
52 __STXXL_END_NAMESPACE
53 
54 #endif // !STXXL_EXCEPTIONS_H_