diff options
author | Alan Conway <aconway@apache.org> | 2006-11-29 14:36:08 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2006-11-29 14:36:08 +0000 |
commit | b13e1a24fcca8797b7be5a242f164afbe17ec4f6 (patch) | |
tree | ef0362e52c125bc75b07ef3e374dabfa52254e98 /cpp/src/qpid/Exception.h | |
parent | 16d818e749462daf5e0e43079b2e48991646c619 (diff) | |
download | qpid-python-b13e1a24fcca8797b7be5a242f164afbe17ec4f6.tar.gz |
Posix EventChannel implementation using epoll. Placeholder for kevents.
Dynamic thread pool EventChannelThreads to serve EventChannel.
Misc cleanup/enhancements.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@480582 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/Exception.h')
-rw-r--r-- | cpp/src/qpid/Exception.h | 43 |
1 files changed, 13 insertions, 30 deletions
diff --git a/cpp/src/qpid/Exception.h b/cpp/src/qpid/Exception.h index 2aba43586d..f35d427bb0 100644 --- a/cpp/src/qpid/Exception.h +++ b/cpp/src/qpid/Exception.h @@ -25,6 +25,7 @@ #include <exception> #include <string> #include <memory> +#include <boost/shared_ptr.hpp> namespace qpid { @@ -37,42 +38,24 @@ class Exception : public std::exception std::string whatStr; public: - Exception() throw() {} - Exception(const std::string& str) throw() : whatStr(str) {} - Exception(const char* str) throw() : whatStr(str) {} + Exception() throw(); + Exception(const std::string& str) throw(); + Exception(const char* str) throw(); + Exception(const std::exception&) throw(); + virtual ~Exception() throw(); - virtual const char* what() const throw() { return whatStr.c_str(); } - virtual std::string toString() const throw() { return whatStr; } + virtual const char* what() const throw(); + virtual std::string toString() const throw(); + + virtual Exception* clone() const throw(); + virtual void throwSelf() const; + + typedef boost::shared_ptr<Exception> shared_ptr; }; -/** - * Wrapper for heap-allocated exceptions. Use like this: - * <code> - * std::auto_ptr<Exception> ex = new SomeEx(...) - * HeapException hex(ex); // Takes ownership - * throw hex; // Auto-deletes ex - * </code> - */ -class HeapException : public Exception, public std::auto_ptr<Exception> -{ - public: - HeapException() {} - HeapException(std::auto_ptr<Exception> e) : std::auto_ptr<Exception>(e) {} - HeapException& operator=(std::auto_ptr<Exception>& e) { - std::auto_ptr<Exception>::operator=(e); - return *this; - } - ~HeapException() throw() {} - - virtual const char* what() const throw() { return (*this)->what(); } - virtual std::string toString() const throw() { - return (*this)->toString(); - } -}; - } #endif /*!_Exception_*/ |