diff options
author | Ted Ross <tross@apache.org> | 2010-07-28 18:35:15 +0000 |
---|---|---|
committer | Ted Ross <tross@apache.org> | 2010-07-28 18:35:15 +0000 |
commit | 1c077959ef54f616ec12e9644b4f07557a3e220d (patch) | |
tree | 90e1adeb4285b64073971d0facf016569b142f26 /cpp/src/qpid/messaging | |
parent | 1939f9db799507eabfc7eb1daa74e3cb31b5b252 (diff) | |
download | qpid-python-1c077959ef54f616ec12e9644b4f07557a3e220d.tar.gz |
Made the new C++ API more friendly for swig-wrapping.
- Added Message::setProperty() as an alternative to using getProperties() to obtain
a writable reference to a Variant::Map.
- Added unit testing for this new method.
- Added #ifndef SWIG conditions around the declarations of non-member operator<< methods.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@980147 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/messaging')
-rw-r--r-- | cpp/src/qpid/messaging/Message.cpp | 1 | ||||
-rw-r--r-- | cpp/src/qpid/messaging/MessageImpl.cpp | 1 | ||||
-rw-r--r-- | cpp/src/qpid/messaging/MessageImpl.h | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/cpp/src/qpid/messaging/Message.cpp b/cpp/src/qpid/messaging/Message.cpp index 524af023e1..83cdfd3c55 100644 --- a/cpp/src/qpid/messaging/Message.cpp +++ b/cpp/src/qpid/messaging/Message.cpp @@ -68,6 +68,7 @@ void Message::setRedelivered(bool redelivered) { impl->redelivered = redelivered const Variant::Map& Message::getProperties() const { return impl->getHeaders(); } Variant::Map& Message::getProperties() { return impl->getHeaders(); } +void Message::setProperty(const std::string& k, const qpid::types::Variant& v) { impl->setHeader(k,v); } void Message::setContent(const std::string& c) { impl->setBytes(c); } void Message::setContent(const char* chars, size_t count) { impl->setBytes(chars, count); } diff --git a/cpp/src/qpid/messaging/MessageImpl.cpp b/cpp/src/qpid/messaging/MessageImpl.cpp index 6138ab4a2c..0601800e46 100644 --- a/cpp/src/qpid/messaging/MessageImpl.cpp +++ b/cpp/src/qpid/messaging/MessageImpl.cpp @@ -56,6 +56,7 @@ const std::string& MessageImpl::getContentType() const { return contentType; } const Variant::Map& MessageImpl::getHeaders() const { return headers; } Variant::Map& MessageImpl::getHeaders() { return headers; } +void MessageImpl::setHeader(const std::string& key, const qpid::types::Variant& val) { headers[key] = val; } //should these methods be on MessageContent? void MessageImpl::setBytes(const std::string& c) { bytes = c; } diff --git a/cpp/src/qpid/messaging/MessageImpl.h b/cpp/src/qpid/messaging/MessageImpl.h index 7793fc7943..57df6b3fda 100644 --- a/cpp/src/qpid/messaging/MessageImpl.h +++ b/cpp/src/qpid/messaging/MessageImpl.h @@ -60,6 +60,7 @@ struct MessageImpl const qpid::types::Variant::Map& getHeaders() const; qpid::types::Variant::Map& getHeaders(); + void setHeader(const std::string& key, const qpid::types::Variant& val); void setBytes(const std::string& bytes); void setBytes(const char* chars, size_t count); |