You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2016/03/24 19:51:48 UTC
qpid-proton git commit: PROTON-1164: [C++ binding] Remove now
unnecessary message menber of proton::event - We don't need to carry this in
the event anymore as it is passed directly into the handler
Repository: qpid-proton
Updated Branches:
refs/heads/master 6713bd5ad -> 45390a9c5
PROTON-1164: [C++ binding] Remove now unnecessary message menber of proton::event
- We don't need to carry this in the event anymore as it is passed directly into the handler
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/45390a9c
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/45390a9c
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/45390a9c
Branch: refs/heads/master
Commit: 45390a9c526b9f7cefdcb6344aabdac2595488bb
Parents: 6713bd5
Author: Andrew Stitcher <as...@apache.org>
Authored: Thu Mar 24 14:40:34 2016 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Thu Mar 24 14:40:34 2016 -0400
----------------------------------------------------------------------
examples/cpp/server.cpp | 2 +-
examples/cpp/server_direct.cpp | 2 +-
proton-c/bindings/cpp/include/proton/event.hpp | 5 -----
proton-c/bindings/cpp/src/messaging_adapter.cpp | 3 +--
proton-c/bindings/cpp/src/messaging_event.cpp | 8 +-------
proton-c/bindings/cpp/src/messaging_event.hpp | 2 --
6 files changed, 4 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/45390a9c/examples/cpp/server.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/server.cpp b/examples/cpp/server.cpp
index 3254d7a..2592e02 100644
--- a/examples/cpp/server.cpp
+++ b/examples/cpp/server.cpp
@@ -68,7 +68,7 @@ class server : public proton::handler {
reply.address(reply_to);
reply.body(to_upper(proton::get<std::string>(m.body())));
- reply.correlation_id(e.message().correlation_id());
+ reply.correlation_id(m.correlation_id());
if (!senders[reply_to]) {
senders[reply_to] = connection.open_sender(reply_to);
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/45390a9c/examples/cpp/server_direct.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/server_direct.cpp b/examples/cpp/server_direct.cpp
index f5d7d46..0d39d2b 100644
--- a/examples/cpp/server_direct.cpp
+++ b/examples/cpp/server_direct.cpp
@@ -87,7 +87,7 @@ class server : public proton::handler {
reply.address(reply_to);
reply.body(to_upper(proton::get<std::string>(m.body())));
- reply.correlation_id(e.message().correlation_id());
+ reply.correlation_id(m.correlation_id());
sender.send(reply);
}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/45390a9c/proton-c/bindings/cpp/include/proton/event.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/event.hpp b/proton-c/bindings/cpp/include/proton/event.hpp
index 25bf862..45d37f8 100644
--- a/proton-c/bindings/cpp/include/proton/event.hpp
+++ b/proton-c/bindings/cpp/include/proton/event.hpp
@@ -86,11 +86,6 @@ class event {
/// @throw proton::error if no delivery
virtual PN_CPP_EXTERN class delivery delivery() const = 0;
- /// Get message.
- ///
- /// @throw proton::error if no message
- virtual PN_CPP_EXTERN class message &message() const = 0;
-
// XXX Should we have a notion of application data? Perhaps this
// is relevant to timer and app events.
};
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/45390a9c/proton-c/bindings/cpp/src/messaging_adapter.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/messaging_adapter.cpp b/proton-c/bindings/cpp/src/messaging_adapter.cpp
index 56488cc..a65e2a5 100644
--- a/proton-c/bindings/cpp/src/messaging_adapter.cpp
+++ b/proton-c/bindings/cpp/src/messaging_adapter.cpp
@@ -91,8 +91,7 @@ void messaging_adapter::on_delivery(proton_event &pe) {
// Avoid expensive heap malloc/free overhead.
// See PROTON-998
class message &msg(ctx.event_message);
- mevent.message_ = &msg;
- mevent.message_->decode(dlv);
+ msg.decode(dlv);
if (pn_link_state(lnk) & PN_LOCAL_CLOSED) {
if (lctx.auto_accept)
dlv.release();
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/45390a9c/proton-c/bindings/cpp/src/messaging_event.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/messaging_event.cpp b/proton-c/bindings/cpp/src/messaging_event.cpp
index 346a664..4d6ddd3 100644
--- a/proton-c/bindings/cpp/src/messaging_event.cpp
+++ b/proton-c/bindings/cpp/src/messaging_event.cpp
@@ -43,7 +43,7 @@
namespace proton {
messaging_event::messaging_event(event_type t, proton_event &p) :
- type_(t), parent_event_(&p), message_(0)
+ type_(t), parent_event_(&p)
{}
messaging_event::~messaging_event() {}
@@ -92,12 +92,6 @@ delivery messaging_event::delivery() const {
throw error(MSG("No delivery context for event"));
}
-message &messaging_event::message() const {
- if (type_ != messaging_event::MESSAGE || !parent_event_)
- throw error(MSG("event type does not provide message"));
- return *message_;
-}
-
std::string messaging_event::name() const {
switch (type()) {
case START: return "START";
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/45390a9c/proton-c/bindings/cpp/src/messaging_event.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/messaging_event.hpp b/proton-c/bindings/cpp/src/messaging_event.hpp
index 71e8a11..60b4287 100644
--- a/proton-c/bindings/cpp/src/messaging_event.hpp
+++ b/proton-c/bindings/cpp/src/messaging_event.hpp
@@ -78,7 +78,6 @@ class messaging_event : public event
class receiver receiver() const;
class link link() const;
class delivery delivery() const;
- class message& message() const;
event_type type() const;
@@ -86,7 +85,6 @@ class messaging_event : public event
friend class messaging_adapter;
event_type type_;
proton_event *parent_event_;
- class message *message_;
messaging_event operator=(const messaging_event&);
messaging_event(const messaging_event&);
};
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org