qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject [3/3] qpid-proton git commit: PROTON-1180: [C++ binding] remove local_condition; rename remote_condition -> condition
Date Fri, 15 Apr 2016 21:23:44 GMT
PROTON-1180: [C++ binding] remove local_condition; rename remote_condition -> condition


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/288b1a6f
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/288b1a6f
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/288b1a6f

Branch: refs/heads/master
Commit: 288b1a6f76fa20f6414b64c03a7c6b5243b27797
Parents: 9be087d
Author: Andrew Stitcher <astitcher@apache.org>
Authored: Fri Apr 15 17:20:12 2016 -0400
Committer: Andrew Stitcher <astitcher@apache.org>
Committed: Fri Apr 15 17:20:12 2016 -0400

----------------------------------------------------------------------
 proton-c/bindings/cpp/include/proton/connection.hpp | 3 +--
 proton-c/bindings/cpp/include/proton/endpoint.hpp   | 5 +----
 proton-c/bindings/cpp/include/proton/link.hpp       | 3 +--
 proton-c/bindings/cpp/include/proton/session.hpp    | 3 +--
 proton-c/bindings/cpp/src/connection.cpp            | 8 ++------
 proton-c/bindings/cpp/src/engine_test.cpp           | 4 ++--
 proton-c/bindings/cpp/src/handler.cpp               | 8 ++++----
 proton-c/bindings/cpp/src/link.cpp                  | 8 ++------
 proton-c/bindings/cpp/src/session.cpp               | 8 ++------
 9 files changed, 16 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/288b1a6f/proton-c/bindings/cpp/include/proton/connection.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/connection.hpp b/proton-c/bindings/cpp/include/proton/connection.hpp
index 3b686f7..a451a9f 100644
--- a/proton-c/bindings/cpp/include/proton/connection.hpp
+++ b/proton-c/bindings/cpp/include/proton/connection.hpp
@@ -54,8 +54,7 @@ PN_CPP_CLASS_EXTERN connection : public internal::object<pn_connection_t>,
publi
     /// Get the state of this connection.
     PN_CPP_EXTERN endpoint::state state() const;
 
-    PN_CPP_EXTERN condition local_condition() const;
-    PN_CPP_EXTERN condition remote_condition() const;
+    PN_CPP_EXTERN class condition condition() const;
 
     /// Get the container.
     ///

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/288b1a6f/proton-c/bindings/cpp/include/proton/endpoint.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/endpoint.hpp b/proton-c/bindings/cpp/include/proton/endpoint.hpp
index d59e093..809c2a3 100644
--- a/proton-c/bindings/cpp/include/proton/endpoint.hpp
+++ b/proton-c/bindings/cpp/include/proton/endpoint.hpp
@@ -58,11 +58,8 @@ PN_CPP_CLASS_EXTERN endpoint {
 
     /// XXX add endpoint state boolean operations
 
-    /// Get the local error condition.
-    virtual condition local_condition() const = 0;
-
     /// Get the error condition of the remote endpoint.
-    virtual condition remote_condition() const = 0;
+    virtual class condition condition() const = 0;
 
 #if PN_CPP_HAS_CPP11
     // Make everything explicit for C++11 compilers

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/288b1a6f/proton-c/bindings/cpp/include/proton/link.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/link.hpp b/proton-c/bindings/cpp/include/proton/link.hpp
index f917514..8e07704 100644
--- a/proton-c/bindings/cpp/include/proton/link.hpp
+++ b/proton-c/bindings/cpp/include/proton/link.hpp
@@ -57,8 +57,7 @@ PN_CPP_CLASS_EXTERN link : public internal::object<pn_link_t> , public
endpoint
     /// Get the state of this link.
     PN_CPP_EXTERN endpoint::state state() const;
 
-    PN_CPP_EXTERN condition local_condition() const;
-    PN_CPP_EXTERN condition remote_condition() const;
+    PN_CPP_EXTERN class condition condition() const;
 
     /// Locally open the link.  The operation is not complete till
     /// handler::on_link_open.

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/288b1a6f/proton-c/bindings/cpp/include/proton/session.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/session.hpp b/proton-c/bindings/cpp/include/proton/session.hpp
index 450f035..74ffc21 100644
--- a/proton-c/bindings/cpp/include/proton/session.hpp
+++ b/proton-c/bindings/cpp/include/proton/session.hpp
@@ -52,8 +52,7 @@ PN_CPP_CLASS_EXTERN session : public internal::object<pn_session_t>,
public endp
     /// Get the state of this session.
     PN_CPP_EXTERN endpoint::state state() const;
 
-    PN_CPP_EXTERN condition local_condition() const;
-    PN_CPP_EXTERN condition remote_condition() const;
+    PN_CPP_EXTERN class condition condition() const;
 
     /// @cond INTERNAL
     /// XXX needs to take connection options

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/288b1a6f/proton-c/bindings/cpp/src/connection.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/connection.cpp b/proton-c/bindings/cpp/src/connection.cpp
index fc61190..089f750 100644
--- a/proton-c/bindings/cpp/src/connection.cpp
+++ b/proton-c/bindings/cpp/src/connection.cpp
@@ -108,12 +108,8 @@ receiver connection::open_receiver(const std::string &addr, const
link_options &
 
 endpoint::state connection::state() const { return pn_connection_state(pn_object()); }
 
-condition connection::local_condition() const {
-    return condition(pn_connection_condition(pn_object()));
-}
-
-condition connection::remote_condition() const {
-    return condition(pn_connection_remote_condition(pn_object()));
+condition connection::condition() const {
+    return pn_connection_remote_condition(pn_object());
 }
 
 void connection::user(const std::string &name) { pn_connection_set_user(pn_object(),
name.c_str()); }

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/288b1a6f/proton-c/bindings/cpp/src/engine_test.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/engine_test.cpp b/proton-c/bindings/cpp/src/engine_test.cpp
index 0a14f76..99a003e 100644
--- a/proton-c/bindings/cpp/src/engine_test.cpp
+++ b/proton-c/bindings/cpp/src/engine_test.cpp
@@ -230,8 +230,8 @@ void test_transport_close() {
     while (!e.b.connection().closed()) e.process();
     ASSERT_EQUAL(1, hb.errors.size());
     ASSERT_EQUAL("oops: engine failure", hb.errors.front());
-    ASSERT_EQUAL("oops", e.b.connection().remote_condition().name());
-    ASSERT_EQUAL("engine failure", e.b.connection().remote_condition().description());
+    ASSERT_EQUAL("oops", e.b.connection().condition().name());
+    ASSERT_EQUAL("engine failure", e.b.connection().condition().description());
 }
 
 int main(int, char**) {

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/288b1a6f/proton-c/bindings/cpp/src/handler.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/handler.cpp b/proton-c/bindings/cpp/src/handler.cpp
index 3849fd8..d7d43d2 100644
--- a/proton-c/bindings/cpp/src/handler.cpp
+++ b/proton-c/bindings/cpp/src/handler.cpp
@@ -43,16 +43,16 @@ void handler::on_timer(container &) {}
 void handler::on_transport_close(transport &) {}
 void handler::on_transport_error(transport &t) { on_unhandled_error(t.condition()); }
 void handler::on_connection_close(connection &) {}
-void handler::on_connection_error(connection &c) { on_unhandled_error(c.remote_condition());
}
+void handler::on_connection_error(connection &c) { on_unhandled_error(c.condition());
}
 void handler::on_connection_open(connection &) {}
 void handler::on_session_close(session &) {}
-void handler::on_session_error(session &s) { on_unhandled_error(s.remote_condition());
}
+void handler::on_session_error(session &s) { on_unhandled_error(s.condition()); }
 void handler::on_session_open(session &) {}
 void handler::on_receiver_close(receiver &) {}
-void handler::on_receiver_error(receiver &l) { on_unhandled_error(l.remote_condition());
}
+void handler::on_receiver_error(receiver &l) { on_unhandled_error(l.condition()); }
 void handler::on_receiver_open(receiver &) {}
 void handler::on_sender_close(sender &) {}
-void handler::on_sender_error(sender &l) { on_unhandled_error(l.remote_condition());
}
+void handler::on_sender_error(sender &l) { on_unhandled_error(l.condition()); }
 void handler::on_sender_open(sender &) {}
 void handler::on_tracker_accept(tracker &) {}
 void handler::on_tracker_reject(tracker &) {}

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/288b1a6f/proton-c/bindings/cpp/src/link.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/link.cpp b/proton-c/bindings/cpp/src/link.cpp
index 420711a..e31a656 100644
--- a/proton-c/bindings/cpp/src/link.cpp
+++ b/proton-c/bindings/cpp/src/link.cpp
@@ -103,12 +103,8 @@ endpoint::state link::state() const {
     return pn_link_state(pn_object());
 }
 
-condition link::local_condition() const {
-    return condition(pn_link_condition(pn_object()));
-}
-
-condition link::remote_condition() const {
-    return condition(pn_link_remote_condition(pn_object()));
+condition link::condition() const {
+    return pn_link_remote_condition(pn_object());
 }
 
 ssize_t link::recv(char* buffer, size_t size) {

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/288b1a6f/proton-c/bindings/cpp/src/session.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/session.cpp b/proton-c/bindings/cpp/src/session.cpp
index 37550b0..6deca10 100644
--- a/proton-c/bindings/cpp/src/session.cpp
+++ b/proton-c/bindings/cpp/src/session.cpp
@@ -67,12 +67,8 @@ receiver session::open_receiver(const std::string &addr, const link_options
&lo)
 
 endpoint::state session::state() const { return pn_session_state(pn_object()); }
 
-condition session::local_condition() const {
-    return condition(pn_session_condition(pn_object()));
-}
-
-condition session::remote_condition() const {
-    return condition(pn_session_remote_condition(pn_object()));
+condition session::condition() const {
+    return pn_session_remote_condition(pn_object());
 }
 
 link_range session::links()  const {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message