diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2012-03-28 21:00:40 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2012-03-28 21:00:40 +0000 |
| commit | f02516da02dd2d5707d396d3d7b76406ab66c673 (patch) | |
| tree | c8ffced237d9521707a21065026694295dbd50fe /cpp/src/qpid/client/ConnectionHandler.cpp | |
| parent | e14614102113c3ff0241feefe7759517923b19de (diff) | |
| download | qpid-python-f02516da02dd2d5707d396d3d7b76406ab66c673.tar.gz | |
QPID-3921: C++ header files need tidyup
Tidied up header use of FieldValue.h
- Removed all unnecessary includes of FieldValue.h from other header
files especially Array.h. (This avoids the world recompiling when working
on FieldValue!)
- Corrected up header guards in Array.h
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1306595 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/ConnectionHandler.cpp')
| -rw-r--r-- | cpp/src/qpid/client/ConnectionHandler.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cpp/src/qpid/client/ConnectionHandler.cpp b/cpp/src/qpid/client/ConnectionHandler.cpp index ab0d8e0700..94561f8079 100644 --- a/cpp/src/qpid/client/ConnectionHandler.cpp +++ b/cpp/src/qpid/client/ConnectionHandler.cpp @@ -28,10 +28,13 @@ #include "qpid/framing/all_method_bodies.h" #include "qpid/framing/ClientInvoker.h" #include "qpid/framing/reply_exceptions.h" +#include "qpid/framing/FieldValue.h" #include "qpid/log/Helpers.h" #include "qpid/log/Statement.h" #include "qpid/sys/SystemInfo.h" +#include <algorithm> + using namespace qpid::client; using namespace qpid::framing; using namespace qpid::framing::connection; @@ -238,15 +241,16 @@ void ConnectionHandler::start(const FieldTable& /*serverProps*/, const Array& me ); std::vector<std::string> mechlist; + mechlist.reserve(mechanisms.size()); if (mechanism.empty()) { //mechlist is simply what the server offers - mechanisms.collect(mechlist); + std::transform(mechanisms.begin(), mechanisms.end(), std::back_inserter(mechlist), Array::get<std::string, Array::ValuePtr>); } else { //mechlist is the intersection of those indicated by user and //those supported by server, in the order listed by user std::vector<std::string> allowed = split(mechanism, " "); - std::vector<std::string> supported; - mechanisms.collect(supported); + std::vector<std::string> supported(mechanisms.size()); + std::transform(mechanisms.begin(), mechanisms.end(), std::back_inserter(supported), Array::get<std::string, Array::ValuePtr>); intersection(allowed, supported, mechlist); if (mechlist.empty()) { throw Exception(QPID_MSG("Desired mechanism(s) not valid: " << mechanism << " (supported: " << join(supported) << ")")); |
