Thrill  0.1
exceptions.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * foxxll/common/exceptions.hpp
3  *
4  * Part of FOXXLL. See http://foxxll.org
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 FOXXLL_COMMON_EXCEPTIONS_HEADER
15 #define FOXXLL_COMMON_EXCEPTIONS_HEADER
16 
17 #include <iostream>
18 #include <stdexcept>
19 #include <string>
20 
21 namespace foxxll {
22 
23 class io_error : public std::ios_base::failure
24 {
25 public:
26  io_error() noexcept
27  : std::ios_base::failure("")
28  { }
29 
30  explicit io_error(const std::string& message) noexcept
31  : std::ios_base::failure(message)
32  { }
33 };
34 
35 class resource_error : public std::runtime_error
36 {
37 public:
38  resource_error() noexcept
39  : std::runtime_error("")
40  { }
41 
42  explicit resource_error(const std::string& message) noexcept
43  : std::runtime_error(message)
44  { }
45 };
46 
47 class bad_ext_alloc : public std::runtime_error
48 {
49 public:
50  bad_ext_alloc() noexcept
51  : std::runtime_error("")
52  { }
53 
54  explicit bad_ext_alloc(const std::string& message) noexcept
55  : std::runtime_error(message)
56  { }
57 };
58 
59 class bad_parameter : public std::runtime_error
60 {
61 public:
62  bad_parameter() noexcept
63  : std::runtime_error("")
64  { }
65 
66  explicit bad_parameter(const std::string& message) noexcept
67  : std::runtime_error(message)
68  { }
69 };
70 
71 class unreachable : public std::runtime_error
72 {
73 public:
74  unreachable() noexcept
75  : std::runtime_error("")
76  { }
77 
78  explicit unreachable(const std::string& message) noexcept
79  : std::runtime_error(message)
80  { }
81 };
82 
83 } // namespace foxxll
84 
85 #endif // !FOXXLL_COMMON_EXCEPTIONS_HEADER
86 
87 /**************************************************************************/
bad_ext_alloc(const std::string &message) noexcept
Definition: exceptions.hpp:54
bad_ext_alloc() noexcept
Definition: exceptions.hpp:50
STL namespace.
resource_error() noexcept
Definition: exceptions.hpp:38
bad_parameter() noexcept
Definition: exceptions.hpp:62
FOXXLL library namespace
std::basic_string< char, std::char_traits< char >, Allocator< char > > string
string with Manager tracking
Definition: allocator.hpp:220
io_error() noexcept
Definition: exceptions.hpp:26
unreachable(const std::string &message) noexcept
Definition: exceptions.hpp:78
io_error(const std::string &message) noexcept
Definition: exceptions.hpp:30
unreachable() noexcept
Definition: exceptions.hpp:74
bad_parameter(const std::string &message) noexcept
Definition: exceptions.hpp:66
resource_error(const std::string &message) noexcept
Definition: exceptions.hpp:42