Stxxl 1.2.1
|
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 * 00008 * Distributed under the Boost Software License, Version 1.0. 00009 * (See accompanying file LICENSE_1_0.txt or copy at 00010 * http://www.boost.org/LICENSE_1_0.txt) 00011 **************************************************************************/ 00012 00013 #ifndef STXXL_EXCEPTIONS_H_ 00014 #define STXXL_EXCEPTIONS_H_ 00015 00016 #include <iostream> 00017 #include <string> 00018 #include <stdexcept> 00019 00020 #include <stxxl/bits/namespace.h> 00021 00022 00023 __STXXL_BEGIN_NAMESPACE 00024 00025 class io_error : public std::ios_base::failure 00026 { 00027 public: 00028 io_error() throw () : std::ios_base::failure("") { } 00029 io_error(const std::string & msg_) throw () : 00030 std::ios_base::failure(msg_) 00031 { } 00032 }; 00033 00034 class resource_error : public std::runtime_error 00035 { 00036 public: 00037 resource_error() throw () : std::runtime_error("") { } 00038 resource_error(const std::string & msg_) throw () : 00039 std::runtime_error(msg_) 00040 { } 00041 }; 00042 00043 class bad_ext_alloc : public std::runtime_error 00044 { 00045 public: 00046 bad_ext_alloc() throw () : std::runtime_error("") { } 00047 bad_ext_alloc(const std::string & msg_) throw () : 00048 std::runtime_error(msg_) 00049 { } 00050 }; 00051 00052 __STXXL_END_NAMESPACE 00053 00054 #endif // !STXXL_EXCEPTIONS_H_