source: NonGTP/Boost/boost/thread/exceptions.hpp @ 857

Revision 857, 2.7 KB checked in by igarcia, 19 years ago (diff)
Line 
1// Copyright (C) 2001-2003
2// William E. Kempf
3//
4// Permission to use, copy, modify, distribute and sell this software
5// and its documentation for any purpose is hereby granted without fee,
6// provided that the above copyright notice appear in all copies and
7// that both that copyright notice and this permission notice appear
8// in supporting documentation.  William E. Kempf makes no representations
9// about the suitability of this software for any purpose.
10// It is provided "as is" without express or implied warranty.
11
12#ifndef BOOST_THREAD_EXCEPTIONS_PDM070801_H
13#define BOOST_THREAD_EXCEPTIONS_PDM070801_H
14
15#include <boost/thread/detail/config.hpp>
16
17//  pdm: Sorry, but this class is used all over the place & I end up
18//       with recursive headers if I don't separate it
19//  wek: Not sure why recursive headers would cause compilation problems
20//       given the include guards, but regardless it makes sense to
21//       seperate this out any way.
22
23#include <string>
24#include <stdexcept>
25
26namespace boost {
27
28class BOOST_THREAD_DECL thread_exception : public std::exception
29{
30protected:
31    thread_exception();
32    thread_exception(int sys_err_code);
33
34public:
35    ~thread_exception() throw();
36
37    int native_error() const;
38
39    const char* message() const;
40
41private:
42    int m_sys_err;
43};
44
45class BOOST_THREAD_DECL lock_error : public thread_exception
46{
47public:
48    lock_error();
49    lock_error(int sys_err_code);
50    ~lock_error() throw();
51
52    virtual const char* what() const throw();
53};
54
55class BOOST_THREAD_DECL thread_resource_error : public thread_exception
56{
57public:
58    thread_resource_error();
59    thread_resource_error(int sys_err_code);
60    ~thread_resource_error() throw();
61
62    virtual const char* what() const throw();
63};
64
65class BOOST_THREAD_DECL unsupported_thread_option : public thread_exception
66{
67public:
68    unsupported_thread_option();
69    unsupported_thread_option(int sys_err_code);
70    ~unsupported_thread_option() throw();
71
72    virtual const char* what() const throw();
73};
74
75class BOOST_THREAD_DECL invalid_thread_argument : public thread_exception
76{
77public:
78    invalid_thread_argument();
79    invalid_thread_argument(int sys_err_code);
80    ~invalid_thread_argument() throw();
81
82    virtual const char* what() const throw();
83};
84
85class BOOST_THREAD_DECL thread_permission_error : public thread_exception
86{
87public:
88    thread_permission_error();
89    thread_permission_error(int sys_err_code);
90    ~thread_permission_error() throw();
91
92    virtual const char* what() const throw();
93};
94
95} // namespace boost
96
97#endif // BOOST_THREAD_CONFIG_PDM070801_H
98
99// Change log:
100//    3 Jan 03  WEKEMPF Modified for DLL implementation.
101
Note: See TracBrowser for help on using the repository browser.