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/05/05 19:25:56 UTC

[1/3] qpid-proton git commit: PROTON-1153: [C++ binding] Removed unused code/enums

Repository: qpid-proton
Updated Branches:
  refs/heads/master f063ff1e7 -> d7e6e1753


PROTON-1153: [C++ binding] Removed unused code/enums


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

Branch: refs/heads/master
Commit: a65782a977a1b9bd67070ae2518afbb31b35f5ab
Parents: f063ff1
Author: Andrew Stitcher <as...@apache.org>
Authored: Wed May 4 19:34:55 2016 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Thu May 5 15:20:02 2016 -0400

----------------------------------------------------------------------
 proton-c/bindings/cpp/include/proton/link.hpp      |  8 --------
 .../cpp/include/proton/receiver_options.hpp        |  9 ---------
 .../bindings/cpp/include/proton/sender_options.hpp |  7 -------
 proton-c/bindings/cpp/src/link.cpp                 | 17 -----------------
 4 files changed, 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/a65782a9/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 a9622ed..f57754c 100644
--- a/proton-c/bindings/cpp/include/proton/link.hpp
+++ b/proton-c/bindings/cpp/include/proton/link.hpp
@@ -119,14 +119,6 @@ PN_CPP_CLASS_EXTERN link : public internal::object<pn_link_t> , public endpoint
     /// handler::on_link_open.
     void attach();
 
-  private:
-    /// XXX local versus remote, mutability
-    /// XXX - local_sender_settle_mode and local_receiver_settle_mode
-    sender_options::sender_settle_mode sender_settle_mode();
-    receiver_options::receiver_settle_mode receiver_settle_mode();
-    sender_options::sender_settle_mode remote_sender_settle_mode();
-    receiver_options::receiver_settle_mode remote_receiver_settle_mode();
-
     friend class internal::factory<link>;
     ///@endcond
 };

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/a65782a9/proton-c/bindings/cpp/include/proton/receiver_options.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/receiver_options.hpp b/proton-c/bindings/cpp/include/proton/receiver_options.hpp
index babc602..5e2d62a 100644
--- a/proton-c/bindings/cpp/include/proton/receiver_options.hpp
+++ b/proton-c/bindings/cpp/include/proton/receiver_options.hpp
@@ -61,15 +61,6 @@ class target_options;
 /// the options.
 class receiver_options {
   public:
-    /// @cond INTERNAL
-    /// XXX discuss the names
-    /// Receiver settlement behaviour.
-    enum receiver_settle_mode {
-        SETTLE_ALWAYS = PN_RCV_FIRST,
-        SETTLE_SECOND = PN_RCV_SECOND
-    };
-    /// @endcond
-
     /// Create an empty set of options.
     PN_CPP_EXTERN receiver_options();
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/a65782a9/proton-c/bindings/cpp/include/proton/sender_options.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/sender_options.hpp b/proton-c/bindings/cpp/include/proton/sender_options.hpp
index 2aab021..3569171 100644
--- a/proton-c/bindings/cpp/include/proton/sender_options.hpp
+++ b/proton-c/bindings/cpp/include/proton/sender_options.hpp
@@ -62,13 +62,6 @@ class target_options;
 /// the options.
 class sender_options {
   public:
-    /// Sender settlement behaviour.
-    enum sender_settle_mode {
-        UNSETTLED = PN_SND_UNSETTLED,
-        SETTLED = PN_SND_SETTLED,
-        MIXED = PN_SND_MIXED
-    };
-
     /// Create an empty set of options.
     PN_CPP_EXTERN sender_options();
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/a65782a9/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 02a061d..725b3b3 100644
--- a/proton-c/bindings/cpp/src/link.cpp
+++ b/proton-c/bindings/cpp/src/link.cpp
@@ -73,21 +73,4 @@ class session link::session() const {
 error_condition link::error() const {
     return make_wrapper(pn_link_remote_condition(pn_object()));
 }
-
-sender_options::sender_settle_mode link::sender_settle_mode() {
-    return (sender_options::sender_settle_mode) pn_link_snd_settle_mode(pn_object());
-}
-
-receiver_options::receiver_settle_mode link::receiver_settle_mode() {
-    return (receiver_options::receiver_settle_mode) pn_link_rcv_settle_mode(pn_object());
-}
-
-sender_options::sender_settle_mode link::remote_sender_settle_mode() {
-    return (sender_options::sender_settle_mode) pn_link_remote_snd_settle_mode(pn_object());
-}
-
-receiver_options::receiver_settle_mode link::remote_receiver_settle_mode() {
-    return (receiver_options::receiver_settle_mode) pn_link_remote_rcv_settle_mode(pn_object());
-}
-
 }


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


[3/3] qpid-proton git commit: PROTON-1191: [C++ binding] Tidy up defintion of delivery_mode

Posted by as...@apache.org.
PROTON-1191: [C++ binding] Tidy up defintion of delivery_mode


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

Branch: refs/heads/master
Commit: d7e6e1753fb002748e9a4fff53c5ce5e6b676412
Parents: c3c477d
Author: Andrew Stitcher <as...@apache.org>
Authored: Thu May 5 14:44:29 2016 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Thu May 5 15:20:41 2016 -0400

----------------------------------------------------------------------
 proton-c/bindings/cpp/include/proton/delivery_mode.hpp | 13 ++++++++++++-
 proton-c/bindings/cpp/src/receiver_options.cpp         | 10 +++++-----
 proton-c/bindings/cpp/src/sender_options.cpp           | 10 +++++-----
 3 files changed, 22 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/d7e6e175/proton-c/bindings/cpp/include/proton/delivery_mode.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/delivery_mode.hpp b/proton-c/bindings/cpp/include/proton/delivery_mode.hpp
index 913f43b..fe420e6 100644
--- a/proton-c/bindings/cpp/include/proton/delivery_mode.hpp
+++ b/proton-c/bindings/cpp/include/proton/delivery_mode.hpp
@@ -25,7 +25,10 @@
 namespace proton {
 
 /// The message delivery policy to establish when opening a link.
-enum delivery_mode {
+/// This structure imitates the newer C++11 "enum class" so that
+/// The enumeration constants are in the delivery_mode namespace.
+struct delivery_mode {
+  enum modes {
     // No set policy.  The application must settle messages itself
     // according to its own policy.
     NONE = 0,
@@ -37,6 +40,14 @@ enum delivery_mode {
     // settle until after the disposition notification is
     // received.
     AT_LEAST_ONCE
+  };
+
+  delivery_mode() : modes_(NONE) {}
+  delivery_mode(modes m) : modes_(m) {}
+  operator modes() { return modes_; }
+
+private:
+  modes modes_;
 };
 
 }

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/d7e6e175/proton-c/bindings/cpp/src/receiver_options.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/receiver_options.cpp b/proton-c/bindings/cpp/src/receiver_options.cpp
index 733bd00..f39ea66 100644
--- a/proton-c/bindings/cpp/src/receiver_options.cpp
+++ b/proton-c/bindings/cpp/src/receiver_options.cpp
@@ -53,12 +53,12 @@ class receiver_options::impl {
         return link_context::get(unwrap(l));
     }
 
-    static void set_delivery_mode(receiver l, enum delivery_mode mode) {
+    static void set_delivery_mode(receiver l, proton::delivery_mode mode) {
         switch (mode) {
-        case AT_MOST_ONCE:
+        case delivery_mode::AT_MOST_ONCE:
             pn_link_set_snd_settle_mode(unwrap(l), PN_SND_SETTLED);
             break;
-        case AT_LEAST_ONCE:
+        case delivery_mode::AT_LEAST_ONCE:
             pn_link_set_snd_settle_mode(unwrap(l), PN_SND_UNSETTLED);
             pn_link_set_rcv_settle_mode(unwrap(l), PN_RCV_FIRST);
             break;
@@ -69,7 +69,7 @@ class receiver_options::impl {
 
   public:
     option<proton_handler*> handler;
-    option<enum delivery_mode> delivery_mode;
+    option<proton::delivery_mode> delivery_mode;
     option<bool> auto_accept;
     option<bool> auto_settle;
     option<int> credit_window;
@@ -124,7 +124,7 @@ receiver_options& receiver_options::operator=(const receiver_options& x) {
 void receiver_options::update(const receiver_options& x) { impl_->update(*x.impl_); }
 
 receiver_options& receiver_options::handler(class handler *h) { impl_->handler = h->messaging_adapter_.get(); return *this; }
-receiver_options& receiver_options::delivery_mode(enum delivery_mode m) {impl_->delivery_mode = m; return *this; }
+receiver_options& receiver_options::delivery_mode(proton::delivery_mode m) {impl_->delivery_mode = m; return *this; }
 receiver_options& receiver_options::auto_accept(bool b) {impl_->auto_accept = b; return *this; }
 receiver_options& receiver_options::auto_settle(bool b) {impl_->auto_settle = b; return *this; }
 receiver_options& receiver_options::credit_window(int w) {impl_->credit_window = w; return *this; }

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/d7e6e175/proton-c/bindings/cpp/src/sender_options.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/sender_options.cpp b/proton-c/bindings/cpp/src/sender_options.cpp
index 9467c9e..ed030d9 100644
--- a/proton-c/bindings/cpp/src/sender_options.cpp
+++ b/proton-c/bindings/cpp/src/sender_options.cpp
@@ -51,12 +51,12 @@ class sender_options::impl {
         return link_context::get(unwrap(l));
     }
 
-    static void set_delivery_mode(sender l, enum delivery_mode mode) {
+    static void set_delivery_mode(sender l, proton::delivery_mode mode) {
         switch (mode) {
-        case AT_MOST_ONCE:
+        case delivery_mode::AT_MOST_ONCE:
             pn_link_set_snd_settle_mode(unwrap(l), PN_SND_SETTLED);
             break;
-        case AT_LEAST_ONCE:
+        case delivery_mode::AT_LEAST_ONCE:
             pn_link_set_snd_settle_mode(unwrap(l), PN_SND_UNSETTLED);
             pn_link_set_rcv_settle_mode(unwrap(l), PN_RCV_FIRST);
             break;
@@ -67,7 +67,7 @@ class sender_options::impl {
 
   public:
     option<proton_handler*> handler;
-    option<enum delivery_mode> delivery_mode;
+    option<proton::delivery_mode> delivery_mode;
     option<bool> auto_settle;
     option<source_options> source;
     option<target_options> target;
@@ -112,7 +112,7 @@ sender_options& sender_options::operator=(const sender_options& x) {
 void sender_options::update(const sender_options& x) { impl_->update(*x.impl_); }
 
 sender_options& sender_options::handler(class handler *h) { impl_->handler = h->messaging_adapter_.get(); return *this; }
-sender_options& sender_options::delivery_mode(enum delivery_mode m) {impl_->delivery_mode = m; return *this; }
+sender_options& sender_options::delivery_mode(proton::delivery_mode m) {impl_->delivery_mode = m; return *this; }
 sender_options& sender_options::auto_settle(bool b) {impl_->auto_settle = b; return *this; }
 sender_options& sender_options::source(source_options &s) {impl_->source = s; return *this; }
 sender_options& sender_options::target(target_options &s) {impl_->target = s; return *this; }


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


[2/3] qpid-proton git commit: PROTON-1191: [C++ binding] Move source/target enums into terminus/source/target classes

Posted by as...@apache.org.
PROTON-1191: [C++ binding] Move source/target enums into terminus/source/target classes


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

Branch: refs/heads/master
Commit: c3c477d25a5ec038081d29c2076a099d92e484e7
Parents: a65782a
Author: Andrew Stitcher <as...@apache.org>
Authored: Wed May 4 19:36:03 2016 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Thu May 5 15:20:29 2016 -0400

----------------------------------------------------------------------
 examples/cpp/queue_browser.cpp                  |  3 +-
 .../cpp/include/proton/delivery_mode.hpp        |  2 +-
 .../bindings/cpp/include/proton/settings.hpp    | 59 --------------------
 proton-c/bindings/cpp/include/proton/source.hpp | 12 ++++
 .../cpp/include/proton/source_options.hpp       |  6 +-
 proton-c/bindings/cpp/include/proton/target.hpp |  5 ++
 .../cpp/include/proton/target_options.hpp       |  5 +-
 .../bindings/cpp/include/proton/terminus.hpp    | 17 ++++--
 proton-c/bindings/cpp/src/node_options.cpp      | 24 ++++----
 proton-c/bindings/cpp/src/source.cpp            |  4 ++
 proton-c/bindings/cpp/src/terminus.cpp          | 10 ++--
 11 files changed, 58 insertions(+), 89 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c3c477d2/examples/cpp/queue_browser.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/queue_browser.cpp b/examples/cpp/queue_browser.cpp
index 2a1d9be..a1fa471 100644
--- a/examples/cpp/queue_browser.cpp
+++ b/examples/cpp/queue_browser.cpp
@@ -25,7 +25,6 @@
 #include "proton/handler.hpp"
 #include "proton/receiver_options.hpp"
 #include "proton/source_options.hpp"
-#include "proton/settings.hpp"
 #include "proton/url.hpp"
 
 #include <iostream>
@@ -43,7 +42,7 @@ class browser : public proton::handler {
 
     void on_container_start(proton::container &c) override {
         proton::connection conn = c.connect(url);
-        source_options browsing = source_options().distribution_mode(proton::COPY);
+        source_options browsing = source_options().distribution_mode(proton::source::COPY);
         conn.open_receiver(url.path(), proton::receiver_options().source(browsing));
     }
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c3c477d2/proton-c/bindings/cpp/include/proton/delivery_mode.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/delivery_mode.hpp b/proton-c/bindings/cpp/include/proton/delivery_mode.hpp
index 677ce7e..913f43b 100644
--- a/proton-c/bindings/cpp/include/proton/delivery_mode.hpp
+++ b/proton-c/bindings/cpp/include/proton/delivery_mode.hpp
@@ -28,7 +28,7 @@ namespace proton {
 enum delivery_mode {
     // No set policy.  The application must settle messages itself
     // according to its own policy.
-    DELIVERY_MODE_NONE = 0,
+    NONE = 0,
     // Outgoing messages are settled immediately by the link.
     // There are no duplicates.
     AT_MOST_ONCE,

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c3c477d2/proton-c/bindings/cpp/include/proton/settings.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/settings.hpp b/proton-c/bindings/cpp/include/proton/settings.hpp
deleted file mode 100644
index c655399..0000000
--- a/proton-c/bindings/cpp/include/proton/settings.hpp
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef PROTON_CPP_SETTINGS_H
-#define PROTON_CPP_SETTINGS_H
-
-/*
- *
- * 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 "proton/link.h"
-
-namespace proton {
-
-// Source/target settings
-
-/// Durability
-enum durability_mode {
-    NONE = PN_NONDURABLE,
-    CONFIGURATION = PN_CONFIGURATION,
-    UNSETTLED_STATE = PN_DELIVERIES
-};
-
-/// Expiry policy
-enum expiry_policy {
-    LINK_CLOSE = PN_EXPIRE_WITH_LINK,
-    SESSION_CLOSE = PN_EXPIRE_WITH_SESSION,
-    CONNECTION_CLOSE = PN_EXPIRE_WITH_CONNECTION,
-    NEVER = PN_EXPIRE_NEVER
-};
-
-
-// Source setting
-
-/// Distribution mode
-enum distribution_mode {
-    MODE_UNSPECIFIED = PN_DIST_MODE_UNSPECIFIED,
-    COPY = PN_DIST_MODE_COPY,
-    MOVE = PN_DIST_MODE_MOVE
-};
-
-
-}
-
-#endif // PROTON_CPP_SETTINGS_H

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c3c477d2/proton-c/bindings/cpp/include/proton/source.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/source.hpp b/proton-c/bindings/cpp/include/proton/source.hpp
index ef6f1a3..efe5889 100644
--- a/proton-c/bindings/cpp/include/proton/source.hpp
+++ b/proton-c/bindings/cpp/include/proton/source.hpp
@@ -46,9 +46,21 @@ class source : public terminus {
 
     source() : terminus() {}
 
+    enum distribution_mode {
+      UNSPECIFIED = PN_DIST_MODE_UNSPECIFIED,
+      COPY = PN_DIST_MODE_COPY,
+      MOVE = PN_DIST_MODE_MOVE
+    };
+
+    using terminus::durability_mode;
+    using terminus::expiry_policy;
+
     /// The address of the source.
     PN_CPP_EXTERN std::string address() const;
 
+    /// Get the distribution mode.
+    PN_CPP_EXTERN enum distribution_mode distribution_mode() const;
+
     /// Obtain the set of message filters.
     PN_CPP_EXTERN filter_map filters() const;
     /// @cond INTERNAL

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c3c477d2/proton-c/bindings/cpp/include/proton/source_options.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/source_options.hpp b/proton-c/bindings/cpp/include/proton/source_options.hpp
index b1676b7..0a1d280 100644
--- a/proton-c/bindings/cpp/include/proton/source_options.hpp
+++ b/proton-c/bindings/cpp/include/proton/source_options.hpp
@@ -65,16 +65,16 @@ class source_options {
     PN_CPP_EXTERN source_options& dynamic(bool);
 
     /// Control whether messsages are browsed or consumed.
-    PN_CPP_EXTERN source_options& distribution_mode(enum distribution_mode);
+    PN_CPP_EXTERN source_options& distribution_mode(enum source::distribution_mode);
 
     /// Control the persistence of source state.
-    PN_CPP_EXTERN source_options& durability_mode(enum durability_mode);
+    PN_CPP_EXTERN source_options& durability_mode(enum source::durability_mode);
 
     /// The expiry period after which the source is discarded.
     PN_CPP_EXTERN source_options& timeout(duration);
 
     /// Control when the clock for expiration begins.
-    PN_CPP_EXTERN source_options& expiry_policy(enum expiry_policy);
+    PN_CPP_EXTERN source_options& expiry_policy(enum source::expiry_policy);
 
     /// Specify a filter mechanism on the source that restricts
     /// message flow to a subset of the available messages.

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c3c477d2/proton-c/bindings/cpp/include/proton/target.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/target.hpp b/proton-c/bindings/cpp/include/proton/target.hpp
index ca7dc69..0415038 100644
--- a/proton-c/bindings/cpp/include/proton/target.hpp
+++ b/proton-c/bindings/cpp/include/proton/target.hpp
@@ -41,7 +41,12 @@ class receiver;
 class target : public terminus {
   public:
     target() : terminus() {}
+
+    using terminus::durability_mode;
+    using terminus::expiry_policy;
+
     PN_CPP_EXTERN std::string address() const;
+
     /// @cond INTERNAL
   private:
     target(pn_terminus_t* t);

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c3c477d2/proton-c/bindings/cpp/include/proton/target_options.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/target_options.hpp b/proton-c/bindings/cpp/include/proton/target_options.hpp
index f23aca3..8863598 100644
--- a/proton-c/bindings/cpp/include/proton/target_options.hpp
+++ b/proton-c/bindings/cpp/include/proton/target_options.hpp
@@ -27,6 +27,7 @@
 #include "proton/pn_unique_ptr.hpp"
 #include "proton/types.hpp"
 #include "proton/delivery_mode.hpp"
+#include "proton/target.hpp"
 #include "proton/terminus.hpp"
 
 #include <vector>
@@ -65,13 +66,13 @@ class target_options {
     PN_CPP_EXTERN target_options& dynamic(bool);
 
     /// Control the persistence of target state.
-    PN_CPP_EXTERN target_options& durability_mode(enum durability_mode);
+    PN_CPP_EXTERN target_options& durability_mode(enum target::durability_mode);
 
     /// The expiry period after which the target is discarded.
     PN_CPP_EXTERN target_options& timeout(duration);
 
     /// Control when the clock for expiration begins.
-    PN_CPP_EXTERN target_options& expiry_policy(enum expiry_policy);
+    PN_CPP_EXTERN target_options& expiry_policy(enum target::expiry_policy);
 
 
     /// @cond INTERNAL

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c3c477d2/proton-c/bindings/cpp/include/proton/terminus.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/terminus.hpp b/proton-c/bindings/cpp/include/proton/terminus.hpp
index 7ee60f4..cdcb7d3 100644
--- a/proton-c/bindings/cpp/include/proton/terminus.hpp
+++ b/proton-c/bindings/cpp/include/proton/terminus.hpp
@@ -25,7 +25,6 @@
 #include "proton/export.hpp"
 #include "proton/object.hpp"
 #include "proton/value.hpp"
-#include "proton/settings.hpp"
 
 #include "proton/link.h"
 #include <string>
@@ -46,6 +45,19 @@ class terminus {
   public:
     terminus() : object_(0), parent_(0) {}
 
+    enum durability_mode {
+      NONDURABLE = PN_NONDURABLE,
+      CONFIGURATION = PN_CONFIGURATION,
+      UNSETTLED_STATE = PN_DELIVERIES
+    };
+
+    enum expiry_policy {
+      LINK_CLOSE = PN_EXPIRE_WITH_LINK,
+      SESSION_CLOSE = PN_EXPIRE_WITH_SESSION,
+      CONNECTION_CLOSE = PN_EXPIRE_WITH_CONNECTION,
+      NEVER = PN_EXPIRE_NEVER
+    };
+
     /// Control when the clock for expiration begins.
     PN_CPP_EXTERN enum expiry_policy expiry_policy() const;
 
@@ -53,9 +65,6 @@ class terminus {
     /// duration is rounded to the nearest second.
     PN_CPP_EXTERN duration timeout() const;
 
-    /// Get the distribution mode.
-    PN_CPP_EXTERN enum distribution_mode distribution_mode() const;
-
     /// Get the durability flag.
     PN_CPP_EXTERN enum durability_mode durability_mode();
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c3c477d2/proton-c/bindings/cpp/src/node_options.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/node_options.cpp b/proton-c/bindings/cpp/src/node_options.cpp
index ade5dd9..1053560 100644
--- a/proton-c/bindings/cpp/src/node_options.cpp
+++ b/proton-c/bindings/cpp/src/node_options.cpp
@@ -73,11 +73,11 @@ void node_address(terminus &t, option<std::string> &addr, option<bool> &dynamic)
     }
 }
 
-void node_durability(terminus &t, option<enum durability_mode> &mode) {
+void node_durability(terminus &t, option<enum terminus::durability_mode> &mode) {
     if (mode.set) pn_terminus_set_durability(unwrap(t), pn_durability_t(mode.value));
 }
 
-void node_expiry(terminus &t, option<enum expiry_policy> &policy, option<duration> &d) {
+void node_expiry(terminus &t, option<enum terminus::expiry_policy> &policy, option<duration> &d) {
     if (policy.set) pn_terminus_set_expiry_policy(unwrap(t), pn_expiry_policy_t(policy.value));
     if (d.set) timeout(t, d.value);
 }
@@ -89,10 +89,10 @@ class source_options::impl {
   public:
     option<std::string> address;
     option<bool> dynamic;
-    option<enum durability_mode> durability_mode;
+    option<enum source::durability_mode> durability_mode;
     option<duration> timeout;
-    option<enum expiry_policy> expiry_policy;
-    option<enum distribution_mode> distribution_mode;
+    option<enum source::expiry_policy> expiry_policy;
+    option<enum source::distribution_mode> distribution_mode;
     option<source::filter_map> filters;
 
     void apply(source& s) {
@@ -135,10 +135,10 @@ void source_options::update(const source_options& x) { impl_->update(*x.impl_);
 
 source_options& source_options::address(const std::string &addr) { impl_->address = addr; return *this; }
 source_options& source_options::dynamic(bool b) { impl_->dynamic = b; return *this; }
-source_options& source_options::durability_mode(enum durability_mode m) { impl_->durability_mode = m; return *this; }
+source_options& source_options::durability_mode(enum source::durability_mode m) { impl_->durability_mode = m; return *this; }
 source_options& source_options::timeout(duration d) { impl_->timeout = d; return *this; }
-source_options& source_options::expiry_policy(enum expiry_policy m) { impl_->expiry_policy = m; return *this; }
-source_options& source_options::distribution_mode(enum distribution_mode m) { impl_->distribution_mode = m; return *this; }
+source_options& source_options::expiry_policy(enum source::expiry_policy m) { impl_->expiry_policy = m; return *this; }
+source_options& source_options::distribution_mode(enum source::distribution_mode m) { impl_->distribution_mode = m; return *this; }
 source_options& source_options::filters(const source::filter_map &map) { impl_->filters = map; return *this; }
 
 void source_options::apply(source& s) const { impl_->apply(s); }
@@ -149,9 +149,9 @@ class target_options::impl {
   public:
     option<std::string> address;
     option<bool> dynamic;
-    option<enum durability_mode> durability_mode;
+    option<enum target::durability_mode> durability_mode;
     option<duration> timeout;
-    option<enum expiry_policy> expiry_policy;
+    option<enum target::expiry_policy> expiry_policy;
 
     void apply(target& t) {
         node_address(t, address, dynamic);
@@ -184,9 +184,9 @@ void target_options::update(const target_options& x) { impl_->update(*x.impl_);
 
 target_options& target_options::address(const std::string &addr) { impl_->address = addr; return *this; }
 target_options& target_options::dynamic(bool b) { impl_->dynamic = b; return *this; }
-target_options& target_options::durability_mode(enum durability_mode m) { impl_->durability_mode = m; return *this; }
+target_options& target_options::durability_mode(enum target::durability_mode m) { impl_->durability_mode = m; return *this; }
 target_options& target_options::timeout(duration d) { impl_->timeout = d; return *this; }
-target_options& target_options::expiry_policy(enum expiry_policy m) { impl_->expiry_policy = m; return *this; }
+target_options& target_options::expiry_policy(enum target::expiry_policy m) { impl_->expiry_policy = m; return *this; }
 
 void target_options::apply(target& s) const { impl_->apply(s); }
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c3c477d2/proton-c/bindings/cpp/src/source.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/source.cpp b/proton-c/bindings/cpp/src/source.cpp
index 3816c78..1c9a5bd 100644
--- a/proton-c/bindings/cpp/src/source.cpp
+++ b/proton-c/bindings/cpp/src/source.cpp
@@ -43,6 +43,10 @@ std::string source::address() const {
     return str(pn_terminus_get_address(authoritative));
 }
 
+enum source::distribution_mode source::distribution_mode() const {
+  return (enum distribution_mode)pn_terminus_get_distribution_mode(object_);
+}
+
 source::filter_map source::filters() const {
     codec::decoder d(pn_terminus_filter(object_));
     filter_map map;

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c3c477d2/proton-c/bindings/cpp/src/terminus.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/terminus.cpp b/proton-c/bindings/cpp/src/terminus.cpp
index 7d3bc5b..138a42c 100644
--- a/proton-c/bindings/cpp/src/terminus.cpp
+++ b/proton-c/bindings/cpp/src/terminus.cpp
@@ -19,6 +19,8 @@
  *
  */
 
+#include "proton/terminus.hpp"
+
 #include "proton_bits.hpp"
 
 #include "proton/link.hpp"
@@ -30,7 +32,7 @@ terminus::terminus(pn_terminus_t* t) :
     object_(t), parent_(0)
 {}
 
-enum expiry_policy terminus::expiry_policy() const {
+enum terminus::expiry_policy terminus::expiry_policy() const {
     return (enum expiry_policy)pn_terminus_get_expiry_policy(object_);
 }
 
@@ -38,11 +40,7 @@ duration terminus::timeout() const {
     return duration::SECOND * pn_terminus_get_timeout(object_);
 }
 
-enum distribution_mode terminus::distribution_mode() const {
-    return (enum distribution_mode)pn_terminus_get_distribution_mode(object_);
-}
-
-enum durability_mode terminus::durability_mode() {
+enum terminus::durability_mode terminus::durability_mode() {
     return (enum durability_mode) pn_terminus_get_durability(object_);
 }
 


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