00001 #ifndef _BOOST_CMT_ERROR_HPP_
00002 #define _BOOST_CMT_ERROR_HPP_
00003 #include <boost/exception/all.hpp>
00004
00005 namespace boost { namespace cmt {
00006 namespace error {
00007 struct future_exception : public std::exception, public virtual boost::exception {
00008 const char* what()const throw() { return "future exception"; }
00009 virtual void rethrow()const { BOOST_THROW_EXCEPTION(*this); }
00010 };
00011
00012 struct null_future : public virtual future_exception {
00013 const char* what()const throw() { return "attempt to access null future"; }
00014 virtual void rethrow()const { BOOST_THROW_EXCEPTION(*this); }
00015 };
00016
00017 struct future_value_not_ready : public virtual future_exception {
00018 const char* what()const throw() { return "the future value is not ready"; }
00019 virtual void rethrow()const { BOOST_THROW_EXCEPTION(*this); }
00020 };
00021
00022 struct future_wait_timeout : public virtual future_exception {
00023 const char* what()const throw() { return "timeout waiting for future"; }
00024 virtual void rethrow()const { BOOST_THROW_EXCEPTION(*this); }
00025 };
00026
00027 struct broken_promise : public virtual future_exception {
00028 const char* what()const throw() { return "broken promise - operation timeout"; }
00029 virtual void rethrow()const { BOOST_THROW_EXCEPTION(*this); }
00030 };
00031
00032 struct task_canceled : public virtual future_exception {
00033 const char* what()const throw() { return "task canceled"; }
00034 virtual void rethrow()const { BOOST_THROW_EXCEPTION(*this); }
00035 };
00036 struct thread_quit : public virtual future_exception {
00037 const char* what()const throw() { return "thread quit"; }
00038 virtual void rethrow()const { BOOST_THROW_EXCEPTION(*this); }
00039 };
00040 }
00041 } }
00042
00043 #endif // _BOOST_CMT_ERROR_HPP_