Stxxl
1.4.0
|
00001 /*************************************************************************** 00002 * include/stxxl/bits/common/exceptions.h 00003 * 00004 * Part of the STXXL. See http://stxxl.sourceforge.net 00005 * 00006 * Copyright (C) 2006 Roman Dementiev <dementiev@ira.uka.de> 00007 * Copyright (C) 2009 Andreas Beckmann <beckmann@cs.uni-frankfurt.de> 00008 * 00009 * Distributed under the Boost Software License, Version 1.0. 00010 * (See accompanying file LICENSE_1_0.txt or copy at 00011 * http://www.boost.org/LICENSE_1_0.txt) 00012 **************************************************************************/ 00013 00014 #ifndef STXXL_EXCEPTIONS_H_ 00015 #define STXXL_EXCEPTIONS_H_ 00016 00017 #include <iostream> 00018 #include <string> 00019 #include <stdexcept> 00020 00021 #include <stxxl/bits/namespace.h> 00022 00023 00024 __STXXL_BEGIN_NAMESPACE 00025 00026 class io_error : public std::ios_base::failure 00027 { 00028 public: 00029 io_error() throw () : 00030 std::ios_base::failure("") 00031 { } 00032 00033 io_error(const std::string & msg_) throw () : 00034 std::ios_base::failure(msg_) 00035 { } 00036 }; 00037 00038 class resource_error : public std::runtime_error 00039 { 00040 public: 00041 resource_error() throw () : 00042 std::runtime_error("") 00043 { } 00044 00045 resource_error(const std::string & msg_) throw () : 00046 std::runtime_error(msg_) 00047 { } 00048 }; 00049 00050 class bad_ext_alloc : public std::runtime_error 00051 { 00052 public: 00053 bad_ext_alloc() throw () : 00054 std::runtime_error("") 00055 { } 00056 00057 bad_ext_alloc(const std::string & msg_) throw () : 00058 std::runtime_error(msg_) 00059 { } 00060 }; 00061 00062 class bad_parameter : public std::runtime_error 00063 { 00064 public: 00065 bad_parameter() throw () : 00066 std::runtime_error("") 00067 { } 00068 00069 bad_parameter(const std::string & msg_) throw () : 00070 std::runtime_error(msg_) 00071 { } 00072 }; 00073 00074 class unreachable : public std::runtime_error 00075 { 00076 public: 00077 unreachable() throw () : 00078 std::runtime_error("") 00079 { } 00080 00081 unreachable(const std::string & msg_) throw () : 00082 std::runtime_error(msg_) 00083 { } 00084 }; 00085 00086 __STXXL_END_NAMESPACE 00087 00088 #endif // !STXXL_EXCEPTIONS_H_ 00089 // vim: et:ts=4:sw=4