From b13e1a24fcca8797b7be5a242f164afbe17ec4f6 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Wed, 29 Nov 2006 14:36:08 +0000 Subject: 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 --- cpp/src/qpid/QpidError.h | 50 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 16 deletions(-) (limited to 'cpp/src/qpid/QpidError.h') 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 +#include +#include #include 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 -- cgit v1.2.1