You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by jr...@apache.org on 2017/10/13 03:27:01 UTC

qpid-proton git commit: PROTON-1369: Add deprecation warnings; update examples to avoid use of url

Repository: qpid-proton
Updated Branches:
  refs/heads/master 47c9ae01d -> bc6014057


PROTON-1369: Add deprecation warnings; update examples to avoid use of url


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

Branch: refs/heads/master
Commit: bc6014057311be47bc6a5733105ab982f8126099
Parents: 47c9ae0
Author: Justin Ross <jr...@apache.org>
Authored: Thu Oct 12 20:09:39 2017 -0700
Committer: Justin Ross <jr...@apache.org>
Committed: Thu Oct 12 20:09:39 2017 -0700

----------------------------------------------------------------------
 examples/cpp/CMakeLists.txt                     |  2 +-
 examples/cpp/broker.cpp                         |  3 +-
 examples/cpp/example_test.py                    |  2 +-
 examples/cpp/helloworld.cpp                     | 19 +++----
 examples/cpp/queue_browser.cpp                  | 34 +++++++------
 examples/cpp/reconnect_client.cpp               |  3 +-
 examples/cpp/scheduled_send_03.cpp              |  3 +-
 examples/cpp/selected_recv.cpp                  | 17 ++++---
 examples/cpp/server.cpp                         | 53 +++++++++-----------
 examples/cpp/service_bus.cpp                    |  6 +--
 proton-c/bindings/cpp/CMakeLists.txt            |  2 +-
 .../bindings/cpp/include/proton/container.hpp   |  8 +--
 .../cpp/include/proton/default_container.hpp    |  2 +-
 .../bindings/cpp/include/proton/function.hpp    | 18 +++----
 .../cpp/include/proton/internal/export.hpp      | 16 +++++-
 proton-c/bindings/cpp/include/proton/url.hpp    |  4 +-
 proton-c/bindings/cpp/include/proton/value.hpp  | 14 ++----
 .../bindings/cpp/include/proton/work_queue.hpp  | 18 +++----
 .../cpp/src/proactor_container_impl.cpp         |  2 -
 19 files changed, 113 insertions(+), 113 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bc601405/examples/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt
index 5584201..4114c94 100644
--- a/examples/cpp/CMakeLists.txt
+++ b/examples/cpp/CMakeLists.txt
@@ -55,7 +55,6 @@ foreach(example
     flow_control
     ssl
     ssl_client_cert
-    service_bus
     encode_decode)
   add_executable(${example} ${example}.cpp)
   set_target_properties(${example} PROPERTIES LINK_FLAGS "${CXX_EXAMPLE_FLAGS}")
@@ -65,6 +64,7 @@ if(HAS_CPP11)
   # Examples that require C++11
   foreach(example
       scheduled_send
+      service_bus
       multithreaded_client
       multithreaded_client_flow_control
       )

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bc601405/examples/cpp/broker.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/broker.cpp b/examples/cpp/broker.cpp
index a1c379b..ea21e74 100644
--- a/examples/cpp/broker.cpp
+++ b/examples/cpp/broker.cpp
@@ -17,6 +17,8 @@
  * under the License.
  */
 
+#define PN_CPP_USE_DEPRECATED_API 1
+
 #include "options.hpp"
 
 #include <proton/connection.hpp>
@@ -24,7 +26,6 @@
 #include <proton/container.hpp>
 #include <proton/delivery.hpp>
 #include <proton/error_condition.hpp>
-#include <proton/function.hpp>
 #include <proton/listen_handler.hpp>
 #include <proton/listener.hpp>
 #include <proton/message.hpp>

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bc601405/examples/cpp/example_test.py
----------------------------------------------------------------------
diff --git a/examples/cpp/example_test.py b/examples/cpp/example_test.py
index 6dd8587..bc4c6e6 100644
--- a/examples/cpp/example_test.py
+++ b/examples/cpp/example_test.py
@@ -142,7 +142,7 @@ class ContainerExampleTest(BrokerTestCase):
                 send.wait_exit())
 
     def test_request_response(self):
-        server = self.proc(["server", "-a", self.addr])
+        server = self.proc(["server", self.addr, "example"]) # self.addr has the connection info
         server.wait_re("connected")
         self.assertMultiLineEqual(CLIENT_EXPECT,
                          self.proc(["client", "-a", self.addr]).wait_exit())

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bc601405/examples/cpp/helloworld.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/helloworld.cpp b/examples/cpp/helloworld.cpp
index b9f5b45..5962826 100644
--- a/examples/cpp/helloworld.cpp
+++ b/examples/cpp/helloworld.cpp
@@ -25,26 +25,26 @@
 #include <proton/message.hpp>
 #include <proton/messaging_handler.hpp>
 #include <proton/tracker.hpp>
-#include <proton/url.hpp>
 
 #include <iostream>
 
 #include "fake_cpp11.hpp"
 
 class hello_world : public proton::messaging_handler {
-  private:
-    proton::url url;
+    std::string conn_url_;
+    std::string addr_;
 
   public:
-    hello_world(const std::string& u) : url(u) {}
+    hello_world(const std::string& u, const std::string& a) :
+        conn_url_(u), addr_(a) {}
 
     void on_container_start(proton::container& c) OVERRIDE {
-        c.connect(url);
+        c.connect(conn_url_);
     }
 
     void on_connection_open(proton::connection& c) OVERRIDE {
-        c.open_receiver(url.path());
-        c.open_sender(url.path());
+        c.open_receiver(addr_);
+        c.open_sender(addr_);
     }
 
     void on_sendable(proton::sender &s) OVERRIDE {
@@ -61,9 +61,10 @@ class hello_world : public proton::messaging_handler {
 
 int main(int argc, char **argv) {
     try {
-        std::string url = argc > 1 ? argv[1] : "127.0.0.1:5672/examples";
+        std::string conn_url = argc > 1 ? argv[1] : "//127.0.0.1:5672";
+        std::string addr = argc > 2 ? argv[2] : "examples";
 
-        hello_world hw(url);
+        hello_world hw(conn_url, addr);
         proton::container(hw).run();
 
         return 0;

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bc601405/examples/cpp/queue_browser.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/queue_browser.cpp b/examples/cpp/queue_browser.cpp
index 4e1c6de..b306e76 100644
--- a/examples/cpp/queue_browser.cpp
+++ b/examples/cpp/queue_browser.cpp
@@ -26,38 +26,40 @@
 #include <proton/messaging_handler.hpp>
 #include <proton/receiver_options.hpp>
 #include <proton/source_options.hpp>
-#include <proton/url.hpp>
 
 #include <iostream>
 
 #include "fake_cpp11.hpp"
 
-using proton::source_options;
-
-class browser : public proton::messaging_handler {
-  private:
-    proton::url url;
+class queue_browser : public proton::messaging_handler {
+    std::string conn_url_;
+    std::string addr_;
 
   public:
-    browser(const std::string& u) : url(u) {}
+    queue_browser(const std::string& u, const std::string& a) :
+        conn_url_(u), addr_(a) {}
+
+    void on_container_start(proton::container& c) OVERRIDE {
+        proton::receiver_options ropts;
+        proton::source_options sopts;
+        ropts.source(sopts.distribution_mode(proton::source::COPY));
 
-    void on_container_start(proton::container &c) OVERRIDE {
-        proton::connection conn = c.connect(url);
-        source_options browsing = source_options().distribution_mode(proton::source::COPY);
-        conn.open_receiver(url.path(), proton::receiver_options().source(browsing));
+        proton::connection conn = c.connect(conn_url_);
+        conn.open_receiver(addr_, ropts);
     }
 
-    void on_message(proton::delivery &, proton::message &m) OVERRIDE {
+    void on_message(proton::delivery&, proton::message& m) OVERRIDE {
         std::cout << m.body() << std::endl;
     }
 };
 
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
     try {
-        std::string url = argc > 1 ? argv[1] : "127.0.0.1:5672/examples";
+        std::string conn_url = argc > 1 ? argv[1] : "//127.0.0.1:5672";
+        std::string addr = argc > 2 ? argv[2] : "examples";
 
-        browser b(url);
-        proton::container(b).run();
+        queue_browser qb(conn_url, addr);
+        proton::container(qb).run();
 
         return 0;
     } catch (const std::exception& e) {

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bc601405/examples/cpp/reconnect_client.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/reconnect_client.cpp b/examples/cpp/reconnect_client.cpp
index 6075f03..ed93214 100644
--- a/examples/cpp/reconnect_client.cpp
+++ b/examples/cpp/reconnect_client.cpp
@@ -24,7 +24,6 @@
 #include <proton/connection.hpp>
 #include <proton/connection_options.hpp>
 #include <proton/container.hpp>
-#include <proton/default_container.hpp>
 #include <proton/delivery.hpp>
 #include <proton/link.hpp>
 #include <proton/message.hpp>
@@ -133,7 +132,7 @@ int main(int argc, const char** argv) {
         std::vector<std::string> failovers(&argv[4], &argv[argc]);
 
         reconnect_client client(url, address, message_count, failovers);
-        proton::default_container(client).run();
+        proton::container(client).run();
 
         return 0;
     } catch (const std::exception& e) {

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bc601405/examples/cpp/scheduled_send_03.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/scheduled_send_03.cpp b/examples/cpp/scheduled_send_03.cpp
index d3ba8ab..3114157 100644
--- a/examples/cpp/scheduled_send_03.cpp
+++ b/examples/cpp/scheduled_send_03.cpp
@@ -19,12 +19,13 @@
  *
  */
 
+#define PN_CPP_USE_DEPRECATED_API 1
+
 #include "options.hpp"
 
 #include <proton/container.hpp>
 #include <proton/connection.hpp>
 #include <proton/duration.hpp>
-#include <proton/function.hpp>
 #include <proton/message.hpp>
 #include <proton/messaging_handler.hpp>
 #include <proton/sender.hpp>

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bc601405/examples/cpp/selected_recv.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/selected_recv.cpp b/examples/cpp/selected_recv.cpp
index 65e88e1..e54d556 100644
--- a/examples/cpp/selected_recv.cpp
+++ b/examples/cpp/selected_recv.cpp
@@ -25,7 +25,6 @@
 #include <proton/messaging_handler.hpp>
 #include <proton/receiver_options.hpp>
 #include <proton/source_options.hpp>
-#include <proton/url.hpp>
 
 #include <iostream>
 
@@ -55,17 +54,18 @@ namespace {
 
 
 class selected_recv : public proton::messaging_handler {
-  private:
-    proton::url url;
+    std::string conn_url_;
+    std::string addr_;
 
   public:
-    selected_recv(const std::string& u) : url(u) {}
+    selected_recv(const std::string& u, const std::string& a) :
+        conn_url_(u), addr_(a) {}
 
     void on_container_start(proton::container &c) OVERRIDE {
         proton::source_options opts;
         set_filter(opts, "colour = 'green'");
-        proton::connection conn = c.connect(url);
-        conn.open_receiver(url.path(), proton::receiver_options().source(opts));
+        proton::connection conn = c.connect(conn_url_);
+        conn.open_receiver(addr_, proton::receiver_options().source(opts));
     }
 
     void on_message(proton::delivery &, proton::message &m) OVERRIDE {
@@ -75,9 +75,10 @@ class selected_recv : public proton::messaging_handler {
 
 int main(int argc, char **argv) {
     try {
-        std::string url = argc > 1 ? argv[1] : "127.0.0.1:5672/examples";
+        std::string conn_url = argc > 1 ? argv[1] : "//127.0.0.1:5672";
+        std::string addr = argc > 2 ? argv[2] : "examples";
 
-        selected_recv recv(url);
+        selected_recv recv(conn_url, addr);
         proton::container(recv).run();
 
         return 0;

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bc601405/examples/cpp/server.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/server.cpp b/examples/cpp/server.cpp
index d5e6b36..8e177df 100644
--- a/examples/cpp/server.cpp
+++ b/examples/cpp/server.cpp
@@ -19,15 +19,11 @@
  *
  */
 
-#include "options.hpp"
-
 #include <proton/connection.hpp>
 #include <proton/container.hpp>
 #include <proton/message.hpp>
 #include <proton/message_id.hpp>
 #include <proton/messaging_handler.hpp>
-#include <proton/tracker.hpp>
-#include <proton/url.hpp>
 
 #include <iostream>
 #include <map>
@@ -37,31 +33,34 @@
 #include "fake_cpp11.hpp"
 
 class server : public proton::messaging_handler {
-  private:
-    typedef std::map<std::string, proton::sender> sender_map;
-    proton::url url;
-    proton::connection connection;
-    sender_map senders;
+    std::string conn_url_;
+    std::string addr_;
+    proton::connection conn_;
+    std::map<std::string, proton::sender> senders_;
 
   public:
-    server(const std::string &u) : url(u) {}
+    server(const std::string& u, const std::string& a) :
+        conn_url_(u), addr_(a) {}
 
-    void on_container_start(proton::container &c) OVERRIDE {
-        connection = c.connect(url);
-        connection.open_receiver(url.path());
+    void on_container_start(proton::container& c) OVERRIDE {
+        conn_ = c.connect(conn_url_);
+        conn_.open_receiver(addr_);
 
-        std::cout << "server connected to " << url << std::endl;
+        std::cout << "Server connected to " << conn_url_ << std::endl;
     }
 
-    std::string to_upper(const std::string &s) {
+    std::string to_upper(const std::string& s) {
         std::string uc(s);
         size_t l = uc.size();
-        for (size_t i=0; i<l; i++)
+
+        for (size_t i=0; i<l; i++) {
             uc[i] = static_cast<char>(std::toupper(uc[i]));
+        }
+
         return uc;
     }
 
-    void on_message(proton::delivery &, proton::message &m) OVERRIDE {
+    void on_message(proton::delivery&, proton::message& m) OVERRIDE {
         std::cout << "Received " << m.body() << std::endl;
 
         std::string reply_to = m.reply_to();
@@ -71,29 +70,23 @@ class server : public proton::messaging_handler {
         reply.body(to_upper(proton::get<std::string>(m.body())));
         reply.correlation_id(m.correlation_id());
 
-        if (!senders[reply_to]) {
-            senders[reply_to] = connection.open_sender(reply_to);
+        if (!senders_[reply_to]) {
+            senders_[reply_to] = conn_.open_sender(reply_to);
         }
 
-        senders[reply_to].send(reply);
+        senders_[reply_to].send(reply);
     }
 };
 
-int main(int argc, char **argv) {
-    std::string address("amqp://0.0.0.0:5672/examples");
-    example::options opts(argc, argv);
-
-    opts.add_value(address, 'a', "address", "listen on URL", "URL");
-
+int main(int argc, char** argv) {
     try {
-        opts.parse();
+        std::string conn_url = argc > 1 ? argv[1] : "//127.0.0.1:5672";
+        std::string addr = argc > 2 ? argv[2] : "examples";
 
-        server srv(address);
+        server srv(conn_url, addr);
         proton::container(srv).run();
 
         return 0;
-    } catch (const example::bad_option& e) {
-        std::cout << opts << std::endl << e.what() << std::endl;
     } catch (const std::exception& e) {
         std::cerr << e.what() << std::endl;
     }

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bc601405/examples/cpp/service_bus.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/service_bus.cpp b/examples/cpp/service_bus.cpp
index 4b16a62..c99bca6 100644
--- a/examples/cpp/service_bus.cpp
+++ b/examples/cpp/service_bus.cpp
@@ -86,7 +86,6 @@ Done. No more messages.
 #include <proton/connection_options.hpp>
 #include <proton/container.hpp>
 #include <proton/delivery.hpp>
-#include <proton/function.hpp>
 #include <proton/message.hpp>
 #include <proton/messaging_handler.hpp>
 #include <proton/receiver_options.hpp>
@@ -94,7 +93,6 @@ Done. No more messages.
 #include <proton/sender_options.hpp>
 #include <proton/source_options.hpp>
 #include <proton/tracker.hpp>
-#include <proton/url.hpp>
 #include <proton/work_queue.hpp>
 
 #include <iostream>
@@ -161,7 +159,7 @@ class session_receiver : public proton::messaging_handler {
         // identifier if none was specified).
         last_read = proton::timestamp::now();
         // Call this->process_timeout after read_timeout.
-        container->schedule(read_timeout, make_work(&session_receiver::process_timeout, this));
+        container->schedule(read_timeout, [this]() { this->process_timeout(); });
     }
 
     void on_receiver_open(proton::receiver &r) OVERRIDE {
@@ -191,7 +189,7 @@ class session_receiver : public proton::messaging_handler {
                 std::cout << "Done. No more messages." << std::endl;
         } else {
             proton::duration next = deadline - now;
-            container->schedule(next, make_work(&session_receiver::process_timeout, this));
+            container->schedule(next, [this]() { this->process_timeout(); });
         }
     }
 };

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bc601405/proton-c/bindings/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/CMakeLists.txt b/proton-c/bindings/cpp/CMakeLists.txt
index a028c98..859e364 100644
--- a/proton-c/bindings/cpp/CMakeLists.txt
+++ b/proton-c/bindings/cpp/CMakeLists.txt
@@ -64,7 +64,7 @@ include_directories(
   "${CMAKE_CURRENT_SOURCE_DIR}/include"
   "${CMAKE_CURRENT_SOURCE_DIR}/src/include")
 
-add_definitions(${CXX_STANDARD} ${CXX_WARNING_FLAGS})
+add_definitions(${CXX_STANDARD} ${CXX_WARNING_FLAGS} -DPN_CPP_USE_DEPRECATED_API=1)
 
 set(qpid-proton-cpp-source
   src/binary.cpp

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bc601405/proton-c/bindings/cpp/include/proton/container.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/container.hpp b/proton-c/bindings/cpp/include/proton/container.hpp
index fe3857d..897f8e0 100644
--- a/proton-c/bindings/cpp/include/proton/container.hpp
+++ b/proton-c/bindings/cpp/include/proton/container.hpp
@@ -309,12 +309,12 @@ class PN_CPP_CLASS_EXTERN container {
     /// `std::function<void()>` type for the `fn` parameter.
     PN_CPP_EXTERN void schedule(duration dur, work fn);
 
-    /// @deprecated
-    PN_CPP_EXTERN void schedule(duration dur, void_function0& fn);
+    /// **Deprecated** - Use `container::schedule(duration, work)`.
+    PN_CPP_EXTERN PN_CPP_DEPRECATED("Use 'container::schedule(duration, work)'") void schedule(duration dur, void_function0& fn);
 
     /// @cond INTERNAL
-    /// This is a hack to ensure that the C++03 version is declared
-    /// only during the compilation of the library
+    // This is a hack to ensure that the C++03 version is declared
+    // only during the compilation of the library
 #if PN_CPP_HAS_LAMBDAS && PN_CPP_HAS_VARIADIC_TEMPLATES && defined(qpid_proton_cpp_EXPORTS)
     PN_CPP_EXTERN void schedule(duration dur, v03::work fn);
 #endif

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bc601405/proton-c/bindings/cpp/include/proton/default_container.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/default_container.hpp b/proton-c/bindings/cpp/include/proton/default_container.hpp
index 3c84dc8..c081c4b 100644
--- a/proton-c/bindings/cpp/include/proton/default_container.hpp
+++ b/proton-c/bindings/cpp/include/proton/default_container.hpp
@@ -28,7 +28,7 @@
 namespace proton {
 
 /// **Deprecated** - Use `proton::container`.
-typedef class container default_container;
+typedef class container PN_CPP_DEPRECATED("Use 'proton::container'") default_container;
 
 } // proton
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bc601405/proton-c/bindings/cpp/include/proton/function.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/function.hpp b/proton-c/bindings/cpp/include/proton/function.hpp
index 452ceaf..b6314d0 100644
--- a/proton-c/bindings/cpp/include/proton/function.hpp
+++ b/proton-c/bindings/cpp/include/proton/function.hpp
@@ -21,7 +21,7 @@
  */
 
 /// @file
-/// **Deprecated** - Use `proton::work`.
+/// @copybrief void_function0
 
 /// @cond INTERNAL
 
@@ -31,15 +31,15 @@ namespace proton {
 ///
 /// A C++03-compatible void no-argument callback function object.
 ///
-/// Used by container::schedule() and event_loop::inject().  In C++11
-/// you can use std::bind, std::function or a void-no-argument lambda
-/// instead.
+/// Used by `container::schedule()` and `work_queue::add()`.  In C++11
+/// you can use `std::bind`, `std::function`, or a void-no-argument
+/// lambda instead.
 ///
-/// void_function0 is passed by reference, so instances of sub-classes
-/// do not have to be heap allocated.  Once passed, the instance must
-/// not be deleted until its operator() is called or the container has
-/// stopped.
-class void_function0 {
+/// `void_function0` is passed by reference, so instances of
+/// subclasses do not have to be heap allocated.  Once passed, the
+/// instance must not be deleted until its `operator()` is called or
+/// the container has stopped.
+class PN_CPP_DEPRECATED("Use 'proton::work'") void_function0 {
   public:
     virtual ~void_function0() {}
     /// Override the call operator with your code.

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bc601405/proton-c/bindings/cpp/include/proton/internal/export.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/internal/export.hpp b/proton-c/bindings/cpp/include/proton/internal/export.hpp
index 4c95956..6101b58 100644
--- a/proton-c/bindings/cpp/include/proton/internal/export.hpp
+++ b/proton-c/bindings/cpp/include/proton/internal/export.hpp
@@ -42,9 +42,9 @@
   //
   // Non-Windows (Linux, etc.) definitions:
   //
-#  define PN_CPP_EXPORT __attribute ((visibility ("default")))
+#  define PN_CPP_EXPORT __attribute__((visibility("default")))
 #  define PN_CPP_IMPORT
-#  define PN_CPP_CLASS_EXPORT __attribute ((visibility ("default")))
+#  define PN_CPP_CLASS_EXPORT __attribute__((visibility("default")))
 #  define PN_CPP_CLASS_IMPORT
 #endif
 
@@ -57,6 +57,18 @@
 #  define PN_CPP_CLASS_EXTERN PN_CPP_CLASS_IMPORT
 #endif
 
+#if defined(PN_CPP_USE_DEPRECATED_API)
+#  define PN_CPP_DEPRECATED(message)
+#else
+#  if defined(PN_COMPILER_CXX_ATTRIBUTE_DEPRECATED) && PN_COMPILER_CXX_ATTRIBUTE_DEPRECATED
+#    define PN_CPP_DEPRECATED(message) [[deprecated(message)]]
+#  elif defined(WIN32)
+#    define PN_CPP_DEPRECATED(message) __declspec(deprecated(message))
+#  else
+#    define PN_CPP_DEPRECATED(message) __attribute__((deprecated(message)))
+#  endif
+#endif
+
 /// @endcond
 
 #endif // PROTON_INTERNAL_EXPORT_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bc601405/proton-c/bindings/cpp/include/proton/url.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/url.hpp b/proton-c/bindings/cpp/include/proton/url.hpp
index e2ded0e..c07f68a 100644
--- a/proton-c/bindings/cpp/include/proton/url.hpp
+++ b/proton-c/bindings/cpp/include/proton/url.hpp
@@ -38,7 +38,9 @@ namespace proton {
 /// **Deprecated** - Use a third-party URL library.
 ///
 /// An error encountered during URL parsing.
+
 struct
+PN_CPP_DEPRECATED("Use a third-party URL library")
 PN_CPP_CLASS_EXTERN url_error : public error {
     /// @cond INTERNAL
     /// Construct a URL error with a message.
@@ -60,7 +62,7 @@ PN_CPP_CLASS_EXTERN url_error : public error {
 ///
 /// - Path is normally used as a link source or target address.  On a
 ///   broker it typically corresponds to a queue or topic name.
-class url {
+class PN_CPP_DEPRECATED("Use a third-party URL library") url {
   public:
     static const std::string AMQP;     ///< "amqp" prefix
     static const std::string AMQPS;    ///< "amqps" prefix

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bc601405/proton-c/bindings/cpp/include/proton/value.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/value.hpp b/proton-c/bindings/cpp/include/proton/value.hpp
index 071f812..552a2e4 100644
--- a/proton-c/bindings/cpp/include/proton/value.hpp
+++ b/proton-c/bindings/cpp/include/proton/value.hpp
@@ -94,13 +94,9 @@ class value : public internal::value_base, private internal::comparable<value> {
     /// Reset the value to null/empty
     PN_CPP_EXTERN void clear();
 
-    /// @cond INTERNAL (deprecated)
-    template<class T> void get(T &t) const;
-    template<class T> T get() const;
-    PN_CPP_EXTERN int64_t as_int() const;
-    PN_CPP_EXTERN uint64_t as_uint() const;
-    PN_CPP_EXTERN double as_double() const;
-    PN_CPP_EXTERN std::string as_string() const;
+    /// @cond INTERNAL
+    template<class T> PN_CPP_DEPRECATED("Use 'proton::get'") void get(T &t) const;
+    template<class T> PN_CPP_DEPRECATED("Use 'proton::get'") T get() const;
     /// @endcond
 
     /// swap values
@@ -170,10 +166,6 @@ PN_CPP_EXTERN std::string to_string(const value& x);
 /// @cond INTERNAL
 template<class T> void value::get(T &x) const { x = proton::get<T>(*this); }
 template<class T> T value::get() const { return proton::get<T>(*this); }
-inline int64_t value::as_int() const { return proton::coerce<int64_t>(*this); }
-inline uint64_t value::as_uint() const { return proton::coerce<uint64_t>(*this); }
-inline double value::as_double() const { return proton::coerce<double>(*this); }
-inline std::string value::as_string() const { return proton::coerce<std::string>(*this); }
 /// @endcond
 
 } // proton

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bc601405/proton-c/bindings/cpp/include/proton/work_queue.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/work_queue.hpp b/proton-c/bindings/cpp/include/proton/work_queue.hpp
index 801c2dc..6caea6b 100644
--- a/proton-c/bindings/cpp/include/proton/work_queue.hpp
+++ b/proton-c/bindings/cpp/include/proton/work_queue.hpp
@@ -340,7 +340,7 @@ class PN_CPP_CLASS_EXTERN work_queue {
     PN_CPP_EXTERN ~work_queue();
 
     /// **Unsettled API** - Add work `fn` to the work queue.
-
+    ///
     /// Work `fn` will be called serially with other work in the queue.
     /// The work may be deferred and executed in another thread.
     ///
@@ -349,12 +349,12 @@ class PN_CPP_CLASS_EXTERN work_queue {
     /// reason.
     PN_CPP_EXTERN bool add(work fn);
 
-    /// @deprecated
-    PN_CPP_EXTERN bool add(void_function0& fn);
+    /// **Deprecated** - Use `add(work)`.
+    PN_CPP_EXTERN PN_CPP_DEPRECATED("Use 'work_queue::add(work)'") bool add(void_function0& fn);
 
     /// @cond INTERNAL
-    /// This is a hack to ensure that the C++03 version is declared
-    /// only during the compilation of the library
+    // This is a hack to ensure that the C++03 version is declared
+    // only during the compilation of the library
 #if PN_CPP_HAS_LAMBDAS && PN_CPP_HAS_VARIADIC_TEMPLATES && defined(qpid_proton_cpp_EXPORTS)
     PN_CPP_EXTERN bool add(v03::work fn);
 #endif
@@ -370,12 +370,12 @@ class PN_CPP_CLASS_EXTERN work_queue {
     /// @copydetails add()
     PN_CPP_EXTERN void schedule(duration, work fn);
 
-    /// @deprecated
-    PN_CPP_EXTERN void schedule(duration, void_function0& fn);
+    /// **Deprecated** - Use `schedule(duration, work)`.
+    PN_CPP_EXTERN PN_CPP_DEPRECATED("Use 'work_queue::schedule(duration, work)'") void schedule(duration, void_function0& fn);
 
     /// @cond INTERNAL
-    /// This is a hack to ensure that the C++03 version is declared
-    /// only during the compilation of the library
+    // This is a hack to ensure that the C++03 version is declared
+    // only during the compilation of the library
 #if PN_CPP_HAS_LAMBDAS && PN_CPP_HAS_VARIADIC_TEMPLATES && defined(qpid_proton_cpp_EXPORTS)
     PN_CPP_EXTERN void schedule(duration, v03::work fn);
 #endif

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bc601405/proton-c/bindings/cpp/src/proactor_container_impl.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/proactor_container_impl.cpp b/proton-c/bindings/cpp/src/proactor_container_impl.cpp
index ec617bd..92feaaa 100644
--- a/proton-c/bindings/cpp/src/proactor_container_impl.cpp
+++ b/proton-c/bindings/cpp/src/proactor_container_impl.cpp
@@ -21,12 +21,10 @@
 #include "proactor_work_queue_impl.hpp"
 
 #include "proton/error_condition.hpp"
-#include "proton/function.hpp"
 #include "proton/listener.hpp"
 #include "proton/listen_handler.hpp"
 #include "proton/reconnect_options.hpp"
 #include "proton/url.hpp"
-
 #include "proton/connection.h"
 #include "proton/listener.h"
 #include "proton/proactor.h"


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