diff options
author | Alan Conway <aconway@apache.org> | 2008-09-09 14:06:07 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-09-09 14:06:07 +0000 |
commit | 833cf68a5bf58e882f377d144768ceb546e5e036 (patch) | |
tree | 8b2ca57e790956a38c33583970a5c4198b407073 /cpp/src/qpid/client/ConnectionImpl.cpp | |
parent | 7feb5546e82e0d003f26027524ceb07e9b9b0452 (diff) | |
download | qpid-python-833cf68a5bf58e882f377d144768ceb546e5e036.tar.gz |
Generate c++ enum types for AMQP enums in framing/enum.h.
Modified enum scheme to avoid name clashes: namespace amqp_class { EnumName { ENUM_NAME_X=1, ENUM_NAME_X=2 ...}};
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@693465 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/ConnectionImpl.cpp')
-rw-r--r-- | cpp/src/qpid/client/ConnectionImpl.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cpp/src/qpid/client/ConnectionImpl.cpp b/cpp/src/qpid/client/ConnectionImpl.cpp index 5e8596cacb..f623530f98 100644 --- a/cpp/src/qpid/client/ConnectionImpl.cpp +++ b/cpp/src/qpid/client/ConnectionImpl.cpp @@ -24,7 +24,7 @@ #include "SessionImpl.h" #include "qpid/log/Statement.h" -#include "qpid/framing/constants.h" +#include "qpid/framing/enum.h" #include "qpid/framing/reply_exceptions.h" #include <boost/bind.hpp> @@ -32,6 +32,7 @@ using namespace qpid::client; using namespace qpid::framing; +using namespace qpid::framing::connection; using namespace qpid::sys; using namespace qpid::framing::connection;//for connection error codes @@ -46,7 +47,7 @@ ConnectionImpl::ConnectionImpl(framing::ProtocolVersion v, const ConnectionSetti handler.in = boost::bind(&ConnectionImpl::incoming, this, _1); handler.out = boost::bind(&Connector::send, boost::ref(connector), _1); handler.onClose = boost::bind(&ConnectionImpl::closed, this, - NORMAL, std::string()); + CLOSE_CODE_NORMAL, std::string()); connector->setInputHandler(&handler); connector->setShutdownHandler(this); @@ -115,7 +116,7 @@ void ConnectionImpl::close() { if (!handler.isOpen()) return; handler.close(); - closed(NORMAL, "Closed by client"); + closed(CLOSE_CODE_NORMAL, "Closed by client"); } @@ -139,10 +140,10 @@ static const std::string CONN_CLOSED("Connection closed by broker"); void ConnectionImpl::shutdown() { Mutex::ScopedLock l(lock); // FIXME aconway 2008-06-06: exception use, connection-forced is incorrect here. - setException(new ConnectionException(CONNECTION_FORCED, CONN_CLOSED)); + setException(new ConnectionException(CLOSE_CODE_CONNECTION_FORCED, CONN_CLOSED)); if (handler.isClosed()) return; handler.fail(CONN_CLOSED); - closeInternal(boost::bind(&SessionImpl::connectionBroke, _1, CONNECTION_FORCED, CONN_CLOSED)); + closeInternal(boost::bind(&SessionImpl::connectionBroke, _1, CLOSE_CODE_CONNECTION_FORCED, CONN_CLOSED)); } void ConnectionImpl::erase(uint16_t ch) { |