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/QpidError.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/QpidError.h')
-rw-r--r-- | cpp/src/qpid/QpidError.h | 50 |
1 files changed, 34 insertions, 16 deletions
diff --git a/cpp/src/qpid/QpidError.h b/cpp/src/qpid/QpidError.h index 79ccd2f579..5d7aa93674 100644 --- a/cpp/src/qpid/QpidError.h +++ b/cpp/src/qpid/QpidError.h @@ -21,29 +21,47 @@ * */ #include <string> +#include <memory> +#include <ostream> #include <qpid/Exception.h> namespace qpid { - class QpidError : public Exception { - public: - const int code; - const std::string msg; - const std::string file; - const int line; +struct SrcLine { + public: + SrcLine(const std::string& file_="", int line_=0) : + file(file_), line(line_) {} - QpidError(int _code, const std::string& _msg, const std::string& _file, int _line) throw(); - ~QpidError() throw(); - }; + std::string file; + int line; +}; + +class QpidError : public Exception { + public: + const int code; + const std::string msg; + const SrcLine location; -#define THROW_QPID_ERROR(A, B) throw QpidError(A, B, __FILE__, __LINE__) + QpidError(); + QpidError(int _code, const std::string& _msg, const SrcLine& _loc) throw(); + ~QpidError() throw(); + Exception* clone() const throw(); + void throwSelf() const; +}; -} -#define PROTOCOL_ERROR 10000 -#define APR_ERROR 20000 -#define FRAMING_ERROR 30000 -#define CLIENT_ERROR 40000 -#define INTERNAL_ERROR 50000 +} // namespace qpid + +#define SRCLINE ::qpid::SrcLine(__FILE__, __LINE__) + +#define QPID_ERROR(CODE, MESSAGE) ::qpid::QpidError((CODE), (MESSAGE), SRCLINE) + +#define THROW_QPID_ERROR(CODE, MESSAGE) throw QPID_ERROR(CODE,MESSAGE) + +const int PROTOCOL_ERROR = 10000; +const int APR_ERROR = 20000; +const int FRAMING_ERROR = 30000; +const int CLIENT_ERROR = 40000; +const int INTERNAL_ERROR = 50000; #endif |