Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 10:09:28

0001 // Copyright (C) 2001-2003
0002 // William E. Kempf
0003 // Copyright (C) 2007-9 Anthony Williams
0004 // (C) Copyright 2011-2012 Vicente J. Botet Escriba
0005 //
0006 //  Distributed under the Boost Software License, Version 1.0. (See accompanying
0007 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 #ifndef BOOST_THREAD_EXCEPTIONS_PDM070801_H
0010 #define BOOST_THREAD_EXCEPTIONS_PDM070801_H
0011 
0012 #include <boost/thread/detail/config.hpp>
0013 
0014 //  pdm: Sorry, but this class is used all over the place & I end up
0015 //       with recursive headers if I don't separate it
0016 //  wek: Not sure why recursive headers would cause compilation problems
0017 //       given the include guards, but regardless it makes sense to
0018 //       seperate this out any way.
0019 
0020 #include <string>
0021 #include <stdexcept>
0022 #include <boost/system/system_error.hpp>
0023 #include <boost/system/error_code.hpp>
0024 
0025 
0026 #include <boost/config/abi_prefix.hpp>
0027 
0028 namespace boost
0029 {
0030 
0031 #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
0032     class BOOST_SYMBOL_VISIBLE thread_interrupted
0033     {};
0034 #endif
0035 
0036     class BOOST_SYMBOL_VISIBLE thread_exception:
0037         public system::system_error
0038         //public std::exception
0039     {
0040           typedef system::system_error base_type;
0041     public:
0042         thread_exception()
0043           : base_type(0,system::generic_category())
0044         {}
0045 
0046         thread_exception(int sys_error_code)
0047           : base_type(sys_error_code, system::generic_category())
0048         {}
0049 
0050         thread_exception( int ev, const char * what_arg )
0051         : base_type(system::error_code(ev, system::generic_category()), what_arg)
0052         {
0053         }
0054         thread_exception( int ev, const std::string & what_arg )
0055         : base_type(system::error_code(ev, system::generic_category()), what_arg)
0056         {
0057         }
0058 
0059         ~thread_exception() BOOST_NOEXCEPT_OR_NOTHROW
0060         {}
0061 
0062 
0063         int native_error() const
0064         {
0065             return code().value();
0066         }
0067 
0068     };
0069 
0070     class BOOST_SYMBOL_VISIBLE condition_error:
0071         public system::system_error
0072         //public std::exception
0073     {
0074           typedef system::system_error base_type;
0075     public:
0076           condition_error()
0077           : base_type(system::error_code(0, system::generic_category()), "Condition error")
0078           {}
0079           condition_error( int ev )
0080           : base_type(system::error_code(ev, system::generic_category()), "Condition error")
0081           {
0082           }
0083           condition_error( int ev, const char * what_arg )
0084           : base_type(system::error_code(ev, system::generic_category()), what_arg)
0085           {
0086           }
0087           condition_error( int ev, const std::string & what_arg )
0088           : base_type(system::error_code(ev, system::generic_category()), what_arg)
0089           {
0090           }
0091     };
0092 
0093 
0094     class BOOST_SYMBOL_VISIBLE lock_error:
0095         public thread_exception
0096     {
0097           typedef thread_exception base_type;
0098     public:
0099         lock_error()
0100         : base_type(0, "boost::lock_error")
0101         {}
0102 
0103         lock_error( int ev )
0104         : base_type(ev, "boost::lock_error")
0105         {
0106         }
0107         lock_error( int ev, const char * what_arg )
0108         : base_type(ev, what_arg)
0109         {
0110         }
0111         lock_error( int ev, const std::string & what_arg )
0112         : base_type(ev, what_arg)
0113         {
0114         }
0115 
0116         ~lock_error() BOOST_NOEXCEPT_OR_NOTHROW
0117         {}
0118 
0119     };
0120 
0121     class BOOST_SYMBOL_VISIBLE thread_resource_error:
0122         public thread_exception
0123     {
0124           typedef thread_exception base_type;
0125     public:
0126           thread_resource_error()
0127           : base_type(static_cast<int>(system::errc::resource_unavailable_try_again), "boost::thread_resource_error")
0128           {}
0129 
0130           thread_resource_error( int ev )
0131           : base_type(ev, "boost::thread_resource_error")
0132           {
0133           }
0134           thread_resource_error( int ev, const char * what_arg )
0135           : base_type(ev, what_arg)
0136           {
0137           }
0138           thread_resource_error( int ev, const std::string & what_arg )
0139           : base_type(ev, what_arg)
0140           {
0141           }
0142 
0143 
0144         ~thread_resource_error() BOOST_NOEXCEPT_OR_NOTHROW
0145         {}
0146 
0147     };
0148 
0149     class BOOST_SYMBOL_VISIBLE unsupported_thread_option:
0150         public thread_exception
0151     {
0152           typedef thread_exception base_type;
0153     public:
0154           unsupported_thread_option()
0155           : base_type(static_cast<int>(system::errc::invalid_argument), "boost::unsupported_thread_option")
0156           {}
0157 
0158           unsupported_thread_option( int ev )
0159           : base_type(ev, "boost::unsupported_thread_option")
0160           {
0161           }
0162           unsupported_thread_option( int ev, const char * what_arg )
0163           : base_type(ev, what_arg)
0164           {
0165           }
0166           unsupported_thread_option( int ev, const std::string & what_arg )
0167           : base_type(ev, what_arg)
0168           {
0169           }
0170 
0171     };
0172 
0173     class BOOST_SYMBOL_VISIBLE invalid_thread_argument:
0174         public thread_exception
0175     {
0176           typedef thread_exception base_type;
0177     public:
0178         invalid_thread_argument()
0179         : base_type(static_cast<int>(system::errc::invalid_argument), "boost::invalid_thread_argument")
0180         {}
0181 
0182         invalid_thread_argument( int ev )
0183         : base_type(ev, "boost::invalid_thread_argument")
0184         {
0185         }
0186         invalid_thread_argument( int ev, const char * what_arg )
0187         : base_type(ev, what_arg)
0188         {
0189         }
0190         invalid_thread_argument( int ev, const std::string & what_arg )
0191         : base_type(ev, what_arg)
0192         {
0193         }
0194 
0195     };
0196 
0197     class BOOST_SYMBOL_VISIBLE thread_permission_error:
0198         public thread_exception
0199     {
0200           typedef thread_exception base_type;
0201     public:
0202           thread_permission_error()
0203           : base_type(static_cast<int>(system::errc::permission_denied), "boost::thread_permission_error")
0204           {}
0205 
0206           thread_permission_error( int ev )
0207           : base_type(ev, "boost::thread_permission_error")
0208           {
0209           }
0210           thread_permission_error( int ev, const char * what_arg )
0211           : base_type(ev, what_arg)
0212           {
0213           }
0214           thread_permission_error( int ev, const std::string & what_arg )
0215           : base_type(ev, what_arg)
0216           {
0217           }
0218 
0219     };
0220 
0221 } // namespace boost
0222 
0223 #include <boost/config/abi_suffix.hpp>
0224 
0225 #endif