qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject qpid-proton git commit: PROTON-1180: [C++ binding] Modified endpoint changes: - Only have active() boolean - this is local_active - Removed remote_active() and changed all of it's uses in the code.
Date Wed, 20 Apr 2016 23:35:45 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/master a5db6a1ed -> f1e2428ba


PROTON-1180: [C++ binding] Modified endpoint changes:
- Only have active() boolean - this is local_active
- Removed remote_active() and changed all of it's uses in the code.


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

Branch: refs/heads/master
Commit: f1e2428ba2da7fbaa311aea7c7d86fba9033dd7c
Parents: a5db6a1
Author: Andrew Stitcher <astitcher@apache.org>
Authored: Wed Apr 20 19:26:52 2016 -0400
Committer: Andrew Stitcher <astitcher@apache.org>
Committed: Wed Apr 20 19:35:06 2016 -0400

----------------------------------------------------------------------
 examples/cpp/broker.hpp                             |  2 +-
 proton-c/bindings/cpp/include/proton/connection.hpp | 10 +---------
 proton-c/bindings/cpp/include/proton/endpoint.hpp   |  6 ++----
 proton-c/bindings/cpp/include/proton/link.hpp       |  3 +--
 proton-c/bindings/cpp/include/proton/session.hpp    |  3 +--
 proton-c/bindings/cpp/src/connector.cpp             |  2 +-
 proton-c/bindings/cpp/src/endpoint.cpp              | 12 ++++--------
 proton-c/bindings/cpp/src/engine_test.cpp           |  2 +-
 8 files changed, 12 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f1e2428b/examples/cpp/broker.hpp
----------------------------------------------------------------------
diff --git a/examples/cpp/broker.hpp b/examples/cpp/broker.hpp
index 2797e55..8f16e61 100644
--- a/examples/cpp/broker.hpp
+++ b/examples/cpp/broker.hpp
@@ -205,7 +205,7 @@ class broker_handler : public proton::handler {
     void remove_stale_consumers(proton::connection connection) {
         proton::link_range r = connection.links();
         for (proton::link_iterator l = r.begin(); l != r.end(); ++l) {
-            if (!!l->sender() && l->remote_active())
+            if (!!l->sender() && l->active())
                 unsubscribe(l->sender());
         }
     }

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f1e2428b/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 9167d83..586b327 100644
--- a/proton-c/bindings/cpp/include/proton/connection.hpp
+++ b/proton-c/bindings/cpp/include/proton/connection.hpp
@@ -53,8 +53,7 @@ PN_CPP_CLASS_EXTERN connection : public internal::object<pn_connection_t>,
publi
 
     /// Get the state of this connection.
     PN_CPP_EXTERN bool uninitialized() const;
-    PN_CPP_EXTERN bool local_active() const;
-    PN_CPP_EXTERN bool remote_active() const;
+    PN_CPP_EXTERN bool active() const;
     PN_CPP_EXTERN bool closed() const;
 
     PN_CPP_EXTERN class condition condition() const;
@@ -113,13 +112,6 @@ PN_CPP_CLASS_EXTERN connection : public internal::object<pn_connection_t>,
publi
     PN_CPP_EXTERN session_range sessions() const;
 
     /// @cond INTERNAL
-    ///
-    /// XXX not yet discussed, why this convenience but not others?
-    /// opened?  should this not be on endpoint?
-    ///
-    /// @endcond
-
-    /// @cond INTERNAL
   private:
     void user(const std::string &);
     void password(const std::string &);

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f1e2428b/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 3f06ebd..b0f1d55 100644
--- a/proton-c/bindings/cpp/include/proton/endpoint.hpp
+++ b/proton-c/bindings/cpp/include/proton/endpoint.hpp
@@ -34,12 +34,10 @@ PN_CPP_CLASS_EXTERN endpoint {
   public:
     PN_CPP_EXTERN virtual ~endpoint();
 
-    /// True if the connection is uninitialized
+    /// True if the local end is uninitialized
     virtual bool uninitialized() const = 0;
     /// True if the local end is active
-    virtual bool local_active() const = 0;
-    /// True if the remote end is active
-    virtual bool remote_active() const = 0;
+    virtual bool active() const = 0;
     /// True if the connection is fully closed, i.e. local and remote
     /// ends are closed.
     virtual bool closed() const = 0;

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f1e2428b/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 9c7c32b..0d9a92c 100644
--- a/proton-c/bindings/cpp/include/proton/link.hpp
+++ b/proton-c/bindings/cpp/include/proton/link.hpp
@@ -54,8 +54,7 @@ PN_CPP_CLASS_EXTERN link : public internal::object<pn_link_t> , public
endpoint
 
     // Endpoint behaviours
     PN_CPP_EXTERN bool uninitialized() const;
-    PN_CPP_EXTERN bool local_active() const;
-    PN_CPP_EXTERN bool remote_active() const;
+    PN_CPP_EXTERN bool active() const;
     PN_CPP_EXTERN bool closed() const;
 
     PN_CPP_EXTERN class condition condition() const;

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f1e2428b/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 01daf32..73e75d6 100644
--- a/proton-c/bindings/cpp/include/proton/session.hpp
+++ b/proton-c/bindings/cpp/include/proton/session.hpp
@@ -51,8 +51,7 @@ PN_CPP_CLASS_EXTERN session : public internal::object<pn_session_t>,
public endp
 
     /// Get the state of this session.
     PN_CPP_EXTERN bool uninitialized() const;
-    PN_CPP_EXTERN bool local_active() const;
-    PN_CPP_EXTERN bool remote_active() const;
+    PN_CPP_EXTERN bool active() const;
     PN_CPP_EXTERN bool closed() const;
 
     PN_CPP_EXTERN class condition condition() const;

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f1e2428b/proton-c/bindings/cpp/src/connector.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/connector.cpp b/proton-c/bindings/cpp/src/connector.cpp
index 3967ca4..8df766f 100644
--- a/proton-c/bindings/cpp/src/connector.cpp
+++ b/proton-c/bindings/cpp/src/connector.cpp
@@ -93,7 +93,7 @@ void connector::on_transport_tail_closed(proton_event &e) {
 
 void connector::on_transport_closed(proton_event &e) {
     if (!connection_) return;
-    if (connection_.local_active()) {
+    if (connection_.active()) {
         if (reconnect_timer_) {
             e.connection().transport().unbind();
             transport_configured_ = false;

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f1e2428b/proton-c/bindings/cpp/src/endpoint.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/endpoint.cpp b/proton-c/bindings/cpp/src/endpoint.cpp
index 86adc13..2cd55c3 100644
--- a/proton-c/bindings/cpp/src/endpoint.cpp
+++ b/proton-c/bindings/cpp/src/endpoint.cpp
@@ -32,8 +32,7 @@
 namespace {
 
 inline bool uninitialized(int state) { return state & PN_LOCAL_UNINIT; }
-inline bool local_active(int state) { return state & PN_LOCAL_ACTIVE; }
-inline bool remote_active(int state) { return state & PN_REMOTE_ACTIVE; }
+inline bool active(int state) { return state & PN_LOCAL_ACTIVE; }
 inline bool closed(int state) { return (state & PN_LOCAL_CLOSED) && (state &
PN_REMOTE_CLOSED); }
 
 }
@@ -41,18 +40,15 @@ inline bool closed(int state) { return (state & PN_LOCAL_CLOSED) &&
(state & PN_
 namespace proton {
 
 bool connection::uninitialized() const { return ::uninitialized(pn_connection_state(pn_object()));
}
-bool connection::local_active() const { return ::local_active(pn_connection_state(pn_object()));
}
-bool connection::remote_active() const { return ::remote_active(pn_connection_state(pn_object()));
}
+bool connection::active() const { return ::active(pn_connection_state(pn_object())); }
 bool connection::closed() const { return ::closed(pn_connection_state(pn_object())); }
 
 bool session::uninitialized() const { return ::uninitialized(pn_session_state(pn_object()));
}
-bool session::local_active() const { return ::local_active(pn_session_state(pn_object()));
}
-bool session::remote_active() const { return ::remote_active(pn_session_state(pn_object()));
}
+bool session::active() const { return ::active(pn_session_state(pn_object())); }
 bool session::closed() const { return ::closed(pn_session_state(pn_object())); }
 
 bool link::uninitialized() const { return ::uninitialized(pn_link_state(pn_object())); }
-bool link::local_active() const { return ::local_active(pn_link_state(pn_object())); }
-bool link::remote_active() const { return ::remote_active(pn_link_state(pn_object())); }
+bool link::active() const { return ::active(pn_link_state(pn_object())); }
 bool link::closed() const { return ::closed(pn_link_state(pn_object())); }
 
 endpoint::~endpoint() {}

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f1e2428b/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 cca4e60..8ff1380 100644
--- a/proton-c/bindings/cpp/src/engine_test.cpp
+++ b/proton-c/bindings/cpp/src/engine_test.cpp
@@ -222,7 +222,7 @@ void test_transport_close() {
     record_handler ha, hb;
     engine_pair e(ha, hb);
     e.a.connection().open();
-    while (!e.a.connection().remote_active()) e.process();
+    while (!e.b.connection().active()) e.process();
 
     e.a.close("oops", "engine failure");
     // Closed but we still have output data to flush so a.dispatch() is true.


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


Mime
View raw message