qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject [1/2] qpid-proton git commit: NO-JIRA: [C++ binding] Remove unecessary and unclear inheritance
Date Fri, 18 Dec 2015 13:49:39 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/master 02d6ba686 -> c12eae180


NO-JIRA: [C++ binding] Remove unecessary and unclear inheritance


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

Branch: refs/heads/master
Commit: 397272000a57de333d98eaaa8eea7115c7976740
Parents: 02d6ba6
Author: Andrew Stitcher <astitcher@apache.org>
Authored: Thu Dec 10 17:14:26 2015 -0500
Committer: Andrew Stitcher <astitcher@apache.org>
Committed: Fri Dec 18 13:48:23 2015 +0000

----------------------------------------------------------------------
 proton-c/bindings/cpp/include/proton/handler.hpp | 5 ++++-
 proton-c/bindings/cpp/src/handler.cpp            | 2 +-
 proton-c/bindings/cpp/src/messaging_event.cpp    | 2 +-
 proton-c/bindings/cpp/src/proton_event.cpp       | 2 +-
 4 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/39727200/proton-c/bindings/cpp/include/proton/handler.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/handler.hpp b/proton-c/bindings/cpp/include/proton/handler.hpp
index 6680d70..9b8f5e9 100644
--- a/proton-c/bindings/cpp/include/proton/handler.hpp
+++ b/proton-c/bindings/cpp/include/proton/handler.hpp
@@ -44,7 +44,7 @@ namespace proton {
  * `on_*_closed` or `on_*_final` event that indicates the handler is no longer needed.
  *
  */
-class handler : public std::vector<handler*> {
+class handler {
   public:
     PN_CPP_EXTERN handler();
     PN_CPP_EXTERN virtual ~handler();
@@ -56,6 +56,9 @@ class handler : public std::vector<handler*> {
     /// h must not be deleted before this handler.
     PN_CPP_EXTERN virtual void add_child_handler(handler &h);
 
+  public:
+    std::vector<handler*> children_;
+    typedef std::vector<handler*>::iterator iterator;
   private:
     pn_ptr<pn_handler_t> pn_handler_;
     friend class container_impl;

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/39727200/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 d045dbd..e73ee24 100644
--- a/proton-c/bindings/cpp/src/handler.cpp
+++ b/proton-c/bindings/cpp/src/handler.cpp
@@ -31,7 +31,7 @@ handler::~handler() {}
 void handler::on_unhandled(event &e) {}
 
 void handler::add_child_handler(handler &e) {
-    push_back(&e);
+    children_.push_back(&e);
 }
 
 }

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/39727200/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 eabacaf..4b1e781 100644
--- a/proton-c/bindings/cpp/src/messaging_event.cpp
+++ b/proton-c/bindings/cpp/src/messaging_event.cpp
@@ -147,7 +147,7 @@ void messaging_event::dispatch(handler &h) {
     }
 
     // recurse through children
-    for (handler::iterator child = h.begin(); child != h.end(); ++child) {
+    for (handler::iterator child = h.children_.begin(); child != h.children_.end(); ++child)
{
         dispatch(**child);
     }
 }

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/39727200/proton-c/bindings/cpp/src/proton_event.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/proton_event.cpp b/proton-c/bindings/cpp/src/proton_event.cpp
index c324985..1278d33 100644
--- a/proton-c/bindings/cpp/src/proton_event.cpp
+++ b/proton-c/bindings/cpp/src/proton_event.cpp
@@ -160,7 +160,7 @@ void proton_event::dispatch(handler &h) {
     }
 
     // recurse through children
-    for (handler::iterator child = h.begin(); child != h.end(); ++child) {
+    for (handler::iterator child = h.children_.begin(); child != h.children_.end(); ++child)
{
         dispatch(**child);
     }
 }


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


Mime
View raw message