STXXL  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
exceptions.h
Go to the documentation of this file.
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 <[email protected]>
7  * Copyright (C) 2009 Andreas Beckmann <[email protected]>
8  *
9  * Distributed under the Boost Software License, Version 1.0.
10  * (See accompanying file LICENSE_1_0.txt or copy at
11  * http://www.boost.org/LICENSE_1_0.txt)
12  **************************************************************************/
13 
14 #ifndef STXXL_COMMON_EXCEPTIONS_HEADER
15 #define STXXL_COMMON_EXCEPTIONS_HEADER
16 
17 #include <iostream>
18 #include <string>
19 #include <stdexcept>
20 
21 #include <stxxl/bits/namespace.h>
22 
23 
25 
26 class io_error : public std::ios_base::failure
27 {
28 public:
29  io_error() throw () :
30  std::ios_base::failure("")
31  { }
32 
33  io_error(const std::string& msg_) throw () :
34  std::ios_base::failure(msg_)
35  { }
36 };
37 
38 class resource_error : public std::runtime_error
39 {
40 public:
41  resource_error() throw () :
42  std::runtime_error("")
43  { }
44 
45  resource_error(const std::string& msg_) throw () :
46  std::runtime_error(msg_)
47  { }
48 };
49 
50 class bad_ext_alloc : public std::runtime_error
51 {
52 public:
53  bad_ext_alloc() throw () :
54  std::runtime_error("")
55  { }
56 
57  bad_ext_alloc(const std::string& msg_) throw () :
58  std::runtime_error(msg_)
59  { }
60 };
61 
62 class bad_parameter : public std::runtime_error
63 {
64 public:
65  bad_parameter() throw () :
66  std::runtime_error("")
67  { }
68 
69  bad_parameter(const std::string& msg_) throw () :
70  std::runtime_error(msg_)
71  { }
72 };
73 
74 class unreachable : public std::runtime_error
75 {
76 public:
77  unreachable() throw () :
78  std::runtime_error("")
79  { }
80 
81  unreachable(const std::string& msg_) throw () :
82  std::runtime_error(msg_)
83  { }
84 };
85 
87 
88 #endif // !STXXL_COMMON_EXCEPTIONS_HEADER
89 // vim: et:ts=4:sw=4
io_error(const std::string &msg_)
Definition: exceptions.h:33
bad_parameter(const std::string &msg_)
Definition: exceptions.h:69
resource_error(const std::string &msg_)
Definition: exceptions.h:45
#define STXXL_BEGIN_NAMESPACE
Definition: namespace.h:16
bad_ext_alloc(const std::string &msg_)
Definition: exceptions.h:57
unreachable(const std::string &msg_)
Definition: exceptions.h:81
#define STXXL_END_NAMESPACE
Definition: namespace.h:17