STXXL  1.4.1
 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 
24 
25 class io_error : public std::ios_base::failure
26 {
27 public:
28  io_error() throw ()
29  : std::ios_base::failure("")
30  { }
31 
32  io_error(const std::string& message) throw ()
33  : std::ios_base::failure(message)
34  { }
35 };
36 
37 class resource_error : public std::runtime_error
38 {
39 public:
40  resource_error() throw ()
41  : std::runtime_error("")
42  { }
43 
44  resource_error(const std::string& message) throw ()
45  : std::runtime_error(message)
46  { }
47 };
48 
49 class bad_ext_alloc : public std::runtime_error
50 {
51 public:
52  bad_ext_alloc() throw ()
53  : std::runtime_error("")
54  { }
55 
56  bad_ext_alloc(const std::string& message) throw ()
57  : std::runtime_error(message)
58  { }
59 };
60 
61 class bad_parameter : public std::runtime_error
62 {
63 public:
64  bad_parameter() throw ()
65  : std::runtime_error("")
66  { }
67 
68  bad_parameter(const std::string& message) throw ()
69  : std::runtime_error(message)
70  { }
71 };
72 
73 class unreachable : public std::runtime_error
74 {
75 public:
76  unreachable() throw ()
77  : std::runtime_error("")
78  { }
79 
80  unreachable(const std::string& message) throw ()
81  : std::runtime_error(message)
82  { }
83 };
84 
86 
87 #endif // !STXXL_COMMON_EXCEPTIONS_HEADER
88 // vim: et:ts=4:sw=4
bad_parameter(const std::string &message)
Definition: exceptions.h:68
resource_error(const std::string &message)
Definition: exceptions.h:44
io_error(const std::string &message)
Definition: exceptions.h:32
#define STXXL_BEGIN_NAMESPACE
Definition: namespace.h:16
bad_ext_alloc(const std::string &message)
Definition: exceptions.h:56
unreachable(const std::string &message)
Definition: exceptions.h:80
#define STXXL_END_NAMESPACE
Definition: namespace.h:17