summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/messaging/Address.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2013-03-23 17:59:50 +0000
committerGordon Sim <gsim@apache.org>2013-03-23 17:59:50 +0000
commitcfa98a776511eb4a713c7e87796bc3fcfaafbe42 (patch)
tree95bbf3dc2b114627fa5d03d394fcf70cd37da6e4 /cpp/src/qpid/messaging/Address.cpp
parent964edfa59bd065b1db97ea16932ef2553ee8ac04 (diff)
downloadqpid-python-cfa98a776511eb4a713c7e87796bc3fcfaafbe42.tar.gz
QPID-4586: fixes for dynamic sources/targets and on demand creation of nodes
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1460198 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/messaging/Address.cpp')
-rw-r--r--cpp/src/qpid/messaging/Address.cpp48
1 files changed, 4 insertions, 44 deletions
diff --git a/cpp/src/qpid/messaging/Address.cpp b/cpp/src/qpid/messaging/Address.cpp
index a516959edb..6fbaeef661 100644
--- a/cpp/src/qpid/messaging/Address.cpp
+++ b/cpp/src/qpid/messaging/Address.cpp
@@ -19,6 +19,8 @@
*
*/
#include "qpid/messaging/Address.h"
+#include "qpid/messaging/AddressImpl.h"
+#include "qpid/messaging/AddressParser.h"
#include "qpid/framing/Uuid.h"
#include <sstream>
#include <boost/format.hpp>
@@ -34,51 +36,9 @@ const std::string OPTIONS_DIVIDER = ";";
const std::string SPACE = " ";
const std::string TYPE = "type";
}
-class AddressImpl
-{
- public:
- std::string name;
- std::string subject;
- Variant::Map options;
-
- AddressImpl() {}
- AddressImpl(const std::string& n, const std::string& s, const Variant::Map& o) :
- name(n), subject(s), options(o) {}
-};
-
-class AddressParser
-{
- public:
- AddressParser(const std::string&);
- bool parse(Address& address);
- private:
- const std::string& input;
- std::string::size_type current;
- static const std::string RESERVED;
-
- bool readChar(char c);
- bool readQuotedString(std::string& s);
- bool readQuotedValue(Variant& value);
- bool readString(std::string& value, char delimiter);
- bool readWord(std::string& word, const std::string& delims = RESERVED);
- bool readSimpleValue(Variant& word);
- bool readKey(std::string& key);
- bool readValue(Variant& value);
- bool readKeyValuePair(Variant::Map& map);
- bool readMap(Variant& value);
- bool readList(Variant& value);
- bool readName(std::string& name);
- bool readSubject(std::string& subject);
- bool error(const std::string& message);
- bool eos();
- bool iswhitespace();
- bool in(const std::string& delims);
- bool isreserved();
-};
-
Address::Address() : impl(new AddressImpl()) {}
Address::Address(const std::string& address) : impl(new AddressImpl())
-{
+{
AddressParser parser(address);
parser.parse(*this);
}
@@ -86,7 +46,7 @@ Address::Address(const std::string& name, const std::string& subject, const Vari
const std::string& type)
: impl(new AddressImpl(name, subject, options)) { setType(type); }
Address::Address(const Address& a) :
- impl(new AddressImpl(a.impl->name, a.impl->subject, a.impl->options)) {}
+ impl(new AddressImpl(a.impl->name, a.impl->subject, a.impl->options)) { impl->temporary = a.impl->temporary; }
Address::~Address() { delete impl; }
Address& Address::operator=(const Address& a) { *impl = *a.impl; return *this; }