summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/messaging
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2010-03-31 16:17:17 +0000
committerGordon Sim <gsim@apache.org>2010-03-31 16:17:17 +0000
commitf6f1900eb98cc1773a88a3ec309afa646438a384 (patch)
tree68e50e7aa1819afd283d73700965b539355a779d /cpp/src/qpid/messaging
parent887281838e4bf7825189ce3b0a8d7509789e6a08 (diff)
downloadqpid-python-f6f1900eb98cc1773a88a3ec309afa646438a384.tar.gz
QPID-664: made changes suggested by Alan Conway, also moved 0-10 map/list codecs to common lib
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@929606 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/messaging')
-rw-r--r--cpp/src/qpid/messaging/Address.cpp12
-rw-r--r--cpp/src/qpid/messaging/Connection.cpp7
-rw-r--r--cpp/src/qpid/messaging/ListContent.cpp106
-rw-r--r--cpp/src/qpid/messaging/ListView.cpp65
-rw-r--r--cpp/src/qpid/messaging/MapContent.cpp96
-rw-r--r--cpp/src/qpid/messaging/MapView.cpp65
-rw-r--r--cpp/src/qpid/messaging/Message.cpp71
-rw-r--r--cpp/src/qpid/messaging/MessageImpl.cpp4
-rw-r--r--cpp/src/qpid/messaging/Receiver.cpp4
-rw-r--r--cpp/src/qpid/messaging/Sender.cpp2
-rw-r--r--cpp/src/qpid/messaging/Session.cpp4
11 files changed, 77 insertions, 359 deletions
diff --git a/cpp/src/qpid/messaging/Address.cpp b/cpp/src/qpid/messaging/Address.cpp
index 2902b8fc4b..0c522888e7 100644
--- a/cpp/src/qpid/messaging/Address.cpp
+++ b/cpp/src/qpid/messaging/Address.cpp
@@ -92,7 +92,7 @@ Address::~Address() { delete impl; }
Address& Address::operator=(const Address& a) { *impl = *a.impl; return *this; }
-std::string Address::toStr() const
+std::string Address::str() const
{
std::stringstream out;
out << impl->name;
@@ -106,7 +106,6 @@ bool Address::operator !() const { return impl->name.empty(); }
const std::string& Address::getName() const { return impl->name; }
void Address::setName(const std::string& name) { impl->name = name; }
const std::string& Address::getSubject() const { return impl->subject; }
-bool Address::hasSubject() const { return !(impl->subject.empty()); }
void Address::setSubject(const std::string& subject) { impl->subject = subject; }
const Variant::Map& Address::getOptions() const { return impl->options; }
Variant::Map& Address::getOptions() { return impl->options; }
@@ -128,7 +127,7 @@ const Variant& find(const Variant::Map& map, const std::string& key)
std::string Address::getType() const
{
- const Variant& props = getOption(NODE_PROPERTIES);
+ const Variant& props = find(impl->options, NODE_PROPERTIES);
if (props.getType() == VAR_MAP) {
const Variant& type = find(props.asMap(), TYPE);
if (!type.isVoid()) return type.asString();
@@ -143,14 +142,9 @@ void Address::setType(const std::string& type)
props.asMap()[TYPE] = type;
}
-const Variant& Address::getOption(const std::string& key) const
-{
- return find(impl->options, key);
-}
-
std::ostream& operator<<(std::ostream& out, const Address& address)
{
- out << address.toStr();
+ out << address.str();
return out;
}
diff --git a/cpp/src/qpid/messaging/Connection.cpp b/cpp/src/qpid/messaging/Connection.cpp
index 853ba1d100..b9437c7931 100644
--- a/cpp/src/qpid/messaging/Connection.cpp
+++ b/cpp/src/qpid/messaging/Connection.cpp
@@ -56,11 +56,10 @@ Connection::Connection(const Variant::Map& options)
void Connection::open(const std::string& url) { impl->open(url); }
void Connection::close() { impl->close(); }
-Session Connection::newSession(const char* name) { return impl->newSession(false, name); }
-Session Connection::newSession(const std::string& name) { return impl->newSession(false, name); }
-Session Connection::newSession(bool transactional, const std::string& name)
+Session Connection::createSession(const std::string& name) { return impl->newSession(false, name); }
+Session Connection::createTransactionalSession(const std::string& name)
{
- return impl->newSession(transactional, name);
+ return impl->newSession(true, name);
}
Session Connection::getSession(const std::string& name) const { return impl->getSession(name); }
void Connection::setOption(const std::string& name, const Variant& value)
diff --git a/cpp/src/qpid/messaging/ListContent.cpp b/cpp/src/qpid/messaging/ListContent.cpp
deleted file mode 100644
index 4bd990e062..0000000000
--- a/cpp/src/qpid/messaging/ListContent.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#include "qpid/messaging/ListContent.h"
-#include "qpid/messaging/Message.h"
-#include "qpid/client/amqp0_10/Codecs.h"
-
-namespace qpid {
-namespace messaging {
-
-using namespace qpid::types;
-
-class ListContentImpl : public Variant
-{
- Message* msg;
- public:
- ListContentImpl(Message& m) : Variant(Variant::List()), msg(&m)
- {
- if (msg->getContent().size()) {
- qpid::client::amqp0_10::ListCodec codec;
- codec.decode(msg->getContent(), *this);
- }
- }
-
- ListContentImpl(Message& m, const Variant::List& i) : Variant(i), msg(&m)
- {
- msg->getContent().clear();
- }
-
- void encode()
- {
- qpid::client::amqp0_10::ListCodec codec;
- codec.encode(*this, msg->getContent());
- }
-};
-
-ListContent::ListContent(Message& m) : impl(new ListContentImpl(m)) {}
-ListContent::ListContent(Message& m, const Variant::List& i) : impl(new ListContentImpl(m, i)) {}
-ListContent::~ListContent() { delete impl; }
-ListContent& ListContent::operator=(const ListContent& l) { *impl = *l.impl; return *this; }
-
-ListContent::const_iterator ListContent::begin() const { return impl->asList().begin(); }
-ListContent::const_iterator ListContent::end() const { return impl->asList().end(); }
-ListContent::const_reverse_iterator ListContent::rbegin() const { return impl->asList().rbegin(); }
-ListContent::const_reverse_iterator ListContent::rend() const { return impl->asList().rend(); }
-
-ListContent::iterator ListContent::begin() { return impl->asList().begin(); }
-ListContent::iterator ListContent::end() { return impl->asList().end(); }
-ListContent::reverse_iterator ListContent::rbegin() { return impl->asList().rbegin(); }
-ListContent::reverse_iterator ListContent::rend() { return impl->asList().rend(); }
-
-bool ListContent::empty() const { return impl->asList().empty(); }
-size_t ListContent::size() const { return impl->asList().size(); }
-
-const Variant& ListContent::front() const { return impl->asList().front(); }
-Variant& ListContent::front() { return impl->asList().front(); }
-const Variant& ListContent::back() const { return impl->asList().back(); }
-Variant& ListContent::back() { return impl->asList().back(); }
-
-void ListContent::push_front(const Variant& v) { impl->asList().push_front(v); }
-void ListContent::push_back(const Variant& v) { impl->asList().push_back(v); }
-
-void ListContent::pop_front() { impl->asList().pop_front(); }
-void ListContent::pop_back() { impl->asList().pop_back(); }
-
-ListContent::iterator ListContent::insert(iterator position, const Variant& v)
-{
- return impl->asList().insert(position, v);
-}
-void ListContent::insert(iterator position, size_t n, const Variant& v)
-{
- impl->asList().insert(position, n, v);
-}
-ListContent::iterator ListContent::erase(iterator position) { return impl->asList().erase(position); }
-ListContent::iterator ListContent::erase(iterator first, iterator last) { return impl->asList().erase(first, last); }
-void ListContent::clear() { impl->asList().clear(); }
-
-void ListContent::encode() { impl->encode(); }
-
-const Variant::List& ListContent::asList() const { return impl->asList(); }
-Variant::List& ListContent::asList() { return impl->asList(); }
-
-std::ostream& operator<<(std::ostream& out, const ListContent& m)
-{
- out << m.asList();
- return out;
-}
-
-}} // namespace qpid::messaging
diff --git a/cpp/src/qpid/messaging/ListView.cpp b/cpp/src/qpid/messaging/ListView.cpp
deleted file mode 100644
index 5cf453254f..0000000000
--- a/cpp/src/qpid/messaging/ListView.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#include "qpid/messaging/ListView.h"
-#include "qpid/messaging/Message.h"
-#include "qpid/client/amqp0_10/Codecs.h"
-
-namespace qpid {
-namespace messaging {
-
-using namespace qpid::types;
-
-class ListViewImpl : public Variant
-{
- public:
- ListViewImpl(const Message& msg) : Variant(Variant::List())
- {
- if (msg.getContent().size()) {
- qpid::client::amqp0_10::ListCodec codec;
- codec.decode(msg.getContent(), *this);
- }
- }
-};
-
-ListView::ListView(const Message& m) :impl(new ListViewImpl(m)) {}
-ListView::~ListView() { delete impl; }
-ListView& ListView::operator=(const ListView& l) { *impl = *l.impl; return *this; }
-
-ListView::const_iterator ListView::begin() const { return impl->asList().begin(); }
-ListView::const_iterator ListView::end() const { return impl->asList().end(); }
-ListView::const_reverse_iterator ListView::rbegin() const { return impl->asList().rbegin(); }
-ListView::const_reverse_iterator ListView::rend() const { return impl->asList().rend(); }
-
-bool ListView::empty() const { return impl->asList().empty(); }
-size_t ListView::size() const { return impl->asList().size(); }
-
-const Variant& ListView::front() const { return impl->asList().front(); }
-const Variant& ListView::back() const { return impl->asList().back(); }
-
-const Variant::List& ListView::asList() const { return impl->asList(); }
-
-std::ostream& operator<<(std::ostream& out, const ListView& m)
-{
- out << m.asList();
- return out;
-}
-
-}} // namespace qpid::messaging
diff --git a/cpp/src/qpid/messaging/MapContent.cpp b/cpp/src/qpid/messaging/MapContent.cpp
deleted file mode 100644
index 11dcfbaf70..0000000000
--- a/cpp/src/qpid/messaging/MapContent.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#include "qpid/messaging/MapContent.h"
-#include "qpid/messaging/Message.h"
-#include "qpid/client/amqp0_10/Codecs.h"
-
-namespace qpid {
-namespace messaging {
-
-using namespace qpid::types;
-
-class MapContentImpl : public Variant
-{
- Message* msg;
- public:
- MapContentImpl(Message& m) : Variant(Variant::Map()), msg(&m)
- {
- if (msg->getContent().size()) {
- qpid::client::amqp0_10::MapCodec codec;
- codec.decode(msg->getContent(), *this);
- }
- }
-
- MapContentImpl(Message& m, const Variant::Map& i) : Variant(i), msg(&m)
- {
- msg->getContent().clear();
- }
-
- void encode()
- {
- qpid::client::amqp0_10::MapCodec codec;
- codec.encode(*this, msg->getContent());
- msg->setContentType(qpid::client::amqp0_10::MapCodec::contentType);
- }
-};
-
-MapContent::MapContent(Message& m) : impl(new MapContentImpl(m)) {}
-MapContent::MapContent(Message& m, const Variant::Map& i) : impl(new MapContentImpl(m, i)) {}
-MapContent::~MapContent() { delete impl; }
-MapContent& MapContent::operator=(const MapContent& m) { *impl = *m.impl; return *this; }
-
-MapContent::const_iterator MapContent::begin() const { return impl->asMap().begin(); }
-MapContent::const_iterator MapContent::end() const { return impl->asMap().end(); }
-MapContent::const_reverse_iterator MapContent::rbegin() const { return impl->asMap().rbegin(); }
-MapContent::const_reverse_iterator MapContent::rend() const { return impl->asMap().rend(); }
-MapContent::iterator MapContent::begin() { return impl->asMap().begin(); }
-MapContent::iterator MapContent::end() { return impl->asMap().end(); }
-MapContent::reverse_iterator MapContent::rbegin() { return impl->asMap().rbegin(); }
-MapContent::reverse_iterator MapContent::rend() { return impl->asMap().rend(); }
-
-bool MapContent::empty() const { return impl->asMap().empty(); }
-size_t MapContent::size() const { return impl->asMap().size(); }
-
-MapContent::const_iterator MapContent::find(const key_type& key) const { return impl->asMap().find(key); }
-MapContent::iterator MapContent::find(const key_type& key) { return impl->asMap().find(key); }
-const Variant& MapContent::operator[](const key_type& key) const { return impl->asMap()[key]; }
-Variant& MapContent::operator[](const key_type& key) { return impl->asMap()[key]; }
-
-std::pair<MapContent::iterator,bool> MapContent::insert(const value_type& item) { return impl->asMap().insert(item); }
-MapContent::iterator MapContent::insert(iterator position, const value_type& item) { return impl->asMap().insert(position, item); }
-void MapContent::erase(iterator position) { impl->asMap().erase(position); }
-void MapContent::erase(iterator first, iterator last) { impl->asMap().erase(first, last); }
-size_t MapContent::erase(const key_type& key) { return impl->asMap().erase(key); }
-void MapContent::clear() { impl->asMap().clear(); }
-
-void MapContent::encode() { impl->encode(); }
-
-const std::map<MapContent::key_type, Variant>& MapContent::asMap() const { return impl->asMap(); }
-std::map<MapContent::key_type, Variant>& MapContent::asMap() { return impl->asMap(); }
-
-
-std::ostream& operator<<(std::ostream& out, const MapContent& m)
-{
- out << m.asMap();
- return out;
-}
-
-}} // namespace qpid::messaging
diff --git a/cpp/src/qpid/messaging/MapView.cpp b/cpp/src/qpid/messaging/MapView.cpp
deleted file mode 100644
index 8bb0a724d2..0000000000
--- a/cpp/src/qpid/messaging/MapView.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#include "qpid/messaging/MapView.h"
-#include "qpid/messaging/Message.h"
-#include "qpid/client/amqp0_10/Codecs.h"
-
-namespace qpid {
-namespace messaging {
-
-using namespace qpid::types;
-
-class MapViewImpl : public Variant
-{
- public:
- MapViewImpl(const Message& msg) : Variant(Variant::Map())
- {
- if (msg.getContent().size()) {
- qpid::client::amqp0_10::MapCodec codec;
- codec.decode(msg.getContent(), *this);
- }
- }
-};
-
-MapView::MapView(const Message& m) : impl(new MapViewImpl(m)) {}
-MapView::~MapView() { delete impl; }
-MapView& MapView::operator=(const MapView& m) { *impl = *m.impl; return *this; }
-
-MapView::const_iterator MapView::begin() const { return impl->asMap().begin(); }
-MapView::const_iterator MapView::end() const { return impl->asMap().end(); }
-MapView::const_reverse_iterator MapView::rbegin() const { return impl->asMap().rbegin(); }
-MapView::const_reverse_iterator MapView::rend() const { return impl->asMap().rend(); }
-
-bool MapView::empty() const { return impl->asMap().empty(); }
-size_t MapView::size() const { return impl->asMap().size(); }
-
-MapView::const_iterator MapView::find(const key_type& key) const { return impl->asMap().find(key); }
-const Variant& MapView::operator[](const key_type& key) const { return impl->asMap()[key]; }
-
-const std::map<MapView::key_type, Variant>& MapView::asMap() const { return impl->asMap(); }
-
-std::ostream& operator<<(std::ostream& out, const MapView& m)
-{
- out << m.asMap();
- return out;
-}
-
-}} // namespace qpid::messaging
diff --git a/cpp/src/qpid/messaging/Message.cpp b/cpp/src/qpid/messaging/Message.cpp
index 84245b7296..bbbb257b18 100644
--- a/cpp/src/qpid/messaging/Message.cpp
+++ b/cpp/src/qpid/messaging/Message.cpp
@@ -20,6 +20,8 @@
*/
#include "qpid/messaging/Message.h"
#include "qpid/messaging/MessageImpl.h"
+#include "qpid/amqp_0_10/Codecs.h"
+#include <boost/format.hpp>
namespace qpid {
namespace messaging {
@@ -64,18 +66,73 @@ bool Message::getDurable() const { return impl->durable; }
bool Message::getRedelivered() const { return impl->redelivered; }
void Message::setRedelivered(bool redelivered) { impl->redelivered = redelivered; }
-const VariantMap& Message::getProperties() const { return impl->getHeaders(); }
-VariantMap& Message::getProperties() { return impl->getHeaders(); }
+const Variant::Map& Message::getProperties() const { return impl->getHeaders(); }
+Variant::Map& Message::getProperties() { return impl->getHeaders(); }
void Message::setContent(const std::string& c) { impl->setBytes(c); }
void Message::setContent(const char* chars, size_t count) { impl->setBytes(chars, count); }
-const std::string& Message::getContent() const { return impl->getBytes(); }
-std::string& Message::getContent() { return impl->getBytes(); }
+std::string Message::getContent() const { return impl->getBytes(); }
-void Message::getContent(std::pair<const char*, size_t>& content) const
+const char* Message::getContentPtr() const
{
- content.first = impl->getBytes().data();
- content.second = impl->getBytes().size();
+ return impl->getBytes().data();
+}
+
+size_t Message::getContentSize() const
+{
+ return impl->getBytes().size();
+}
+
+
+EncodingException::EncodingException(const std::string& msg) : qpid::Exception(msg) {}
+
+const std::string BAD_ENCODING("Unsupported encoding: %1% (only %2% is supported at present).");
+
+bool checkEncoding(const std::string& requested, const std::string& supported)
+{
+ if (requested.size()) {
+ if (requested == supported) return true;
+ else throw EncodingException((boost::format(BAD_ENCODING) % requested % supported).str());
+ } else {
+ return false;
+ }
+}
+
+/*
+ * Currently only support a single encoding type for both list and
+ * map, based on AMQP 0-10, though wider support is anticipated in the
+ * future. This method simply checks that the desired encoding (if one
+ * is specified, either through the message-content or through an
+ * override) is indeed supported.
+ */
+void checkEncoding(const Message& message, const std::string& requested, const std::string& supported)
+{
+ checkEncoding(requested, supported) || checkEncoding(message.getContentType(), supported);
+}
+
+void decode(const Message& message, Variant::Map& map, const std::string& encoding)
+{
+ checkEncoding(message, encoding, qpid::amqp_0_10::MapCodec::contentType);
+ qpid::amqp_0_10::MapCodec::decode(message.getContent(), map);
+}
+void decode(const Message& message, Variant::List& list, const std::string& encoding)
+{
+ checkEncoding(message, encoding, qpid::amqp_0_10::ListCodec::contentType);
+ qpid::amqp_0_10::ListCodec::decode(message.getContent(), list);
+}
+void encode(const Variant::Map& map, Message& message, const std::string& encoding)
+{
+ checkEncoding(message, encoding, qpid::amqp_0_10::MapCodec::contentType);
+ std::string content;
+ qpid::amqp_0_10::MapCodec::encode(map, content);
+ message.setContent(content);
+}
+void encode(const Variant::List& list, Message& message, const std::string& encoding)
+{
+ checkEncoding(message, encoding, qpid::amqp_0_10::ListCodec::contentType);
+ std::string content;
+ qpid::amqp_0_10::ListCodec::encode(list, content);
+ message.setContent(content);
}
}} // namespace qpid::messaging
diff --git a/cpp/src/qpid/messaging/MessageImpl.cpp b/cpp/src/qpid/messaging/MessageImpl.cpp
index dea6681244..6138ab4a2c 100644
--- a/cpp/src/qpid/messaging/MessageImpl.cpp
+++ b/cpp/src/qpid/messaging/MessageImpl.cpp
@@ -54,8 +54,8 @@ const std::string& MessageImpl::getSubject() const { return subject; }
void MessageImpl::setContentType(const std::string& s) { contentType = s; }
const std::string& MessageImpl::getContentType() const { return contentType; }
-const VariantMap& MessageImpl::getHeaders() const { return headers; }
-VariantMap& MessageImpl::getHeaders() { return headers; }
+const Variant::Map& MessageImpl::getHeaders() const { return headers; }
+Variant::Map& MessageImpl::getHeaders() { return headers; }
//should these methods be on MessageContent?
void MessageImpl::setBytes(const std::string& c) { bytes = c; }
diff --git a/cpp/src/qpid/messaging/Receiver.cpp b/cpp/src/qpid/messaging/Receiver.cpp
index df13052671..ff67650cf8 100644
--- a/cpp/src/qpid/messaging/Receiver.cpp
+++ b/cpp/src/qpid/messaging/Receiver.cpp
@@ -39,8 +39,8 @@ bool Receiver::fetch(Message& message, Duration timeout) { return impl->fetch(me
Message Receiver::fetch(Duration timeout) { return impl->fetch(timeout); }
void Receiver::setCapacity(uint32_t c) { impl->setCapacity(c); }
uint32_t Receiver::getCapacity() { return impl->getCapacity(); }
-uint32_t Receiver::available() { return impl->available(); }
-uint32_t Receiver::pendingAck() { return impl->pendingAck(); }
+uint32_t Receiver::getAvailable() { return impl->available(); }
+uint32_t Receiver::getPendingAck() { return impl->pendingAck(); }
void Receiver::close() { impl->close(); }
const std::string& Receiver::getName() const { return impl->getName(); }
Session Receiver::getSession() const { return impl->getSession(); }
diff --git a/cpp/src/qpid/messaging/Sender.cpp b/cpp/src/qpid/messaging/Sender.cpp
index 711a857d7a..2d5cfbcec5 100644
--- a/cpp/src/qpid/messaging/Sender.cpp
+++ b/cpp/src/qpid/messaging/Sender.cpp
@@ -36,7 +36,7 @@ void Sender::send(const Message& message) { impl->send(message); }
void Sender::close() { impl->close(); }
void Sender::setCapacity(uint32_t c) { impl->setCapacity(c); }
uint32_t Sender::getCapacity() { return impl->getCapacity(); }
-uint32_t Sender::pending() { return impl->pending(); }
+uint32_t Sender::getPending() { return impl->pending(); }
const std::string& Sender::getName() const { return impl->getName(); }
Session Sender::getSession() const { return impl->getSession(); }
diff --git a/cpp/src/qpid/messaging/Session.cpp b/cpp/src/qpid/messaging/Session.cpp
index 2ac19727e3..4d1e633a86 100644
--- a/cpp/src/qpid/messaging/Session.cpp
+++ b/cpp/src/qpid/messaging/Session.cpp
@@ -81,8 +81,8 @@ Receiver Session::nextReceiver(Duration timeout)
return impl->nextReceiver(timeout);
}
-uint32_t Session::available() { return impl->available(); }
-uint32_t Session::pendingAck() { return impl->pendingAck(); }
+uint32_t Session::getAvailable() { return impl->available(); }
+uint32_t Session::getPendingAck() { return impl->pendingAck(); }
Sender Session::getSender(const std::string& name) const
{