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 2016/05/17 02:44:59 UTC

[1/4] qpid-proton git commit: PROTON-1200: Improve C++ binding documentation and header formatting

Repository: qpid-proton
Updated Branches:
  refs/heads/master 552f43911 -> 2dc4afe08


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/symbol.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/symbol.hpp b/proton-c/bindings/cpp/include/proton/symbol.hpp
index 7a5764a..026154f 100644
--- a/proton-c/bindings/cpp/include/proton/symbol.hpp
+++ b/proton-c/bindings/cpp/include/proton/symbol.hpp
@@ -1,6 +1,8 @@
-#ifndef SYMBOL_HPP
-#define SYMBOL_HPP
+#ifndef PROTON_SYMBOL_HPP
+#define PROTON_SYMBOL_HPP
+
 /*
+ *
  * 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
@@ -17,23 +19,26 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
+ *
  */
 
 namespace proton {
 
-/// symbol is a std::string that represents the AMQP symbol type.
-/// A symbol can only contain 7-bit ASCII characters.
+/// A std::string that represents the AMQP symbol type.
 ///
+/// A symbol can only contain 7-bit ASCII characters.
 class symbol : public std::string {
   public:
-    /// Construct from a std::string
+    /// Construct from a std::string.
     symbol(const std::string& s=std::string()) : std::string(s) {}
-    /// Construct from a C-string
+
+    /// Construct from a C string.
     symbol(const char* s) : std::string(s) {}
-    /// Construct from any sequence of char
+
+    /// Construct from any sequence of char.
     template<class Iter> symbol(Iter start, Iter finish) : std::string(start, finish) {}
 };
 
-}
+} // proton
 
-#endif // SYMBOL_HPP
+#endif // PROTON_SYMBOL_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/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 0415038..096d805 100644
--- a/proton-c/bindings/cpp/include/proton/target.hpp
+++ b/proton-c/bindings/cpp/include/proton/target.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_TARGET_H
-#define PROTON_CPP_TARGET_H
+#ifndef PROTON_TARGET_HPP
+#define PROTON_TARGET_HPP
 
 /*
  *
@@ -23,7 +23,7 @@
  */
 
 #include "proton/export.hpp"
-#include "proton/object.hpp"
+#include "proton/internal/object.hpp"
 #include "proton/value.hpp"
 #include "proton/terminus.hpp"
 
@@ -34,31 +34,32 @@ namespace proton {
 class sender;
 class receiver;
 
-///
 /// The target is the destination node of a sent or received message.
 ///
-/// @see proton::sender proton::receiver proton::target
+/// @see proton::sender, proton::receiver, proton::target
 class target : public terminus {
   public:
+    /// Create an empty target.
     target() : terminus() {}
 
     using terminus::durability_mode;
     using terminus::expiry_policy;
 
+    /// The address of the target.
     PN_CPP_EXTERN std::string address() const;
 
-    /// @cond INTERNAL
   private:
     target(pn_terminus_t* t);
     target(const sender&);
     target(const receiver&);
+
+    /// @cond INTERNAL
   friend class internal::factory<target>;
   friend class sender;
   friend class receiver;
     /// @endcond
-
 };
 
-}
+} // proton
 
-#endif // PROTON_CPP_TARGET_H
+#endif // PROTON_TARGET_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/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 bafc363..739f38d 100644
--- a/proton-c/bindings/cpp/include/proton/target_options.hpp
+++ b/proton-c/bindings/cpp/include/proton/target_options.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_TARGET_OPTIONS_H
-#define PROTON_CPP_TARGET_OPTIONS_H
+#ifndef PROTON_TARGET_OPTIONS_HPP
+#define PROTON_TARGET_OPTIONS_HPP
 
 /*
  *
@@ -24,7 +24,7 @@
 
 #include "proton/config.hpp"
 #include "proton/export.hpp"
-#include "proton/pn_unique_ptr.hpp"
+#include "proton/internal/pn_unique_ptr.hpp"
 #include "proton/types.hpp"
 #include "proton/delivery_mode.hpp"
 #include "proton/target.hpp"
@@ -40,13 +40,12 @@ class target;
 
 /// Options for creating a target node for a sender or receiver.
 ///
-/// Options can be "chained" (@see proton::connection_options).
+/// Options can be "chained" (see proton::connection_options).
 ///
 /// Normal value semantics: copy or assign creates a separate copy of
 /// the options.
 class target_options {
   public:
-
     /// Create an empty set of options.
     PN_CPP_EXTERN target_options();
 
@@ -74,20 +73,19 @@ class target_options {
     /// Control when the clock for expiration begins.
     PN_CPP_EXTERN target_options& expiry_policy(enum target::expiry_policy);
 
-
-    /// @cond INTERNAL
   private:
     void apply(target&) const;
 
     class impl;
     internal::pn_unique_ptr<impl> impl_;
 
-    friend class target;
-    friend class sender_options;
-    friend class receiver_options;
+    /// @cond INTERNAL
+  friend class target;
+  friend class sender_options;
+  friend class receiver_options;
     /// @endcond
 };
 
-}
+} // proton
 
-#endif // PROTON_CPP_TARGET_OPTIONS_H
+#endif // PROTON_TARGET_OPTIONS_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/task.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/task.hpp b/proton-c/bindings/cpp/include/proton/task.hpp
index b833a48..cd3ac84 100644
--- a/proton-c/bindings/cpp/include/proton/task.hpp
+++ b/proton-c/bindings/cpp/include/proton/task.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_TASK_H
-#define PROTON_CPP_TASK_H
+#ifndef PROTON_TASK_HPP
+#define PROTON_TASK_HPP
 
 /*
  *
@@ -23,16 +23,16 @@
  */
 
 /// @cond INTERNAL
-/// XXX needs more discussion
+/// XXX Needs more discussion
     
 #include "proton/export.hpp"
-#include "proton/object.hpp"
+#include "proton/internal/object.hpp"
 
 #include "proton/reactor.h"
 
 namespace proton {
 
-/// A task for timer events.
+/// **Experimental** - A task for timer events.
 class task : public internal::object<pn_task_t> {
   public:
     task(pn_task_t* t) : internal::object<pn_task_t>(t) {}
@@ -41,8 +41,8 @@ class task : public internal::object<pn_task_t> {
     PN_CPP_EXTERN void cancel();
 };
 
-}
+} // proton
 
 /// @endcond
 
-#endif // PROTON_CPP_TASK_H
+#endif // PROTON_TASK_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/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 cdcb7d3..403df0a 100644
--- a/proton-c/bindings/cpp/include/proton/terminus.hpp
+++ b/proton-c/bindings/cpp/include/proton/terminus.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_TERMINUS_H
-#define PROTON_CPP_TERMINUS_H
+#ifndef PROTON_TERMINUS_HPP
+#define PROTON_TERMINUS_HPP
 
 /*
  *
@@ -23,7 +23,7 @@
  */
 
 #include "proton/export.hpp"
-#include "proton/object.hpp"
+#include "proton/internal/object.hpp"
 #include "proton/value.hpp"
 
 #include "proton/link.h"
@@ -45,20 +45,31 @@ class terminus {
   public:
     terminus() : object_(0), parent_(0) {}
 
+    /// The persistence mode of the source or target.
     enum durability_mode {
-      NONDURABLE = PN_NONDURABLE,
-      CONFIGURATION = PN_CONFIGURATION,
-      UNSETTLED_STATE = PN_DELIVERIES
+        /// No persistence.
+        NONDURABLE = PN_NONDURABLE,
+        /// Only configuration is persisted.
+        CONFIGURATION = PN_CONFIGURATION,
+        /// Configuration and unsettled state are persisted.
+        UNSETTLED_STATE = PN_DELIVERIES
     };
 
+    /// When expiration of the source or target begins.
     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
+        /// When the link is closed.
+        LINK_CLOSE = PN_EXPIRE_WITH_LINK,
+        /// When the containing session is closed.
+        SESSION_CLOSE = PN_EXPIRE_WITH_SESSION,
+        /// When the containing connection is closed.
+        CONNECTION_CLOSE = PN_EXPIRE_WITH_CONNECTION,
+        /// The terminus never expires.
+        NEVER = PN_EXPIRE_NEVER
     };
 
-    /// Control when the clock for expiration begins.
+    // XXX This should have address?
+
+    /// Get the policy for when expiration begins.
     PN_CPP_EXTERN enum expiry_policy expiry_policy() const;
 
     /// The period after which the source is discarded on expiry. The
@@ -75,19 +86,19 @@ class terminus {
     /// terminus.  See also lifetime_policy.
     PN_CPP_EXTERN value node_properties() const;
 
-    /// @cond INTERNAL
   protected:
     pn_terminus_t *pn_object() { return object_; }
   private:
     pn_terminus_t* object_;
     pn_link_t* parent_;
 
+    /// @cond INTERNAL
   friend class internal::factory<terminus>;
   friend class source;
   friend class target;
     /// @endcond
 };
 
-}
+} // proton
 
-#endif // PROTON_CPP_TERMINUS_H
+#endif // PROTON_TERMINUS_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/thread_safe.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/thread_safe.hpp b/proton-c/bindings/cpp/include/proton/thread_safe.hpp
index b721f76..4ba06de 100644
--- a/proton-c/bindings/cpp/include/proton/thread_safe.hpp
+++ b/proton-c/bindings/cpp/include/proton/thread_safe.hpp
@@ -2,6 +2,7 @@
 #define PROTON_THREAD_SAFE_HPP
 
 /*
+ *
  * 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
@@ -15,22 +16,24 @@
  * 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
- pp * KIND, either express or implied.  See the License for the
+ * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
+ *
  */
 
-#include <proton/config.hpp>
-#include <proton/connection.hpp>
-#include <proton/event_loop.hpp>
-#include <proton/object.hpp>
-#include <proton/type_traits.hpp>
+#include "proton/config.hpp"
+#include "proton/connection.hpp"
+#include "proton/event_loop.hpp"
+#include "proton/internal/object.hpp"
+#include "proton/internal/type_traits.hpp"
 
 #include <functional>
 
 // FIXME aconway 2016-05-03: doc
 
 namespace proton {
+
 class connection;
 class session;
 class link;
@@ -49,21 +52,22 @@ template<> struct endpoint_traits<receiver> {};
 template <class T> class returned;
 
 // FIXME aconway 2016-05-09: doc
-/// Events for each proton::connection are processed sequentially in an
-/// event-loop. proton::handler functions for a single connection are never
-/// called concurrently. inject() lets you add user-defined function calls to
-/// be processed in the event loop sequence.
+/// **Experimental** - A thread-safe object wrapper.
+///    
+/// Events for each proton::connection are processed sequentially in
+/// an event_loop. proton::handler functions for a single connection
+/// are never called concurrently. inject() lets you add user-defined
+/// function calls to be processed in the event loop sequence.
 ///
-/// thread_safe is useful with multi-threaded programs, where different
-/// connection's event-loops can run concurrently. Proton objects associated
-/// with a connection (proton::connection, proton:sender etc.) are not thread
-/// safe, so they can only be used in the context of the connections thread_safe.
-/// inject() allows any thread (application threads or thread_safe threads for
+/// thread_safe is useful with multi-threaded programs, where
+/// different connection's event loops can run concurrently. Proton
+/// objects associated with a connection (proton::connection,
+/// proton::sender, etc.) are not thread safe, so they can only be
+/// used in the context of the connection's thread_safe.  inject()
+/// allows any thread (application threads or thread_safe threads for
 /// different connections) to communicate safely.
-///
 template <class T>
-class thread_safe : private internal::pn_ptr_base, private internal::endpoint_traits<T>
-{
+class thread_safe : private internal::pn_ptr_base, private internal::endpoint_traits<T> {
     typedef typename T::pn_type pn_type;
 
     struct inject_decref : public inject_handler {
@@ -73,7 +77,9 @@ class thread_safe : private internal::pn_ptr_base, private internal::endpoint_tr
     };
 
   public:
+    /// @cond INTERNAL
     static void operator delete(void*) {}
+    /// @endcond
 
     ~thread_safe() {
         if (ptr()) {
@@ -89,14 +95,20 @@ class thread_safe : private internal::pn_ptr_base, private internal::endpoint_tr
         }
     }
 
+    /// Get the event loop for this object.
     class event_loop* event_loop() { return event_loop::get(ptr()); }
 
+    /// @cond INTERNAL
+    /// XXX Not sure what the status of these is
+    
     // FIXME aconway 2016-05-04: doc
     T unsafe() { return T(ptr()); }
 
     // Caller must delete
     static thread_safe* create(const T& obj) { return new (obj.pn_object()) thread_safe(); }
 
+    /// @endcond
+    
   private:
     static void* operator new(size_t, pn_type* p) { return p; }
     static void operator delete(void*, pn_type*) {}
@@ -107,7 +119,9 @@ class thread_safe : private internal::pn_ptr_base, private internal::endpoint_tr
     thread_safe(const thread_safe&);
     thread_safe& operator=(const thread_safe&);
 
+    /// @cond INTERNAL
   friend class returned<T>;
+    /// @endcond
 };
 
 // FIXME aconway 2016-05-04: doc.
@@ -148,13 +162,16 @@ class returned : private internal::endpoint_traits<T>
     mutable thread_safe<T>* ptr_;
 };
 
+// XXX Review this text
+/// Make a thread-safe wrapper for `obj`.
 template <class T> returned<T> make_thread_safe(const T& obj) {
     return returned<T>(thread_safe<T>::create(obj));
 }
 
+// XXX Review this text
+/// Get a thread-unsafe pointer for `p`.
 template <class T> T make_thread_unsafe(T* p) { return p->unsafe(); }
 
-
 #if PN_CPP_HAS_CPP11
 template <class T> std::shared_ptr<thread_safe<T> > make_shared_thread_safe(const T& obj) {
     return std::shared_ptr<thread_safe<T> >(thread_safe<T>::create(obj));
@@ -167,7 +184,6 @@ template <class T> T make_thread_unsafe(const std::shared_ptr<T>& p) { return p-
 template <class T> T make_thread_unsafe(const std::unique_ptr<T>& p) { return p->unsafe(); }
 #endif
 
-
-}
+} // proton
 
 #endif // PROTON_THREAD_SAFE_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/timestamp.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/timestamp.hpp b/proton-c/bindings/cpp/include/proton/timestamp.hpp
index 7736e00..01c317d 100644
--- a/proton-c/bindings/cpp/include/proton/timestamp.hpp
+++ b/proton-c/bindings/cpp/include/proton/timestamp.hpp
@@ -1,5 +1,6 @@
-#ifndef TIMESTAMP_HPP
-#define TIMESTAMP_HPP
+#ifndef PROTON_TIMESTAMP_HPP
+#define PROTON_TIMESTAMP_HPP
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -22,32 +23,44 @@
 #include "proton/duration.hpp"
 
 namespace proton {
-/// 64 bit timestamp in milliseconds since the epoch 00:00:00 (UTC), 1 January 1970.
+
+/// A 64-bit timestamp in milliseconds since the Unix epoch.
+///    
+/// The dawn of the Unix epoch was 00:00:00 (UTC), 1 January 1970.
 class timestamp : private internal::comparable<timestamp> {
   public:
-    typedef int64_t numeric_type; ///< Numeric type holding milliseconds value
-    PN_CPP_EXTERN static timestamp now(); ///< Current wall-clock time
+    /// A numeric type holding a milliseconds value.
+    typedef int64_t numeric_type;
+
+    /// The current wall-clock time.
+    PN_CPP_EXTERN static timestamp now();
 
-    explicit timestamp(numeric_type ms = 0) : ms_(ms) {} ///< Construct from milliseconds
-    timestamp& operator=(numeric_type ms) { ms_ = ms; return *this; }  ///< Assign from milliseconds
-    numeric_type milliseconds() const { return ms_; } ///< Get milliseconds
+    /// Construct from milliseconds.
+    explicit timestamp(numeric_type ms = 0) : ms_(ms) {}
+
+    /// Assign from milliseconds.
+    timestamp& operator=(numeric_type ms) { ms_ = ms; return *this; }
+
+    /// Get milliseconds.
+    numeric_type milliseconds() const { return ms_; }
 
   private:
     numeric_type ms_;
 };
 
-///@name Comparison and arithmetic operators
-///@{
+/// @name Comparison and arithmetic operators
+/// @{
 inline bool operator==(timestamp x, timestamp y) { return x.milliseconds() == y.milliseconds(); }
 inline bool operator<(timestamp x, timestamp y) { return x.milliseconds() < y.milliseconds(); }
 
 inline timestamp operator+(timestamp ts, duration d) { return timestamp(ts.milliseconds() + d.milliseconds()); }
 inline duration operator-(timestamp t0, timestamp t1) { return duration(t0.milliseconds() - t1.milliseconds()); }
 inline timestamp operator+(duration d, timestamp ts) { return ts + d; }
-///@}
+/// @}
 
 /// Printable format.
 PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, timestamp);
 
-}
-#endif // TIMESTAMP_HPP
+} // proton
+
+#endif // PROTON_TIMESTAMP_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/tracker.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/tracker.hpp b/proton-c/bindings/cpp/include/proton/tracker.hpp
index e35d1f8..e6f7c5d 100644
--- a/proton-c/bindings/cpp/include/proton/tracker.hpp
+++ b/proton-c/bindings/cpp/include/proton/tracker.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_TRACKER_H
-#define PROTON_CPP_TRACKER_H
+#ifndef PROTON_TRACKER_HPP
+#define PROTON_TRACKER_HPP
 
 /*
  *
@@ -29,23 +29,28 @@ struct pn_delivery_t;
 
 namespace proton {
 
-/// A message transfer.  Every delivery exists within the context of a
-/// proton::link.  A delivery attempt can fail. As a result, a
-/// particular message may correspond to multiple deliveries.
+/// A tracker for a sent message. Every tracker exists within the
+/// context of a sender.
+///
+/// A delivery attempt can fail. As a result, a particular message may
+/// correspond to multiple trackers.
 class tracker : public transfer {
     /// @cond INTERNAL
     tracker(pn_delivery_t* d);
     /// @endcond
 
   public:
+    /// Create an empty tracker.
     tracker() {}
 
-    // Return the sender for this tracker
+    /// Get the sender for this tracker.
     PN_CPP_EXTERN class sender sender() const;
 
+    // @cond INTERNAL
   friend class internal::factory<tracker>;
+    // @endcond
 };
 
-}
+} // proton
 
-#endif // PROTON_CPP_TRACKER_H
+#endif // PROTON_TRACKER_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/transfer.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/transfer.hpp b/proton-c/bindings/cpp/include/proton/transfer.hpp
index f37984d..fcbe3c6 100644
--- a/proton-c/bindings/cpp/include/proton/transfer.hpp
+++ b/proton-c/bindings/cpp/include/proton/transfer.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_TRANSFER_H
-#define PROTON_CPP_TRANSFER_H
+#ifndef PROTON_TRANSFER_HPP
+#define PROTON_TRANSFER_HPP
 
 /*
  *
@@ -23,31 +23,30 @@
  */
 
 #include "proton/export.hpp"
-#include "proton/object.hpp"
+#include "proton/internal/object.hpp"
 
 #include "proton/delivery.h"
 #include "proton/disposition.h"
 
 namespace proton {
 
-/// A message transfer.  Every delivery exists within the context of a
-/// proton::link.  A delivery attempt can fail. As a result, a
-/// particular message may correspond to multiple deliveries.
+/// The base class for delivery and tracker.
 class transfer : public internal::object<pn_delivery_t> {
     /// @cond INTERNAL
     transfer(pn_delivery_t* d) : internal::object<pn_delivery_t>(d) {}
     /// @endcond
 
   public:
+    /// Create an empty transfer.
     transfer() : internal::object<pn_delivery_t>(0) {}
 
-    /// Return the session for this transfer
+    /// Return the session for this transfer.
     PN_CPP_EXTERN class session session() const;
 
-    /// Return the connection for this transfer
+    /// Return the connection for this transfer.
     PN_CPP_EXTERN class connection connection() const;
 
-    /// Return the container for this transfer
+    /// Return the container for this transfer.
     PN_CPP_EXTERN class container &container() const;
 
     /// Settle the delivery; informs the remote end.
@@ -56,7 +55,6 @@ class transfer : public internal::object<pn_delivery_t> {
     /// Return true if the transfer has been settled.
     PN_CPP_EXTERN bool settled() const;
 
-    /// @cond INTERNAL
   protected:
     /// Delivery state values.
     enum state {
@@ -77,10 +75,11 @@ class transfer : public internal::object<pn_delivery_t> {
     /// Get the remote state for a delivery.
     enum state state() const;
 
+    /// @cond INTERNAL
   friend class internal::factory<transfer>;
     /// @endcond
 };
 
-}
+} // proton
 
-#endif // PROTON_CPP_TRANSFER_H
+#endif // PROTON_TRANSFER_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/transport.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/transport.hpp b/proton-c/bindings/cpp/include/proton/transport.hpp
index 84b6832..fb704ba 100644
--- a/proton-c/bindings/cpp/include/proton/transport.hpp
+++ b/proton-c/bindings/cpp/include/proton/transport.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_TRANSPORT_H
-#define PROTON_CPP_TRANSPORT_H
+#ifndef PROTON_TRANSPORT_HPP
+#define PROTON_TRANSPORT_HPP
 
 /*
  *
@@ -22,7 +22,7 @@
  *
  */
 
-#include "proton/object.hpp"
+#include "proton/internal/object.hpp"
 #include "proton/types.hpp"
 #include "proton/export.hpp"
 
@@ -38,12 +38,14 @@ namespace io {
 class connection_engine;
 }
 
+/// A network channel supporting an AMQP connection.
 class transport : public internal::object<pn_transport_t> {
     /// @cond INTERNAL
     transport(pn_transport_t* t) : internal::object<pn_transport_t>(t) {}
     /// @endcond 
 
   public:
+    /// Create an empty transport.
     transport() : internal::object<pn_transport_t>(0) {}
 
     /// Get the connection associated with this transport.
@@ -63,6 +65,6 @@ class transport : public internal::object<pn_transport_t> {
     /// @endcond
 };
 
-}
+} // proton
 
-#endif // PROTON_CPP_TRANSPORT_H
+#endif // PROTON_TRANSPORT_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/type_id.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/type_id.hpp b/proton-c/bindings/cpp/include/proton/type_id.hpp
index d454bc3..711100f 100644
--- a/proton-c/bindings/cpp/include/proton/type_id.hpp
+++ b/proton-c/bindings/cpp/include/proton/type_id.hpp
@@ -2,6 +2,7 @@
 #define PROTON_TYPE_ID_HPP
 
 /*
+ *
  * 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
@@ -18,14 +19,17 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
+ *
  */
 
-///@file
+/// @file
 ///
 /// Type-identifiers for AMQP types.
 
-#include <proton/export.hpp>
-#include <proton/codec.h>
+#include "proton/export.hpp"
+
+#include "proton/codec.h"
+
 #include <string>
 
 namespace proton {
@@ -34,29 +38,29 @@ namespace proton {
 enum type_id {
     NULL_TYPE = PN_NULL,          ///< The null type, contains no data.
     BOOLEAN = PN_BOOL,            ///< Boolean true or false.
-    UBYTE = PN_UBYTE,             ///< Unsigned 8 bit integer.
-    BYTE = PN_BYTE,               ///< Signed 8 bit integer.
-    USHORT = PN_USHORT,           ///< Unsigned 16 bit integer.
-    SHORT = PN_SHORT,             ///< Signed 16 bit integer.
-    UINT = PN_UINT,               ///< Unsigned 32 bit integer.
-    INT = PN_INT,                 ///< Signed 32 bit integer.
-    CHAR = PN_CHAR,               ///< 32 bit unicode character.
-    ULONG = PN_ULONG,             ///< Unsigned 64 bit integer.
-    LONG = PN_LONG,               ///< Signed 64 bit integer.
-    TIMESTAMP = PN_TIMESTAMP,     ///< Signed 64 bit milliseconds since the epoch.
-    FLOAT = PN_FLOAT,             ///< 32 bit binary floating point.
-    DOUBLE = PN_DOUBLE,           ///< 64 bit binary floating point.
-    DECIMAL32 = PN_DECIMAL32,     ///< 32 bit decimal floating point.
-    DECIMAL64 = PN_DECIMAL64,     ///< 64 bit decimal floating point.
-    DECIMAL128 = PN_DECIMAL128,   ///< 128 bit decimal floating point.
-    UUID = PN_UUID,               ///< 16 byte UUID.
-    BINARY = PN_BINARY,           ///< Variable length sequence of bytes.
-    STRING = PN_STRING,           ///< Variable length utf8-encoded string.
-    SYMBOL = PN_SYMBOL,           ///< Variable length encoded string.
+    UBYTE = PN_UBYTE,             ///< Unsigned 8-bit integer.
+    BYTE = PN_BYTE,               ///< Signed 8-bit integer.
+    USHORT = PN_USHORT,           ///< Unsigned 16-bit integer.
+    SHORT = PN_SHORT,             ///< Signed 16-bit integer.
+    UINT = PN_UINT,               ///< Unsigned 32-bit integer.
+    INT = PN_INT,                 ///< Signed 32-bit integer.
+    CHAR = PN_CHAR,               ///< 32-bit unicode character.
+    ULONG = PN_ULONG,             ///< Unsigned 64-bit integer.
+    LONG = PN_LONG,               ///< Signed 64-bit integer.
+    TIMESTAMP = PN_TIMESTAMP,     ///< Signed 64-bit milliseconds since the epoch.
+    FLOAT = PN_FLOAT,             ///< 32-bit binary floating point.
+    DOUBLE = PN_DOUBLE,           ///< 64-bit binary floating point.
+    DECIMAL32 = PN_DECIMAL32,     ///< 32-bit decimal floating point.
+    DECIMAL64 = PN_DECIMAL64,     ///< 64-bit decimal floating point.
+    DECIMAL128 = PN_DECIMAL128,   ///< 128-bit decimal floating point.
+    UUID = PN_UUID,               ///< 16-byte UUID.
+    BINARY = PN_BINARY,           ///< Variable-length sequence of bytes.
+    STRING = PN_STRING,           ///< Variable-length utf8-encoded string.
+    SYMBOL = PN_SYMBOL,           ///< Variable-length encoded string.
     DESCRIBED = PN_DESCRIBED,     ///< A descriptor and a value.
     ARRAY = PN_ARRAY,             ///< A sequence of values of the same type.
-    LIST = PN_LIST,               ///< A sequence of values, may be of mixed types.
-    MAP = PN_MAP                  ///< A sequence of key:value pairs, may be of mixed types.
+    LIST = PN_LIST,               ///< A sequence of values of mixed types.
+    MAP = PN_MAP                  ///< A sequence of key-value pairs.
 };
 
 /// Get the name of the AMQP type.
@@ -65,11 +69,12 @@ PN_CPP_EXTERN std::string type_name(type_id);
 /// Print the type name.
 PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, type_id);
 
-/// Throw a conversion_error if want != got with a message including the names of the types.
+/// Throw a conversion_error if want != got with a message including
+/// the names of the types.
 PN_CPP_EXTERN void assert_type_equal(type_id want, type_id got);
 
-///@name Test propreties of a type_id.
-///@{
+/// @name Test the properties of a type_id.
+/// @{
 inline bool type_id_is_signed_int(type_id t) { return t == BYTE || t == SHORT || t == INT || t == LONG; }
 inline bool type_id_is_unsigned_int(type_id t) { return t == UBYTE || t == USHORT || t == UINT || t == ULONG; }
 inline bool type_id_is_integral(type_id t) { return t == BOOLEAN || t == CHAR || t == TIMESTAMP || type_id_is_unsigned_int(t) || type_id_is_signed_int(t); }
@@ -80,8 +85,8 @@ inline bool type_id_is_string_like(type_id t) { return t == BINARY || t == STRIN
 inline bool type_id_is_container(type_id t) { return t == LIST || t == MAP || t == ARRAY || t == DESCRIBED; }
 inline bool type_id_is_scalar(type_id t) { return type_id_is_integral(t) || type_id_is_floating_point(t) || type_id_is_decimal(t) || type_id_is_string_like(t) || t == TIMESTAMP || t == UUID; }
 inline bool type_id_is_null(type_id t) { return t == NULL_TYPE; }
-///}
+/// }
 
 } // proton
 
-#endif  /*!PROTON_TYPE_ID_HPP*/
+#endif // PROTON_TYPE_ID_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/type_traits.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/type_traits.hpp b/proton-c/bindings/cpp/include/proton/type_traits.hpp
deleted file mode 100644
index db4d685..0000000
--- a/proton-c/bindings/cpp/include/proton/type_traits.hpp
+++ /dev/null
@@ -1,153 +0,0 @@
-#ifndef PROTON_TYPE_TRAITS_HPP
-#define PROTON_TYPE_TRAITS_HPP
-
-/*
- * 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.
- */
-
-/// @file
-///
-/// Internal: Type traits for mapping between AMQP and C++ types.
-///
-/// Also provides workarounds for missing type_traits classes on older
-/// C++ compilers.
-
-#include <proton/config.hpp>
-#include <proton/types_fwd.hpp>
-#include <proton/type_id.hpp>
-
-///@cond INTERNAL
-namespace proton {
-namespace internal {
-
-class decoder;
-class encoder;
-
-template <bool, class T=void> struct enable_if {};
-template <class T> struct enable_if<true, T> { typedef T type; };
-
-struct true_type { static const bool value = true; };
-struct false_type { static const bool value = false; };
-
-template <class T> struct is_integral : public false_type {};
-template <class T> struct is_signed : public false_type {};
-
-template <> struct is_integral<char> : public true_type {};
-template <> struct is_signed<char> : public false_type {};
-
-template <> struct is_integral<unsigned char> : public true_type {};
-template <> struct is_integral<unsigned short> : public true_type {};
-template <> struct is_integral<unsigned int> : public true_type {};
-template <> struct is_integral<unsigned long> : public true_type {};
-
-template <> struct is_integral<signed char> : public true_type {};
-template <> struct is_integral<signed short> : public true_type {};
-template <> struct is_integral<signed int> : public true_type {};
-template <> struct is_integral<signed long> : public true_type {};
-
-template <> struct is_signed<unsigned short> : public false_type {};
-template <> struct is_signed<unsigned int> : public false_type {};
-template <> struct is_signed<unsigned long> : public false_type {};
-
-template <> struct is_signed<signed char> : public true_type {};
-template <> struct is_signed<signed short> : public true_type {};
-template <> struct is_signed<signed int> : public true_type {};
-template <> struct is_signed<signed long> : public true_type {};
-
-#if PN_CPP_HAS_LONG_LONG
-template <> struct is_integral<unsigned long long> : public true_type {};
-template <> struct is_integral<signed long long> : public true_type {};
-template <> struct is_signed<unsigned long long> : public false_type {};
-template <> struct is_signed<signed long long> : public true_type {};
-#endif
-
-template <class T, class U> struct is_same { static const bool value=false; };
-template <class T> struct is_same<T,T> { static const bool value=true; };
-
-template< class T > struct remove_const          { typedef T type; };
-template< class T > struct remove_const<const T> { typedef T type; };
-
-template <type_id ID, class T> struct type_id_constant {
-    typedef T type;
-    static const type_id value = ID;
-};
-
-///@name Metafunction returning AMQP type for scalar C++ types.
-///@{
-template <class T> struct type_id_of;
-template<> struct type_id_of<bool> : public type_id_constant<BOOLEAN, bool> {};
-template<> struct type_id_of<uint8_t> : public type_id_constant<UBYTE, uint8_t> {};
-template<> struct type_id_of<int8_t> : public type_id_constant<BYTE, int8_t> {};
-template<> struct type_id_of<uint16_t> : public type_id_constant<USHORT, uint16_t> {};
-template<> struct type_id_of<int16_t> : public type_id_constant<SHORT, int16_t> {};
-template<> struct type_id_of<uint32_t> : public type_id_constant<UINT, uint32_t> {};
-template<> struct type_id_of<int32_t> : public type_id_constant<INT, int32_t> {};
-template<> struct type_id_of<uint64_t> : public type_id_constant<ULONG, uint64_t> {};
-template<> struct type_id_of<int64_t> : public type_id_constant<LONG, int64_t> {};
-template<> struct type_id_of<wchar_t> : public type_id_constant<CHAR, wchar_t> {};
-template<> struct type_id_of<float> : public type_id_constant<FLOAT, float> {};
-template<> struct type_id_of<double> : public type_id_constant<DOUBLE, double> {};
-template<> struct type_id_of<timestamp> : public type_id_constant<TIMESTAMP, timestamp> {};
-template<> struct type_id_of<decimal32> : public type_id_constant<DECIMAL32, decimal32> {};
-template<> struct type_id_of<decimal64> : public type_id_constant<DECIMAL64, decimal64> {};
-template<> struct type_id_of<decimal128> : public type_id_constant<DECIMAL128, decimal128> {};
-template<> struct type_id_of<uuid> : public type_id_constant<UUID, uuid> {};
-template<> struct type_id_of<std::string> : public type_id_constant<STRING, std::string> {};
-template<> struct type_id_of<symbol> : public type_id_constant<SYMBOL, symbol> {};
-template<> struct type_id_of<binary> : public type_id_constant<BINARY, binary> {};
-///@}
-
-/// Metafunction to test if a class has a type_id.
-template <class T, class Enable=void> struct has_type_id : public false_type {};
-template <class T> struct has_type_id<T, typename type_id_of<T>::type>  : public true_type {};
-
-// Map arbitrary integral types to known AMQP integral types.
-template<size_t SIZE, bool IS_SIGNED> struct integer_type;
-template<> struct integer_type<1, true> { typedef int8_t type; };
-template<> struct integer_type<2, true> { typedef int16_t type; };
-template<> struct integer_type<4, true> { typedef int32_t type; };
-template<> struct integer_type<8, true> { typedef int64_t type; };
-template<> struct integer_type<1, false> { typedef uint8_t type; };
-template<> struct integer_type<2, false> { typedef uint16_t type; };
-template<> struct integer_type<4, false> { typedef uint32_t type; };
-template<> struct integer_type<8, false> { typedef uint64_t type; };
-
-// True if T is an integer type that does not have an explicit type_id.
-template <class T> struct is_unknown_integer {
-    static const bool value = !has_type_id<T>::value && is_integral<T>::value;
-};
-
-// Helper base for SFINAE test templates.
-struct sfinae {
-    typedef char yes;
-    typedef double no;
-    struct wildcard { wildcard(...); };
-};
-
-template <class From, class To> struct is_convertible : public sfinae {
-    static yes test(const To&);
-    static no test(...);
-    static const From& from;
-    static bool const value = sizeof(test(from)) == sizeof(yes);
-};
-
-} // internal
-} // proton
-//@endcond
-
-#endif // PROTON_TYPE_TRAITS_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/types.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/types.hpp b/proton-c/bindings/cpp/include/proton/types.hpp
index 66f0f93..08a4d05 100644
--- a/proton-c/bindings/cpp/include/proton/types.hpp
+++ b/proton-c/bindings/cpp/include/proton/types.hpp
@@ -1,6 +1,8 @@
 #ifndef PROTON_TYPES_HPP
 #define PROTON_TYPES_HPP
+
 /*
+ *
  * 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
@@ -17,115 +19,37 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
+ *
  */
 
-///@file
+/// @file
 ///
-/// Include the definitions of all proton types used to represent AMQP types.
-
-/**@page types AMQP and C++ types
-
-@details
-
-An AMQP message body can hold binary data using any encoding you like. AMQP also
-defines its own encoding and types. The AMQP encoding is often used in message
-bodies because it is supported by AMQP libraries on many languages and
-platforms. You also need to use the AMQP types to set and examine message
-properties.
-
-## Scalar types
-
-Each type is identified by a proton::type_id.
-
-C++ type            | AMQP type_id         | Description
---------------------|----------------------|-----------------------
-bool                | proton::BOOLEAN      | Boolean true/false
-uint8_t             | proton::UBYTE        | 8 bit unsigned byte
-int8_t              | proton::BYTE         | 8 bit signed byte
-uint16_t            | proton::USHORT       | 16 bit unsigned integer
-int16_t             | proton::SHORT        | 16 bit signed integer
-uint32_t            | proton::UINT         | 32 bit unsigned integer
-int32_t             | proton::INT          | 32 bit signed integer
-uint64_t            | proton::ULONG        | 64 bit unsigned integer
-int64_t             | proton::LONG         | 64 bit signed integer
-wchar_t             | proton::CHAR         | 32 bit unicode code point
-float               | proton::FLOAT        | 32 bit binary floating point
-double              | proton::DOUBLE       | 64 bit binary floating point
-proton::timestamp   | proton::TIMESTAMP    | 64 bit signed milliseconds since 00:00:00 (UTC), 1 January 1970.
-proton::decimal32   | proton::DECIMAL32    | 32 bit decimal floating point
-proton::decimal64   | proton::DECIMAL64    | 64 bit decimal floating point
-proton::decimal128  | proton::DECIMAL128   | 128 bit decimal floating point
-proton::uuid        | proton::UUID         | 128 bit universally-unique identifier
-std::string         | proton::STRING       | UTF-8 encoded unicode string
-proton::symbol      | proton::SYMBOL       | 7-bit ASCII encoded string
-proton::binary      | proton::BINARY       | Variable-length binary data
-
-proton::scalar is a holder that can hold a scalar value of any type.
-
-## Compound types
-
-C++ type            | AMQP type_id         | Description
---------------------|----------------------|-----------------------
-see below           | proton::ARRAY        | Sequence of values of the same type
-see below           | proton::LIST         | Sequence of values of mixed types
-see below           | proton::MAP          | Map of key/value pairs
-
-proton::value is a holder that can hold any AMQP value, scalar or compound
-
-proton::ARRAY converts to/from C++ sequences: std::vector, std::deque, std::list and
-std::forward_list.
-
-proton::LIST converts to/from sequences of proton::value or proton::scalar,
-which can hold mixed types of data.
-
-proton::MAP converts to/from std::map, std::unordered_map and sequences of
-std::pair. 
-
-When decoding the encoded map types must be convertible to element type of the
-C++ sequence or the key/value types of the C++ map. Use proton::value as the
-element or key/value type to decode any ARRAY/LIST/MAP.
-
-For example you can decode any AMQP MAP into:
-
-    std::map<proton::value, proton::value>
-
-You can decode any AMQP LIST or ARRAY into
-
-    std::vector<proton::value>
-
-## Include files
-
-You can simply include proton/types.hpp to include all the type definitions and
-conversions. Alternatively, you can selectively include only what you need:
-
- - proton/types_fwd.hpp: forward declarations for all types.
- - proton/list.hpp, proton/vector.hpp etc.: conversions for std::list, std::vector etc.
- - include individual .hpp files as per the table above.
-*/
+/// Include the definitions of all proton types used to represent AMQP
+/// types.
 
 // TODO aconway 2016-03-15: described types, described arrays.
 
-#include <proton/annotation_key.hpp>
-#include <proton/binary.hpp>
-#include <proton/config.hpp>
-#include <proton/decimal.hpp>
-#include <proton/deque.hpp>
-#include <proton/duration.hpp>
-#include <proton/list.hpp>
-#include <proton/map.hpp>
-#include <proton/message_id.hpp>
-#include <proton/scalar.hpp>
-#include <proton/symbol.hpp>
-#include <proton/timestamp.hpp>
-#include <proton/types_fwd.hpp>
-#include <proton/uuid.hpp>
-#include <proton/value.hpp>
-#include <proton/vector.hpp>
+#include "proton/annotation_key.hpp"
+#include "proton/binary.hpp"
+#include "proton/codec/deque.hpp"
+#include "proton/codec/list.hpp"
+#include "proton/codec/map.hpp"
+#include "proton/codec/vector.hpp"
+#include "proton/config.hpp"
+#include "proton/decimal.hpp"
+#include "proton/duration.hpp"
+#include "proton/message_id.hpp"
+#include "proton/scalar.hpp"
+#include "proton/symbol.hpp"
+#include "proton/timestamp.hpp"
+#include "proton/types_fwd.hpp"
+#include "proton/uuid.hpp"
+#include "proton/value.hpp"
+#include "proton/config.hpp"
 
-#include <proton/config.hpp>
 #if PN_CPP_HAS_CPP11
-#include <proton/forward_list.hpp>
-#include <proton/unordered_map.hpp>
+#include "proton/forward_list.hpp"
+#include "proton/unordered_map.hpp"
 #endif
 
 #endif // PROTON_TYPES_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/types_fwd.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/types_fwd.hpp b/proton-c/bindings/cpp/include/proton/types_fwd.hpp
index 8ece3de..f850049 100644
--- a/proton-c/bindings/cpp/include/proton/types_fwd.hpp
+++ b/proton-c/bindings/cpp/include/proton/types_fwd.hpp
@@ -1,6 +1,8 @@
 #ifndef PROTON_TYPES_FWD_HPP
 #define PROTON_TYPES_FWD_HPP
+
 /*
+ *
  * 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
@@ -17,20 +19,20 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
+ *
  */
 
-
-///@file
+/// @file
 ///
-/// Forward declarations for all the C++ types used by proton to represent AMQP types.
+/// Forward declarations for all the C++ types used by Proton to
+/// represent AMQP types.
 
-#include <proton/config.hpp>
+#include "proton/config.hpp"
 
-#include <proton/type_compat.h>
+#include "proton/type_compat.h"
 
 #include <string>
 
-/// The proton namespace
 namespace proton {
 
 class binary;
@@ -51,6 +53,7 @@ struct null {
     null(std::nullptr_t) {}
 #endif
 };
-}
+
+} // proton
 
 #endif // PROTON_TYPES_FWD_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/unordered_map.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/unordered_map.hpp b/proton-c/bindings/cpp/include/proton/unordered_map.hpp
deleted file mode 100644
index 43a84d1..0000000
--- a/proton-c/bindings/cpp/include/proton/unordered_map.hpp
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef PROTON_UNORDERED_MAP_HPP
-#define PROTON_UNORDERED_MAP_HPP
-/*
- * 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 <unordered_map>
-#include <proton/encoder.hpp>
-#include <proton/decoder.hpp>
-
-namespace proton {
-namespace codec {
-
-/// Encode std::unordered_map<K, T> as amqp::UNORDERED_MAP.
-template <class K, class T, class C, class A>
-encoder& operator<<(encoder& e, const std::unordered_map<K, T, C, A>& m) { return e << encoder::map(m); }
-
-/// Decode to std::unordered_map<K, T> from amqp::UNORDERED_MAP.
-template <class K, class T, class C, class A>
-decoder& operator>>(decoder& d, std::unordered_map<K, T, C, A>& m) { return d >> decoder::associative(m); }
-
-} // internal
-} // proton
-
-#endif // PROTON_UNORDERED_MAP_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/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 b08dc88..bb21b68 100644
--- a/proton-c/bindings/cpp/include/proton/url.hpp
+++ b/proton-c/bindings/cpp/include/proton/url.hpp
@@ -1,7 +1,8 @@
-#ifndef URL_HPP
-#define URL_HPP
+#ifndef PROTON_URL_HPP
+#define PROTON_URL_HPP
 
 /*
+ *
  * 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
@@ -18,10 +19,11 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
+ *
  */
 
-#include <proton/types_fwd.hpp>
-#include <proton/error.hpp>
+#include "proton/types_fwd.hpp"
+#include "proton/error.hpp"
 
 #include <iosfwd>
 
@@ -29,15 +31,16 @@ struct pn_url_t;
 
 namespace proton {
 
-/// Raised if URL parsing fails.
+/// An error encountered during URL parsing.
 struct
 PN_CPP_CLASS_EXTERN url_error : public error {
     /// @cond INTERNAL
-    PN_CPP_EXTERN explicit url_error(const std::string&); ///< Construct with message
+    /// Construct a URL error with a message.
+    PN_CPP_EXTERN explicit url_error(const std::string&);
     /// @endcond
 };
 
-/// A proton URL.
+/// A Proton URL.
 ///
 ///  Proton URLs take the form
 /// `<scheme>://<username>:<password>@<host>:<port>/<path>`.
@@ -54,35 +57,53 @@ class url {
     static const std::string AMQP;     ///< "amqp" prefix
     static const std::string AMQPS;    ///< "amqps" prefix
 
-    /// Parse `url_str` as an AMQP URL. If defaults is true, fill in
-    /// defaults for missing values otherwise return an empty string
-    /// for missing values.
+    // XXX No constructor for an empty URL?
+    // XXX What is the default 'defaults' behavior?
+    
+    /// Parse `url_str` as an AMQP URL.
     ///
     /// @note Converts automatically from string.
-    ///
     /// @throw url_error if URL is invalid.
     PN_CPP_EXTERN url(const std::string& url_str);
+
+    /// @cond INTERNAL
+    /// XXX I want to understand why this is important to keep.
+    ///
+    /// **Experimental** - Parse `url_str` as an AMQP URL. If
+    /// `defaults` is true, fill in defaults for missing values.
+    /// Otherwise, return an empty string for missing values.
+    ///
+    /// @note Converts automatically from string.
+    /// @throw url_error if URL is invalid.
     PN_CPP_EXTERN url(const std::string& url_str, bool defaults);
+    /// @endcond
 
     /// Copy a URL.
     PN_CPP_EXTERN url(const url&);
+
     PN_CPP_EXTERN ~url();
+
     /// Copy a URL.
     PN_CPP_EXTERN url& operator=(const url&);
 
     /// True if the URL is empty.
     PN_CPP_EXTERN bool empty() const;
 
-    /// returns the URL as a string
+    /// Returns the URL as a string
     PN_CPP_EXTERN operator std::string() const;
 
     /// @name URL fields
     ///
     /// @{
 
+    /// `amqp` or `amqps`.
     PN_CPP_EXTERN std::string scheme() const;
+    /// The user name for authentication.
     PN_CPP_EXTERN std::string user() const;
+    // XXX Passwords in URLs are dumb.
+    /// The password.
     PN_CPP_EXTERN std::string password() const;
+    /// The host name or IP address.
     PN_CPP_EXTERN std::string host() const;
     /// `port` can be a number or a symbolic name such as "amqp".
     PN_CPP_EXTERN std::string port() const;
@@ -91,6 +112,8 @@ class url {
     /// host_port returns just the `host:port` part of the URL
     PN_CPP_EXTERN std::string host_port() const;
 
+    // XXX is this not confusing (or incorrect)?  The path starts with
+    // the first / after //.
     /// `path` is everything after the final "/".
     PN_CPP_EXTERN std::string path() const;
 
@@ -99,18 +122,21 @@ class url {
   private:
     pn_url_t* url_;
 
-    friend PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const url&);
+    /// @cond INTERNAL
+
+  friend PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const url&);
 
+    // XXX Why is it important to have this?
     /// Parse `url` from istream.  This automatically fills in
     /// defaults for missing values.
     ///
     /// @note An invalid url is indicated by setting
     /// std::stream::fail(), NOT by throwing url_error.
-    friend PN_CPP_EXTERN std::istream& operator>>(std::istream&, url&);
+  friend PN_CPP_EXTERN std::istream& operator>>(std::istream&, url&);
 
     /// @endcond
 };
 
-}
+} // proton
 
-#endif // URL_HPP
+#endif // PROTON_URL_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/uuid.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/uuid.hpp b/proton-c/bindings/cpp/include/proton/uuid.hpp
index 73970f1..b69f914 100644
--- a/proton-c/bindings/cpp/include/proton/uuid.hpp
+++ b/proton-c/bindings/cpp/include/proton/uuid.hpp
@@ -1,6 +1,8 @@
-#ifndef UUID_HPP
-#define UUID_HPP
+#ifndef PROTON_UUID_HPP
+#define PROTON_UUID_HPP
+
 /*
+ *
  * 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
@@ -17,10 +19,11 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
+ *
  */
 
-#include <proton/byte_array.hpp>
-#include <proton/export.hpp>
+#include "proton/byte_array.hpp"
+#include "proton/export.hpp"
 
 #include <string>
 #include <iosfwd>
@@ -30,24 +33,30 @@ namespace proton {
 /// A 16-byte universally unique identifier.
 class uuid : public byte_array<16> {
   public:
-    /// Return a uuid copied from bytes, bytes must point to at least 16 bytes.
-    /// If bytes==0 the UUID is zero initialized.
+    /// Make a copy.
     PN_CPP_EXTERN static uuid copy();
+
+    /// Return a uuid copied from bytes.  Bytes must point to at least
+    /// 16 bytes.  If `bytes == 0` the UUID is zero-initialized.
     PN_CPP_EXTERN static uuid copy(const char* bytes);
 
-    /// Return a simple randomly-generated UUID. Used by the proton library to
-    /// generate default UUIDs.  For specific security, performance or
-    /// uniqueness requirements you may want to use a better UUID generator or
+    /// Return a simple randomly-generated UUID.  This is used by the
+    /// Proton library to generate default UUIDs.
+    ///
+    /// For specific security, performance, or uniqueness
+    /// requirements, you may want to use a better UUID generator or
     /// some other form of identifier entirely.
     PN_CPP_EXTERN static uuid random();
 
-    /// UUID standard string format: 8-4-4-4-12 (36 chars, 32 alphanumeric and 4 hypens)
+    /// UUID standard string format: 8-4-4-4-12 (36 chars, 32
+    /// alphanumeric chars and 4 hypens).
     PN_CPP_EXTERN std::string str()  const;
 };
 
-/// UUID standard format: 8-4-4-4-12 (36 chars, 32 alphanumeric and 4 hypens)
+/// UUID standard format: 8-4-4-4-12 (36 chars, 32 alphanumeric chars
+/// and 4 hypens).
 PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const uuid&);
 
-}
+} // proton
 
-#endif // UUID_HPP
+#endif // PROTON_UUID_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/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 7b347f7..3741972 100644
--- a/proton-c/bindings/cpp/include/proton/value.hpp
+++ b/proton-c/bindings/cpp/include/proton/value.hpp
@@ -2,6 +2,7 @@
 #define PROTON_VALUE_HPP
 
 /*
+ *
  * 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
@@ -18,16 +19,18 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
+ *
  */
 
-#include <proton/encoder.hpp>
-#include <proton/decoder.hpp>
-#include <proton/type_traits.hpp>
-#include <proton/types_fwd.hpp>
+#include "proton/codec/encoder.hpp"
+#include "proton/codec/decoder.hpp"
+#include "proton/internal/type_traits.hpp"
+#include "proton/types_fwd.hpp"
 
 #include <iosfwd>
 
 namespace proton {
+
 class message;
 
 namespace internal {
@@ -35,10 +38,10 @@ namespace internal {
 class value_base;
 PN_CPP_EXTERN std::ostream& operator<<(std::ostream& o, const value_base& x);
 
-///@internal - separate value data from implicit conversion constructors to avoid recursions.
+/// Separate value data from implicit conversion constructors to avoid
+/// recursions.
 class value_base {
   public:
-
     /// Get the type ID for the current value.
     PN_CPP_EXTERN type_id type() const;
 
@@ -49,16 +52,19 @@ class value_base {
     codec::data& data() const;
     mutable class codec::data data_;
 
+    /// @cond INTERNAL    
   friend class proton::message;
   friend class codec::encoder;
   friend class codec::decoder;
   friend PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const value_base&);
+    /// @endcond
 };
 
-}
-
+} // internal
 
-/// A holder for any AMQP value, simple or complex, see @ref types.
+/// A holder for any AMQP value, simple or complex.
+///
+/// @see @ref types_page
 class value : public internal::value_base, private internal::comparable<value> {
   private:
     // Enabler for encodable types excluding proton::value.
@@ -70,20 +76,20 @@ class value : public internal::value_base, private internal::comparable<value> {
     /// Create a null value
     PN_CPP_EXTERN value();
 
-    ///@name Copy a value
-    ///@{
+    /// @name Copy a value
+    /// @{
     PN_CPP_EXTERN value(const value&);
     PN_CPP_EXTERN value& operator=(const value&);
 #if PN_CPP_HAS_RVALUE_REFERENCES
     PN_CPP_EXTERN value(value&&);
     PN_CPP_EXTERN value& operator=(value&&);
 #endif
-    ///@}
+    /// @}
 
-    /// Construct from any allowed type T, see @ref types.
+    /// Construct from any allowed type T.
     template <class T> value(const T& x, typename assignable<T>::type* = 0) { *this = x; }
 
-    /// Assign from any allowed type T, see @ref types.
+    /// Assign from any allowed type T.
     template <class T> typename assignable<T, value&>::type operator=(const T& x) {
         codec::encoder e(*this);
         e << x;
@@ -93,47 +99,52 @@ class value : public internal::value_base, private internal::comparable<value> {
     /// Reset the value to null
     PN_CPP_EXTERN void clear();
 
-    ///@cond INTERNAL (deprecated)
+    /// @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;
-    ///@endcond
+    /// @endcond
 
     /// swap values
   friend PN_CPP_EXTERN void swap(value&, value&);
-    ///@name Comparison operators
-    ///@{
+
+    /// @name Comparison operators
+    /// @{
   friend PN_CPP_EXTERN bool operator==(const value& x, const value& y);
   friend PN_CPP_EXTERN bool operator<(const value& x, const value& y);
-    ///@}
+    /// @}
 
-    ///@cond INTERNAL
+    /// @cond INTERNAL
     PN_CPP_EXTERN explicit value(const codec::data&);
-    ///@endcond
+    /// @endcond
 };
 
-///@copydoc scalar::get
-///@related proton::value
+/// @copydoc scalar::get
+/// @related proton::value
 template<class T> T get(const value& v) { T x; get(v, x); return x; }
 
-/// Like get(const value&) but assigns the value to a reference instead of returning it.
-/// May be more efficient for complex values (arrays, maps etc.)
-///@related proton::value
+/// Like get(const value&) but assigns the value to a reference
+/// instead of returning it.  May be more efficient for complex values
+/// (arrays, maps, etc.)
+///    
+/// @related proton::value
 template<class T> void get(const value& v, T& x) { codec::decoder d(v, true); d >> x; }
 
-///@copydoc scalar::coerce
-///@related proton::value
+/// @copydoc scalar::coerce
+/// @related proton::value
 template<class T> T coerce(const value& v) { T x; coerce(v, x); return x; }
 
-/// Like coerce(const value&) but assigns the value to a reference instead of returning it.
-/// May be more efficient for complex values (arrays, maps etc.)
-///@related proton::value
+/// Like coerce(const value&) but assigns the value to a reference
+/// instead of returning it.  May be more efficient for complex values
+/// (arrays, maps, etc.)
+///
+/// @related proton::value
 template<class T> void coerce(const value& v, T& x) { codec::decoder d(v, false); d >> x; }
 
-///@cond INTERNAL
+/// @cond INTERNAL
 template<> inline void get<null>(const value& v, null&) { assert_type_equal(NULL_TYPE, v.type()); }
 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); }
@@ -141,7 +152,7 @@ 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
+/// @endcond
 
 } // proton
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/vector.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/vector.hpp b/proton-c/bindings/cpp/include/proton/vector.hpp
deleted file mode 100644
index 1e04b0d..0000000
--- a/proton-c/bindings/cpp/include/proton/vector.hpp
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef PROTON_VECTOR_HPP
-#define PROTON_VECTOR_HPP
-/*
- * 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 <vector>
-#include <utility>
-
-#include <proton/encoder.hpp>
-#include <proton/decoder.hpp>
-
-namespace proton {
-namespace codec {
-
-/// Encode std::vector<T> as amqp::ARRAY (same type elements)
-template <class T, class A> encoder& operator<<(encoder& e, const std::vector<T, A>& x) {
-    return e << encoder::array(x, internal::type_id_of<T>::value);
-}
-
-/// Encode std::vector<value> encode as amqp::LIST (mixed type elements)
-template <class A> encoder& operator<<(encoder& e, const std::vector<value, A>& x) { return e << encoder::list(x); }
-
-/// Encode std::vector<scalar> as amqp::LIST (mixed type elements)
-template <class A> encoder& operator<<(encoder& e, const std::vector<scalar, A>& x) { return e << encoder::list(x); }
-
-/// Encode std::deque<std::pair<k,t> > as amqp::MAP, preserves order of entries.
-template <class A, class K, class T>
-encoder& operator<<(encoder& e, const std::vector<std::pair<K,T>, A>& x) { return e << encoder::map(x); }
-
-/// Decode to std::vector<T> from an amqp::LIST or amqp::ARRAY.
-template <class T, class A> decoder& operator>>(decoder& d, std::vector<T, A>& x) { return d >> decoder::sequence(x); }
-
-/// Decode to std::vector<std::pair<K, T> from an amqp::MAP.
-template <class A, class K, class T> decoder& operator>>(decoder& d, std::vector<std::pair<K, T> , A>& x) { return d >> decoder::pair_sequence(x); }
-
-} // internal
-} // proton
-
-#endif // PROTON_VECTOR_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/src/acceptor.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/acceptor.hpp b/proton-c/bindings/cpp/src/acceptor.hpp
index 51d1094..82f2f5c 100644
--- a/proton-c/bindings/cpp/src/acceptor.hpp
+++ b/proton-c/bindings/cpp/src/acceptor.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_ACCEPTOR_H
-#define PROTON_CPP_ACCEPTOR_H
+#ifndef PROTON_ACCEPTOR_HPP
+#define PROTON_ACCEPTOR_HPP
 
 /*
  *
@@ -22,9 +22,10 @@
  *
  */
 
-#include <proton/reactor.h>
-#include <proton/export.hpp>
-#include <proton/object.hpp>
+#include "proton/export.hpp"
+#include "proton/internal/object.hpp"
+
+#include "proton/reactor.h"
 
 struct pn_acceptor_t;
 
@@ -52,10 +53,10 @@ class acceptor : public internal::object<pn_acceptor_t> {
     PN_CPP_EXTERN class connection_options &connection_options();
 
     /// @cond INTERNAL
-     friend class internal::factory<acceptor>;
+  friend class internal::factory<acceptor>;
     /// @endcond
 };
 
-}
+} // proton
 
-#endif // PROTON_CPP_ACCEPTOR_H
+#endif // PROTON_ACCEPTOR_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/src/data.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/data.cpp b/proton-c/bindings/cpp/src/data.cpp
index 26583af..3f5aa5e 100644
--- a/proton-c/bindings/cpp/src/data.cpp
+++ b/proton-c/bindings/cpp/src/data.cpp
@@ -20,9 +20,9 @@
 #include "proton_bits.hpp"
 
 #include <proton/binary.hpp>
+#include <proton/codec/encoder.hpp>
 #include <proton/data.hpp>
 #include <proton/decimal.hpp>
-#include <proton/encoder.hpp>
 #include <proton/message_id.hpp>
 #include <proton/symbol.hpp>
 #include <proton/timestamp.hpp>

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/src/decoder.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/decoder.cpp b/proton-c/bindings/cpp/src/decoder.cpp
index 7bfbeb3..d6ba4e5 100644
--- a/proton-c/bindings/cpp/src/decoder.cpp
+++ b/proton-c/bindings/cpp/src/decoder.cpp
@@ -19,9 +19,9 @@
 
 #include <proton/annotation_key.hpp>
 #include <proton/binary.hpp>
+#include <proton/codec/encoder.hpp>
 #include <proton/data.hpp>
 #include <proton/decimal.hpp>
-#include <proton/encoder.hpp>
 #include <proton/message_id.hpp>
 #include <proton/scalar.hpp>
 #include <proton/symbol.hpp>

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/src/encoder.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/encoder.cpp b/proton-c/bindings/cpp/src/encoder.cpp
index 4067cf8..3abd2ca 100644
--- a/proton-c/bindings/cpp/src/encoder.cpp
+++ b/proton-c/bindings/cpp/src/encoder.cpp
@@ -23,11 +23,11 @@
 
 #include <proton/annotation_key.hpp>
 #include <proton/binary.hpp>
+#include <proton/codec/encoder.hpp>
 #include <proton/data.hpp>
 #include <proton/decimal.hpp>
-#include <proton/encoder.hpp>
 #include <proton/message_id.hpp>
-#include <proton/scalar_base.hpp>
+#include <proton/internal/scalar_base.hpp>
 #include <proton/symbol.hpp>
 #include <proton/timestamp.hpp>
 #include <proton/value.hpp>

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/src/interop_test.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/interop_test.cpp b/proton-c/bindings/cpp/src/interop_test.cpp
index bcadcfe..22581f0 100644
--- a/proton-c/bindings/cpp/src/interop_test.cpp
+++ b/proton-c/bindings/cpp/src/interop_test.cpp
@@ -17,8 +17,8 @@
  * under the License.
  */
 
-#include "proton/decoder.hpp"
-#include "proton/encoder.hpp"
+#include "proton/codec/decoder.hpp"
+#include "proton/codec/encoder.hpp"
 #include "proton/error.hpp"
 #include "proton/value.hpp"
 #include "test_bits.hpp"

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/src/object.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/object.cpp b/proton-c/bindings/cpp/src/object.cpp
index a891b20..f881c63 100644
--- a/proton-c/bindings/cpp/src/object.cpp
+++ b/proton-c/bindings/cpp/src/object.cpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "proton/object.hpp"
+#include "proton/internal/object.hpp"
 #include <proton/object.h>
 
 namespace proton {

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/src/reactor.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/reactor.hpp b/proton-c/bindings/cpp/src/reactor.hpp
index 74bacff..ec5f120 100644
--- a/proton-c/bindings/cpp/src/reactor.hpp
+++ b/proton-c/bindings/cpp/src/reactor.hpp
@@ -23,7 +23,7 @@
 /// @cond INTERNAL
 /// XXX remove
 
-#include "proton/object.hpp"
+#include "proton/internal/object.hpp"
 #include "proton/duration.hpp"
 #include "proton/timestamp.hpp"
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/src/scalar_base.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/scalar_base.cpp b/proton-c/bindings/cpp/src/scalar_base.cpp
index c7f97e8..20694db 100644
--- a/proton-c/bindings/cpp/src/scalar_base.cpp
+++ b/proton-c/bindings/cpp/src/scalar_base.cpp
@@ -22,10 +22,10 @@
 
 #include "proton/binary.hpp"
 #include "proton/decimal.hpp"
-#include "proton/scalar_base.hpp"
+#include "proton/internal/scalar_base.hpp"
+#include "proton/internal/type_traits.hpp"
 #include "proton/symbol.hpp"
 #include "proton/timestamp.hpp"
-#include "proton/type_traits.hpp"
 #include "proton/uuid.hpp"
 
 #include <ostream>

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/src/scalar_test.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/scalar_test.cpp b/proton-c/bindings/cpp/src/scalar_test.cpp
index f306ba8..ba22757 100644
--- a/proton-c/bindings/cpp/src/scalar_test.cpp
+++ b/proton-c/bindings/cpp/src/scalar_test.cpp
@@ -21,7 +21,7 @@
 
 #include "proton/binary.hpp"
 #include "proton/error.hpp"
-#include "proton/type_traits.hpp"
+#include "proton/internal/type_traits.hpp"
 
 #include <proton/scalar.hpp>
 #include <proton/value.hpp>

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/src/types_internal.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/types_internal.hpp b/proton-c/bindings/cpp/src/types_internal.hpp
index 0391d9b..c9ee7c6 100644
--- a/proton-c/bindings/cpp/src/types_internal.hpp
+++ b/proton-c/bindings/cpp/src/types_internal.hpp
@@ -19,7 +19,7 @@
  * under the License.
  */
 
-#include <proton/type_traits.hpp>
+#include <proton/internal/type_traits.hpp>
 #include <proton/error.hpp>
 #include <proton/binary.hpp>
 #include <sstream>

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/tests/tools/apps/cpp/reactor_send.cpp
----------------------------------------------------------------------
diff --git a/tests/tools/apps/cpp/reactor_send.cpp b/tests/tools/apps/cpp/reactor_send.cpp
index eae4d46..05e6417 100644
--- a/tests/tools/apps/cpp/reactor_send.cpp
+++ b/tests/tools/apps/cpp/reactor_send.cpp
@@ -24,7 +24,7 @@
 #include "proton/binary.hpp"
 #include "proton/connection.hpp"
 #include "proton/default_container.hpp"
-#include "proton/decoder.hpp"
+#include "proton/codec/decoder.hpp"
 #include "proton/delivery.hpp"
 #include "proton/handler.hpp"
 #include "proton/tracker.hpp"


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


[4/4] qpid-proton git commit: PROTON-1200: Improve C++ binding documentation and header formatting

Posted by jr...@apache.org.
PROTON-1200: Improve C++ binding documentation and header formatting

 - Add lots of documentation
 - Eliminate doxygen warnings
 - Update pages for correct links and revise the content
 - Move codec::* and internal::* classes into corresponding include
   directories
 - Move AMQP type defines from amqp:: to codec::
 - Clearly mark experimental parts of the API as such in the API docs
 - Hide some API elements that aren't ready for broader use.
 - Make the typed ranges and iterators undocumented (but present)
 - Shorten some of the class summaries so that they look nice in the
   index
 - Style stuff
   - Use one pattern throughout for header guards
   - Make imports uniform
   - Use the Oxford comma, because it's better that way


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

Branch: refs/heads/master
Commit: 2dc4afe08c091a71df04e9faf61df3bc013d5c6c
Parents: 552f439
Author: Justin Ross <jr...@apache.org>
Authored: Mon May 16 19:44:31 2016 -0700
Committer: Justin Ross <jr...@apache.org>
Committed: Mon May 16 19:44:31 2016 -0700

----------------------------------------------------------------------
 examples/cpp/README.dox                         |  31 +--
 examples/cpp/client.cpp                         |   4 +-
 examples/cpp/encode_decode.cpp                  |   4 +-
 proton-c/bindings/cpp/docs/io.md                |  21 ++
 proton-c/bindings/cpp/docs/main.md              | 146 +++++++++++++
 proton-c/bindings/cpp/docs/mainpage.md          | 138 ------------
 proton-c/bindings/cpp/docs/mt.md                |  29 +++
 proton-c/bindings/cpp/docs/mt_page.md           |  23 --
 proton-c/bindings/cpp/docs/types.md             |  76 +++++++
 proton-c/bindings/cpp/include/proton/amqp.hpp   |  94 ---------
 .../cpp/include/proton/annotation_key.hpp       |  51 +++--
 proton-c/bindings/cpp/include/proton/binary.hpp |  22 +-
 .../bindings/cpp/include/proton/byte_array.hpp  |  42 ++--
 .../cpp/include/proton/codec/amqp_types.hpp     | 106 ++++++++++
 .../cpp/include/proton/codec/decoder.hpp        | 211 +++++++++++++++++++
 .../bindings/cpp/include/proton/codec/deque.hpp |  60 ++++++
 .../cpp/include/proton/codec/encoder.hpp        | 199 +++++++++++++++++
 .../cpp/include/proton/codec/forward_list.hpp   |  60 ++++++
 .../bindings/cpp/include/proton/codec/list.hpp  |  62 ++++++
 .../bindings/cpp/include/proton/codec/map.hpp   |  44 ++++
 .../cpp/include/proton/codec/unordered_map.hpp  |  44 ++++
 .../cpp/include/proton/codec/vector.hpp         |  58 +++++
 .../bindings/cpp/include/proton/comparable.hpp  |  41 ----
 proton-c/bindings/cpp/include/proton/config.hpp |   8 +-
 .../bindings/cpp/include/proton/connection.hpp  |  49 +++--
 .../cpp/include/proton/connection_options.hpp   |  47 ++---
 .../bindings/cpp/include/proton/container.hpp   | 122 ++++++-----
 proton-c/bindings/cpp/include/proton/data.hpp   |  49 +++--
 .../bindings/cpp/include/proton/decimal.hpp     |  24 ++-
 .../bindings/cpp/include/proton/decoder.hpp     | 195 -----------------
 .../cpp/include/proton/default_container.hpp    |  18 +-
 .../bindings/cpp/include/proton/delivery.hpp    |  30 +--
 .../cpp/include/proton/delivery_mode.hpp        |  53 ++---
 proton-c/bindings/cpp/include/proton/deque.hpp  |  58 -----
 .../bindings/cpp/include/proton/duration.hpp    |  36 ++--
 .../bindings/cpp/include/proton/encoder.hpp     | 194 -----------------
 .../bindings/cpp/include/proton/endpoint.hpp    |  40 ++--
 proton-c/bindings/cpp/include/proton/error.hpp  |  29 +--
 .../cpp/include/proton/error_condition.hpp      |  35 +--
 .../bindings/cpp/include/proton/event_loop.hpp  |  31 ++-
 proton-c/bindings/cpp/include/proton/export.hpp |   6 +-
 .../cpp/include/proton/forward_list.hpp         |  58 -----
 .../bindings/cpp/include/proton/handler.hpp     | 100 +++++----
 .../cpp/include/proton/internal/comparable.hpp  |  40 ++++
 .../cpp/include/proton/internal/object.hpp      | 108 ++++++++++
 .../include/proton/internal/pn_unique_ptr.hpp   |  68 ++++++
 .../cpp/include/proton/internal/scalar_base.hpp | 181 ++++++++++++++++
 .../cpp/include/proton/internal/type_traits.hpp | 153 ++++++++++++++
 .../cpp/include/proton/io/connection_engine.hpp |  72 +++----
 .../include/proton/io/container_impl_base.hpp   |  38 +++-
 .../cpp/include/proton/io/link_namer.hpp        |  19 +-
 proton-c/bindings/cpp/include/proton/link.hpp   |  61 +++---
 proton-c/bindings/cpp/include/proton/list.hpp   |  58 -----
 .../cpp/include/proton/listen_handler.hpp       |  12 +-
 .../bindings/cpp/include/proton/listener.hpp    |  17 +-
 proton-c/bindings/cpp/include/proton/map.hpp    |  40 ----
 .../bindings/cpp/include/proton/message.hpp     | 143 +++++++++----
 .../bindings/cpp/include/proton/message_id.hpp  |  27 ++-
 .../bindings/cpp/include/proton/namespaces.hpp  |  44 ++++
 proton-c/bindings/cpp/include/proton/object.hpp | 108 ----------
 .../cpp/include/proton/pn_unique_ptr.hpp        |  67 ------
 .../bindings/cpp/include/proton/receiver.hpp    |  33 +--
 .../cpp/include/proton/receiver_options.hpp     |  19 +-
 .../cpp/include/proton/reconnect_timer.hpp      |  30 +--
 proton-c/bindings/cpp/include/proton/sasl.hpp   |  11 +-
 proton-c/bindings/cpp/include/proton/scalar.hpp |  27 +--
 .../bindings/cpp/include/proton/scalar_base.hpp | 177 ----------------
 proton-c/bindings/cpp/include/proton/sender.hpp |  40 ++--
 .../cpp/include/proton/sender_options.hpp       |  14 +-
 .../bindings/cpp/include/proton/session.hpp     |  57 ++---
 .../cpp/include/proton/session_options.hpp      |  16 +-
 proton-c/bindings/cpp/include/proton/source.hpp |  37 ++--
 .../cpp/include/proton/source_options.hpp       |  24 +--
 proton-c/bindings/cpp/include/proton/ssl.hpp    |  39 ++--
 proton-c/bindings/cpp/include/proton/symbol.hpp |  23 +-
 proton-c/bindings/cpp/include/proton/target.hpp |  19 +-
 .../cpp/include/proton/target_options.hpp       |  22 +-
 proton-c/bindings/cpp/include/proton/task.hpp   |  14 +-
 .../bindings/cpp/include/proton/terminus.hpp    |  39 ++--
 .../bindings/cpp/include/proton/thread_safe.hpp |  58 +++--
 .../bindings/cpp/include/proton/timestamp.hpp   |  39 ++--
 .../bindings/cpp/include/proton/tracker.hpp     |  21 +-
 .../bindings/cpp/include/proton/transfer.hpp    |  23 +-
 .../bindings/cpp/include/proton/transport.hpp   |  12 +-
 .../bindings/cpp/include/proton/type_id.hpp     |  63 +++---
 .../bindings/cpp/include/proton/type_traits.hpp | 153 --------------
 proton-c/bindings/cpp/include/proton/types.hpp  | 126 +++--------
 .../bindings/cpp/include/proton/types_fwd.hpp   |  17 +-
 .../cpp/include/proton/unordered_map.hpp        |  40 ----
 proton-c/bindings/cpp/include/proton/url.hpp    |  58 +++--
 proton-c/bindings/cpp/include/proton/uuid.hpp   |  35 +--
 proton-c/bindings/cpp/include/proton/value.hpp  |  77 ++++---
 proton-c/bindings/cpp/include/proton/vector.hpp |  55 -----
 proton-c/bindings/cpp/src/acceptor.hpp          |  17 +-
 proton-c/bindings/cpp/src/data.cpp              |   2 +-
 proton-c/bindings/cpp/src/decoder.cpp           |   2 +-
 proton-c/bindings/cpp/src/encoder.cpp           |   4 +-
 proton-c/bindings/cpp/src/interop_test.cpp      |   4 +-
 proton-c/bindings/cpp/src/object.cpp            |   2 +-
 proton-c/bindings/cpp/src/reactor.hpp           |   2 +-
 proton-c/bindings/cpp/src/scalar_base.cpp       |   4 +-
 proton-c/bindings/cpp/src/scalar_test.cpp       |   2 +-
 proton-c/bindings/cpp/src/types_internal.hpp    |   2 +-
 tests/tools/apps/cpp/reactor_send.cpp           |   2 +-
 104 files changed, 2974 insertions(+), 2491 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/examples/cpp/README.dox
----------------------------------------------------------------------
diff --git a/examples/cpp/README.dox b/examples/cpp/README.dox
index 97e0619..1b7020b 100644
--- a/examples/cpp/README.dox
+++ b/examples/cpp/README.dox
@@ -102,12 +102,6 @@ alternatives.
 
 */
 
-/** @example recurring_timer.cpp
-
-Shows how to implement recurring time-based events using the scheduler. 
-
-*/
-
 /** @example broker.hpp
 
 Common logic for a simple "mini broker" that creates creates queues
@@ -128,9 +122,10 @@ subscribe.
 
 /** @example mt/epoll_container.cpp
 
-An example implementation of the proton::container API that shows how to use the
-prton::io::connection_engine SPI to adapt the proton API to native IO. In this
-case using a multi-threaded Linux epoll poller as the implementation.
+An example implementation of the proton::container API that shows how
+to use the proton::io::connection_engine SPI to adapt the proton API
+to native IO, in this case using a multithreaded Linux epoll poller as
+the implementation.
 
 __Requires C++11__
 
@@ -138,26 +133,10 @@ __Requires C++11__
 
 /** @example mt/broker.cpp
 
-A multi-threaded broker, using the proton::mt extensions. This broker is
+A multithreaded broker, using the proton::mt extensions. This broker is
 portable over any implementation of the proton::mt API, see @ref
 mt/epoll_container.cpp for an example.
 
 __Requires C++11__
 
 */
-
-/** @example mt/simple_send.cpp
-
-A multi-threaded sender client. Sends messages concurrently to multiple addresses.
-
-__Requires C++11__
-
-*/
-
-/** @example mt/simple_recv.cpp
-
-A multi-threaded receiver client. Receives messages concurrently to multiple addresses.
-
-__Requires C++11__
-
-*/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/examples/cpp/client.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/client.cpp b/examples/cpp/client.cpp
index bf7c7c8..ab6ae12 100644
--- a/examples/cpp/client.cpp
+++ b/examples/cpp/client.cpp
@@ -49,8 +49,8 @@ class client : public proton::handler {
         sender = c.open_sender(url);
         // Create a receiver requesting a dynamically created queue
         // for the message source.
-        receiver_options dynamic_addr = receiver_options().source(source_options().dynamic(true));
-        receiver = sender.connection().open_receiver("", dynamic_addr);
+        receiver_options opts = receiver_options().source(source_options().dynamic(true));
+        receiver = sender.connection().open_receiver("", opts);
     }
 
     void send_request() {

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/examples/cpp/encode_decode.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/encode_decode.cpp b/examples/cpp/encode_decode.cpp
index 832c78a..67fb0fc 100644
--- a/examples/cpp/encode_decode.cpp
+++ b/examples/cpp/encode_decode.cpp
@@ -18,8 +18,8 @@
  */
 
 #include <proton/types.hpp>
-#include <proton/encoder.hpp>
-#include <proton/decoder.hpp>
+#include <proton/codec/encoder.hpp>
+#include <proton/codec/decoder.hpp>
 
 #include <algorithm>
 #include <iostream>

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/docs/io.md
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/docs/io.md b/proton-c/bindings/cpp/docs/io.md
new file mode 100644
index 0000000..e6ee386
--- /dev/null
+++ b/proton-c/bindings/cpp/docs/io.md
@@ -0,0 +1,21 @@
+# IO integration {#io_page}
+
+**Experimental**
+
+The proton::io namespace contains a low-level service provider
+interface (SPI) that can be used to implement the proton API over any
+native or third-party IO library.
+
+The proton::io::connection_engine is the core engine that converts raw
+AMQP bytes read from any IO source into proton::messaging_handler
+event calls and generates AMQP byte-encoded output that can be written
+to any IO destination.
+
+Integrations need to implement two user-visible interfaces:
+
+ - proton::container lets the user initiate or listen for connections.
+
+ - proton::event_loop lets the user serialize their own work with a
+   connection.
+
+@see @ref mt/epoll\_container.cpp for an example of an integration.

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/docs/main.md
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/docs/main.md b/proton-c/bindings/cpp/docs/main.md
new file mode 100644
index 0000000..3ff00a1
--- /dev/null
+++ b/proton-c/bindings/cpp/docs/main.md
@@ -0,0 +1,146 @@
+# Introduction {#mainpage}
+
+This is the C++ API for the Proton AMQP protocol engine. It allows you
+to write client and server applications that send and receive AMQP
+messages.
+
+The best way to start is with the @ref tutorial.
+
+## An overview of the AMQP model
+
+Messages are transferred between connected peers over *links*. The
+sending end of a link is a `proton::sender`, and the receiving end is
+a `proton::receiver`.  Links have named 'source' and 'target'
+addresses.  See "Sources and Targets" below for more information.
+
+Links are grouped in a `proton::session`. Messages for links in the
+same session are sent sequentially.  Messages on different sessions
+can be interleaved, so a large message being sent on one session does
+not block messages being sent on other sessions.
+
+Sessions are created over a `proton::connection`, which represents the
+network connection. You can create links directly on a connection
+using its default session if you don't need multiple sessions.
+
+`proton::message` represents the message: the body (content), properties,
+headers and annotations. A `proton::delivery` represents the act of transferring
+a message over a link. The receiver acknowledges the delivery by accepting or
+rejecting it. The delivery is *settled* when both ends are done with it.
+Different settlement methods give different levels of reliability:
+*at-most-once*, *at-least-once*, and *exactly-once*. See "Delivery Guarantees"
+below for details.
+
+## Sources and targets
+
+Every link has two addresses, *source* and *target*. The most common
+pattern for using these addresses is as follows:
+
+When a client creates a *receiver* link, it sets the *source*
+address. This means "I want to receive messages from this source."
+This is often referred to as "subscribing" to the source. When a
+client creates a *sender* link, it sets the *target* address. This
+means "I want to send to this target."
+
+In the case of a broker, the source or target usually refers to a
+queue or topic. In general they can refer to any AMQP-capable node.
+
+In the *request-response* pattern, a request message carries a
+*reply-to* address for the response message. This can be any AMQP
+address, but it is often useful to create a temporary address for just
+the response message.
+
+The most common approach is for the client to create a *receiver* for
+the response with the *dynamic* flag set. This asks the server to
+generate a unique *source* address automatically and discard it when
+the link closes. The client uses this "dynamic" source address as the
+reply-to when it sends the request, and the response is delivered to
+the client's dynamic receiver.
+
+In the case of a broker, a dynamic address usually corresponds to a
+temporary queue, but any AMQP request-response server can use this
+technique. The @ref server_direct.cpp example illustrates how to
+implement a queueless request-response server.
+
+## Delivery guarantees
+
+For *at-most-once*, the sender settles the message as soon as it sends
+it. If the connection is lost before the message is received by the
+receiver, the message will not be delivered.
+
+For *at-least-once*, the receiver accepts and settles the message on
+receipt. If the connection is lost before the sender is informed of
+the settlement, then the delivery is considered in-doubt and should be
+retried. This will ensure it eventually gets delivered (provided of
+course the connection and link can be reestablished). It may mean that
+it is delivered multiple times though.
+
+Finally, for *exactly-once*, the receiver accepts the message but
+doesn't settle it. The sender settles once it is aware that the
+receiver accepted it. In this way the receiver retains knowledge of an
+accepted message until it is sure the sender knows it has been
+accepted. If the connection is lost before settlement, the receiver
+informs the sender of all the unsettled deliveries it knows about, and
+from this the sender can deduce which need to be redelivered. The
+sender likewise informs the receiver which deliveries it knows about,
+from which the receiver can deduce which have already been settled.
+
+## Anatomy of a Proton application
+
+To send AMQP commands, call methods on classes like `proton::connection`,
+`proton::sender`, `proton::receiver`, or `proton::delivery`.
+
+To handle incoming commands, subclass the `proton::messaging_handler`
+interface. The handler member functions are called when AMQP protocol
+events occur on a connection. For example
+`proton::messaging_handler::on_message` is called when a message is
+received.
+
+Messages are represented by `proton::message`. AMQP defines a type
+encoding that you can use for interoperability, but you can also use
+any encoding you wish and pass binary data as the
+`proton::message::body`. `proton::value` and `proton::scalar` provide
+conversion between AMQP and C++ data types.
+
+There are several ways to manage handlers and AMQP objects, for
+different types of application. All of them use the same
+`proton::messaging_handler` sub-classes so code can be re-used if you
+change your approach.
+
+### %proton::container - Easy single-threaded applications
+
+`proton::container` is the top level object in a proton application.
+Use proton::connection::connect() and proton::container::listen() to
+create connections. The container polls multiple connections and calls
+protocol events on your `proton::messaging_handler` sub-classes.
+
+<!-- XXX This is wrong?
+The default container implementation is created by
+`proton::new_default_container()`.
+-->
+
+You can implement your own container to integrate proton with
+arbitrary your own container using the
+`proton::io::connection_engine`.
+
+### %proton::io::connection_engine - Integrating with foreign IO
+
+The `proton::io::connection_engine` is different from the other proton
+APIs. You might think of it as more like an SPI (service provider
+interface).
+
+The engine provides a very low-level way of driving a
+`proton::messaging_handler`: You feed raw byte-sequence fragments of
+an AMQP-encoded stream to the engine and it converts that into calls
+on a proton::handler. The engine provides you with outgoing protocol
+stream bytes in return.
+
+The engine is deliberately very simple and low level. It does no IO, no
+thread-related locking, and is written in simple C++98-compatible code.
+
+You can use the engine directly to connect your application to any
+kind of IO framework or library, memory-based streams, or any other
+source or sink for byte-stream data.
+
+You can also use the engine to build a custom implementation of
+`proton::container` so portable proton applications can run without
+modification on your platform.

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/docs/mainpage.md
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/docs/mainpage.md b/proton-c/bindings/cpp/docs/mainpage.md
deleted file mode 100644
index 2ba2eaf..0000000
--- a/proton-c/bindings/cpp/docs/mainpage.md
+++ /dev/null
@@ -1,138 +0,0 @@
-# Introduction {#mainpage}
-
-This is the C++ API for the Proton AMQP protocol engine. It allows you
-to write client and server applications that send and receive AMQP
-messages.
-
-The best way to start is with the @ref tutorial
-
-## An overview of the AMQP model
-
-Messages are transferred between connected peers over *links*. The
-sending end of a link is a `proton::sender`, and the receiving end is
-a `proton::receiver`.  Links have named 'source' and 'target'
-addresses.  See "Sources and Targets" below for more information.
-
-Links are grouped in a `proton::session`. Messages for links in the
-same session are sent sequentially.  Messages on different sessions
-can be interleaved, so a large message being sent on one session does
-not block messages being sent on other sessions.
-
-Sessions are created over a `proton::connection`, which represents the
-network connection. You can create links directly on a connection
-using its default session if you don't need multiple sessions.
-
-`proton::message` represents the message: the body (content), properties,
-headers and annotations. A `proton::delivery` represents the act of transferring
-a message over a link. The receiver acknowledges the delivery by accepting or
-rejecting it. The delivery is *settled* when both ends are done with it.
-Different settlement methods give different levels of reliability:
-*at-most-once*, *at-least-once*, and *exactly-once*. See "Delivery Guarantees"
-below for details.
-
-## Sources and targets
-
-Every link has two addresses, *source* and *target*. The most common
-pattern for using these addresses is as follows:
-
-When a client creates a *receiver* link, it sets the *source*
-address. This means "I want to receive messages from this source."
-This is often referred to as "subscribing" to the source. When a
-client creates a *sender* link, it sets the *target* address. This
-means "I want to send to this target."
-
-In the case of a broker, the source or target usually refers to a
-queue or topic. In general they can refer to any AMQP-capable node.
-
-In the *request-response* pattern, a request message carries a
-*reply-to* address for the response message. This can be any AMQP
-address, but it is often useful to create a temporary address for just
-the response message.
-
-The most common approach is for the client to create a *receiver* for
-the response with the *dynamic* flag set. This asks the server to
-generate a unique *source* address automatically and discard it when
-the link closes. The client uses this "dynamic" source address as the
-reply-to when it sends the request, and the response is delivered to
-the client's dynamic receiver.
-
-In the case of a broker, a dynamic address usually corresponds to a
-temporary queue, but any AMQP request-response server can use this
-technique. The @ref server_direct.cpp example illustrates how to
-implement a queueless request-response server.
-
-## Delivery guarantees
-
-For *at-most-once*, the sender settles the message as soon as it sends
-it. If the connection is lost before the message is received by the
-receiver, the message will not be delivered.
-
-For *at-least-once*, the receiver accepts and settles the message on
-receipt. If the connection is lost before the sender is informed of
-the settlement, then the delivery is considered in-doubt and should be
-retried. This will ensure it eventually gets delivered (provided of
-course the connection and link can be reestablished). It may mean that
-it is delivered multiple times though.
-
-Finally, for *exactly-once*, the receiver accepts the message but
-doesn't settle it. The sender settles once it is aware that the
-receiver accepted it. In this way the receiver retains knowledge of an
-accepted message until it is sure the sender knows it has been
-accepted. If the connection is lost before settlement, the receiver
-informs the sender of all the unsettled deliveries it knows about, and
-from this the sender can deduce which need to be redelivered. The
-sender likewise informs the receiver which deliveries it knows about,
-from which the receiver can deduce which have already been settled.
-
-## Anatomy of a Proton application
-
-To send AMQP commands, call methods on classes like `proton::connection`,
-`proton::sender`, `proton::receiver`, or `proton::delivery`.
-
-To handle incoming commands, subclass the `proton::handler` interface. The
-handler member functions are called when AMQP protocol events occur on a
-connection. For example `proton::handler::on_message` is called when a message
-is received.
-
-Messages are represented by `proton::message`. AMQP defines a type
-encoding that you can use for interoperability, but you can also use
-any encoding you wish and pass binary data as the
-`proton::message::body`. `proton::value` and `proton::scalar` provide
-conversion between AMQP and C++ data types.
-
-There are several ways to manage handlers and AMQP objects, for different types
-of application. All of them use the same `proton::handler` sub-classes so code
-can be re-used if you change your approach.
-
-### %proton::container - easy single-threaded applications
-
-`proton::container` is the top level object in a proton application.  Use
-proton::connection::connect() and proton::container::listen() to create
-connections. The container polls multiple connections and calls protocol events
-on your `proton::handler` sub-classes.
-
-The default container implementation is created by `proton::new_default_container()`.
-
-You can implement your own container to integrate proton with arbitrary your own
-container using the proton::io::connection_engine.
-
-### %proton::io::connection_engine - integrating with foreign IO
-
-The `proton::io::connection_engine` is different from the other proton APIs. You
-might think of it as more like an SPI (Service Provided Interface).
-
-The engine provides a very low-level way of driving a proton::handler: You feed
-raw byte-sequence fragments of an AMQP-encoded stream to the engine and it
-converts that into calls on a proton::handler. The engine provides you with
-outgoing protocol stream bytes in return.
-
-The engine is deliberately very simple and low level. It does no IO, no
-thread-related locking, and is written in simple C++98 compatible code.
-
-You can use the engine directly to connect your application to any kind of IO
-framework or library, memory-based streams or any other source/sink for byte
-stream data.
-
-You can also use the engine to build a custom implementation of
-proton::container and so portable proton applications can run without
-modification on your platform.

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/docs/mt.md
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/docs/mt.md b/proton-c/bindings/cpp/docs/mt.md
new file mode 100644
index 0000000..73239e5
--- /dev/null
+++ b/proton-c/bindings/cpp/docs/mt.md
@@ -0,0 +1,29 @@
+# Multithreaded Proton {#mt_page}
+
+**Experimental**
+
+<!-- FIXME aconway 2016-05-04: doc -->
+
+Most classes in namespace @ref proton are not thread-safe. Objects
+associated with a single connection *must not* be used
+concurrently. However, objects associated with *different* connections
+*can* be used concurrently in separate threads.
+
+The recommended way to use proton multithreaded is to *serialize* the
+work for each connection but allow different connections to be
+processed concurrently.
+
+proton::container allows you to manage connections in a multithreaded
+way. You supply a proton::messaging_handler for each
+connection. Proton will ensure that the
+`proton::messaging_handler::on_*()` functions are never called
+concurrently so per-connection handlers do not need a lock even if
+they have state.
+
+proton::event_loop allows you to make calls to arbitrary functions or
+other code, serialized in the same way as
+`proton::messaging_handler::on_*()` calls. Typically this is used to
+call your own handler's member functions in the same way as
+proton::messaging_handler override functions.
+
+For an example see @ref mt/broker.cpp.

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/docs/mt_page.md
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/docs/mt_page.md b/proton-c/bindings/cpp/docs/mt_page.md
deleted file mode 100644
index a1ac849..0000000
--- a/proton-c/bindings/cpp/docs/mt_page.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# Multi-threaded proton {#mt_page}
-
-<!-- FIXME aconway 2016-05-04: doc -->
-
-Most classes in namespace @ref proton are not thread-safe. Objects associated
-with a single connection *must not* be used concurrently. However objects
-associated with *different* connections *can* be used concurrently in separate
-threads.
-
-The recommended way to use proton multi-threaded is to *serialize* the work for
-each connection but allow different connections to be processed concurrently.
-
-proton::container allows you to manage connections in a multi-threaded way. You
-supply a proton::handler for each connection. Proton will ensure that the
-`proton::handler::on_*()` functions are never called concurrently so
-per-connection handlers do not need a lock even if they have state.
-
-proton::work_queue allows you to make calls to arbitrary functions or other
-code, serialized in the same way as `proton::handler::on_()` calls. Typically
-this is used to call your own handler's member functions in the same way as
-proton::handler override functions.
-
-For examples see @ref mt/broker.cpp, mt/simple\_send.cpp and mt/simple\_recv.cpp

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/docs/types.md
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/docs/types.md b/proton-c/bindings/cpp/docs/types.md
new file mode 100644
index 0000000..7a643bc
--- /dev/null
+++ b/proton-c/bindings/cpp/docs/types.md
@@ -0,0 +1,76 @@
+# AMQP and C++ types {#types_page}
+
+An AMQP message body can hold binary data using any encoding you
+like. AMQP also defines its own encoding and types. The AMQP encoding
+is often used in message bodies because it is supported by AMQP
+libraries on many languages and platforms. You also need to use the
+AMQP types to set and examine message properties.
+
+## Scalar types
+
+Each type is identified by a proton::type_id.
+
+C++ type            | AMQP type_id         | Description
+--------------------|----------------------|-----------------------
+bool                | proton::BOOLEAN      | Boolean true or false
+uint8_t             | proton::UBYTE        | 8-bit unsigned byte
+int8_t              | proton::BYTE         | 8-bit signed byte
+uint16_t            | proton::USHORT       | 16-bit unsigned integer
+int16_t             | proton::SHORT        | 16-bit signed integer
+uint32_t            | proton::UINT         | 32-bit unsigned integer
+int32_t             | proton::INT          | 32-bit signed integer
+uint64_t            | proton::ULONG        | 64-bit unsigned integer
+int64_t             | proton::LONG         | 64-bit signed integer
+wchar_t             | proton::CHAR         | 32-bit unicode code point
+float               | proton::FLOAT        | 32-bit binary floating point
+double              | proton::DOUBLE       | 64-bit binary floating point
+proton::timestamp   | proton::TIMESTAMP    | 64-bit signed milliseconds since 00:00:00 (UTC), 1 January 1970.
+proton::decimal32   | proton::DECIMAL32    | 32-bit decimal floating point
+proton::decimal64   | proton::DECIMAL64    | 64-bit decimal floating point
+proton::decimal128  | proton::DECIMAL128   | 128-bit decimal floating point
+proton::uuid        | proton::UUID         | 128-bit universally-unique identifier
+std::string         | proton::STRING       | UTF-8 encoded unicode string
+proton::symbol      | proton::SYMBOL       | 7-bit ASCII encoded string
+proton::binary      | proton::BINARY       | Variable-length binary data
+
+proton::scalar is a holder that can hold a scalar value of any type.
+
+## Compound types
+
+C++ type            | AMQP type_id         | Description
+--------------------|----------------------|-----------------------
+See below           | proton::ARRAY        | Sequence of values of the same type
+See below           | proton::LIST         | Sequence of values of mixed types
+See below           | proton::MAP          | Map of key-value pairs
+
+proton::value is a holder that can hold any AMQP value, scalar, or
+compound.
+
+proton::ARRAY converts to and from C++ sequences: std::vector,
+std::deque, std::list, and std::forward_list.
+
+proton::LIST converts to and from sequences of proton::value or
+proton::scalar, which can hold mixed types of data.
+
+proton::MAP converts to and from std::map, std::unordered_map, and
+sequences of std::pair.
+
+When decoding, the encoded map types must be convertible to the element type of the
+C++ sequence or the key-value types of the C++ map.  Use proton::value as the
+element or key-value type to decode any ARRAY, LIST, or MAP.
+
+For example you can decode any AMQP MAP into:
+
+    std::map<proton::value, proton::value>
+
+You can decode any AMQP LIST or ARRAY into:
+
+    std::vector<proton::value>
+
+## Include files
+
+You can simply include proton/types.hpp to include all the type definitions and
+conversions. Alternatively, you can selectively include only what you need:
+
+ - Include proton/types_fwd.hpp: forward declarations for all types.
+ - Include individual `.hpp` files as per the table above.

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/amqp.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/amqp.hpp b/proton-c/bindings/cpp/include/proton/amqp.hpp
deleted file mode 100644
index 990bf06..0000000
--- a/proton-c/bindings/cpp/include/proton/amqp.hpp
+++ /dev/null
@@ -1,94 +0,0 @@
-#ifndef PROTON_AMQP_HPP
-#define PROTON_AMQP_HPP
-/*
- * 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/types_fwd.hpp>
-
-#include <string>
-
-namespace proton {
-
-/// AMQP typedefs for C++ types
-///
-/// This namespace contains typedefs to associate AMQP scalar type names with
-/// the corresponding C++ types. These are provided as a convenience for those
-/// familiar with AMQP, you do not need to use them, you can use the C++ types
-/// directly.
-///
-/// The typedef names have a _type suffix to avoid ambiguity with C++ reserved
-/// and std library type names.
-///
-namespace amqp {
-
-///@name Typedefs for AMQP numeric types.
-///@{
-
-/// Boolean true or false.
-typedef bool boolean_type;
-/// 8-bit unsigned byte 
-typedef uint8_t ubyte_type;
-/// 8-bit signed byte
-typedef int8_t byte_type;
-/// 16-bit unsigned short integer
-typedef uint16_t ushort_type;
-/// 16-bit signed short integer
-typedef int16_t short_type;
-/// 32-bit unsigned integer
-typedef uint32_t uint_type;
-/// 32-bit signed integer
-typedef int32_t int_type;
-/// 64-bit unsigned long integer
-typedef uint64_t ulong_type;
-/// 64-bit signed long integer
-typedef int64_t long_type;
-/// 32-bit unicode code point
-typedef wchar_t char_type;
-/// 32-bit binary floating point
-typedef float float_type;
-/// 64-bit binary floating point
-typedef double double_type;
-
-/// An AMQP string is unicode  UTF-8 encoded.
-typedef std::string string_type;
-
-/// An AMQP string is ASCII 7-bit  encoded.
-typedef proton::symbol symbol_type;
-
-/// An AMQP binary contains variable length raw binary data.
-typedef proton::binary binary_type;
-
-/// A timestamp in milliseconds since the epoch 00:00:00 (UTC), 1 January 1970.
-typedef proton::timestamp timestamp_type;
-
-/// A 16-byte universally unique identifier.
-typedef proton::uuid uuid_type;
-
-/// 32 bit decimal floating point
-typedef proton::decimal32 decimal32_type;
-
-/// 64 bit decimal floating point
-typedef proton::decimal64 decimal64_type;
-
-/// 128 bit decimal floating point
-typedef proton::decimal128 decimal128_type;
-
-}}
-
-#endif // PROTON_AMQP_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/annotation_key.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/annotation_key.hpp b/proton-c/bindings/cpp/include/proton/annotation_key.hpp
index 042e95d..e63db3c 100644
--- a/proton-c/bindings/cpp/include/proton/annotation_key.hpp
+++ b/proton-c/bindings/cpp/include/proton/annotation_key.hpp
@@ -1,7 +1,8 @@
-#ifndef ANNOTATION_KEY_HPP
-#define ANNOTATION_KEY_HPP
+#ifndef PROTON_ANNOTATION_KEY_HPP
+#define PROTON_ANNOTATION_KEY_HPP
 
 /*
+ *
  * 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
@@ -18,10 +19,11 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
+ *
  */
 
-#include <proton/scalar_base.hpp>
-#include <proton/symbol.hpp>
+#include "proton/internal/scalar_base.hpp"
+#include "proton/symbol.hpp"
 
 namespace proton {
 
@@ -35,39 +37,48 @@ class annotation_key : public internal::scalar_base {
     /// An empty annotation key has a uint64_t == 0 value.
     annotation_key() { put_(uint64_t(0)); }
 
-    /// Construct from any type that can be assigned
+    /// Construct from any type that can be assigned.
     template <class T> annotation_key(const T& x) { *this = x; }
 
-    ///@name Assign from a uint64_t or symbol.
-    ///@{
+    /// @name Assign from a uint64_t or symbol.
+    /// @{
     annotation_key& operator=(uint64_t x) { put_(x); return *this; }
     annotation_key& operator=(const symbol& x) { put_(x); return *this; }
-    ///@}
-    ///@name Extra conversions for strings, treated as amqp::SYMBOL.
-    ///@{
+    /// @}
+
+    /// @name Extra conversions for strings, treated as codec::SYMBOL.
+    /// @{
     annotation_key& operator=(const std::string& x) { put_(symbol(x)); return *this; }
     annotation_key& operator=(const char *x) { put_(symbol(x)); return *this; }
-    ///@}
+    /// @}
 
-    ///@cond INTERNAL
+    /// @cond INTERNAL
   friend class message;
   friend class codec::decoder;
-    ///@endcond
+    /// @endcond
 };
 
-///@cond internal
+/// @cond INTERNAL
+/// XXX Document this?
 template <class T> T get(const annotation_key& x);
-///@endcond
+/// @endcond
 
-/// Get the uint64_t value or throw conversion_error. @related annotation_key
+/// Get the uint64_t value or throw conversion_error.
+///    
+/// @related annotation_key
 template<> inline uint64_t get<uint64_t>(const annotation_key& x) { return internal::get<uint64_t>(x); }
-/// Get the @ref symbol value or throw conversion_error. @related annotation_key
+
+/// Get the @ref symbol value or throw conversion_error.
+///
+/// @related annotation_key
 template<> inline symbol get<symbol>(const annotation_key& x) { return internal::get<symbol>(x); }
-/// Get the @ref binary value or throw conversion_error. @related annotation_key
 
+/// Get the @ref binary value or throw conversion_error.
+///    
 /// @copydoc scalar::coerce
 /// @related annotation_key
 template<class T> T coerce(const annotation_key& x) { return internal::coerce<T>(x); }
-}
 
-#endif // ANNOTATION_KEY_HPP
+} // proton
+
+#endif // PROTON_ANNOTATION_KEY_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/binary.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/binary.hpp b/proton-c/bindings/cpp/include/proton/binary.hpp
index a72ac75..40969f4 100644
--- a/proton-c/bindings/cpp/include/proton/binary.hpp
+++ b/proton-c/bindings/cpp/include/proton/binary.hpp
@@ -1,6 +1,8 @@
-#ifndef BINARY_HPP
-#define BINARY_HPP
+#ifndef PROTON_BINARY_HPP
+#define PROTON_BINARY_HPP
+
 /*
+ *
  * 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
@@ -17,10 +19,11 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
+ *
  */
 
-#include <proton/export.hpp>
-#include <proton/types_fwd.hpp>
+#include "proton/export.hpp"
+#include "proton/types_fwd.hpp"
 
 #include <iosfwd>
 #include <vector>
@@ -30,13 +33,14 @@ namespace proton {
 /// Arbitrary binary data.
 class binary : public std::vector<uint8_t> {
   public:
-    ///@name Constructors @{
+    /// @name Constructors
+    /// @{
     explicit binary() : std::vector<value_type>() {}
     explicit binary(size_t n) : std::vector<value_type>(n) {}
     explicit binary(size_t n, value_type x) : std::vector<value_type>(n, x) {}
     explicit binary(const std::string& s) : std::vector<value_type>(s.begin(), s.end()) {}
     template <class Iter> binary(Iter first, Iter last) : std::vector<value_type>(first, last) {}
-    ///@}
+    /// @}
 
     /// Convert to std::string
     operator std::string() const { return std::string(begin(), end()); }
@@ -45,9 +49,9 @@ class binary : public std::vector<uint8_t> {
     binary& operator=(const std::string& x) { assign(x.begin(), x.end()); return *this; }
 };
 
-/// Print binary value
+/// Print a binary value
 PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const binary&);
 
-}
+} // proton
 
-#endif // BINARY_HPP
+#endif // PROTON_BINARY_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/byte_array.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/byte_array.hpp b/proton-c/bindings/cpp/include/proton/byte_array.hpp
index e5c5dbf..2fd638d 100644
--- a/proton-c/bindings/cpp/include/proton/byte_array.hpp
+++ b/proton-c/bindings/cpp/include/proton/byte_array.hpp
@@ -1,5 +1,6 @@
-#ifndef BYTE_ARRAY_HPP
-#define BYTE_ARRAY_HPP
+#ifndef PROTON_BYTE_ARRAY_HPP
+#define PROTON_BYTE_ARRAY_HPP
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -20,23 +21,26 @@
  */
 
 #include "proton/export.hpp"
-#include <proton/types_fwd.hpp>
-#include <proton/comparable.hpp>
+#include "proton/internal/comparable.hpp"
+#include "proton/types_fwd.hpp"
 
 #include <algorithm>
 #include <iterator>
 
 namespace proton {
+
 namespace internal {
 PN_CPP_EXTERN void print_hex(std::ostream& o, const uint8_t* p, size_t n);
 }
 
-/// Used to represent fixed-sized data types that don't have a natural C++ representation
-/// as an array of bytes.
+/// Arbitrary fixed-size data.
+///    
+/// Used to represent fixed-sized data types that don't have a natural
+/// C++ representation as an array of bytes.
 template <size_t N> class byte_array : private internal::comparable<byte_array<N> > {
   public:
-    ///@name Sequence container typedefs
-    ///@{
+    /// @name Sequence container typedefs
+    /// @{
     typedef uint8_t                                   value_type;
     typedef value_type*			              pointer;
     typedef const value_type*                         const_pointer;
@@ -48,16 +52,16 @@ template <size_t N> class byte_array : private internal::comparable<byte_array<N
     typedef std::ptrdiff_t                   	      difference_type;
     typedef std::reverse_iterator<iterator>	      reverse_iterator;
     typedef std::reverse_iterator<const_iterator>     const_reverse_iterator;
-    ///@}
+    /// @}
 
-    /// 0-initialized byte array
+    /// Zero-initialized byte array
     byte_array() { std::fill(bytes_, bytes_+N, '\0'); }
 
     /// Size of the array
     static size_t size() { return N; }
 
-    ///@name Array operators
-    ///@{
+    /// @name Array operators
+    /// @{
     value_type* begin() { return bytes_; }
     value_type* end() { return bytes_+N; }
     value_type& operator[](size_t i) { return bytes_[i]; }
@@ -65,10 +69,10 @@ template <size_t N> class byte_array : private internal::comparable<byte_array<N
     const value_type* begin() const { return bytes_; }
     const value_type* end() const { return bytes_+N; }
     const value_type& operator[](size_t i) const { return bytes_[i]; }
-    ///@}
+    /// @}
 
-    ///@name Comparison operators
-    ///@{
+    /// @name Comparison operators
+    /// @{
   friend bool operator==(const byte_array& x, const byte_array& y) {
       return std::equal(x.begin(), x.end(), y.begin());
   }
@@ -76,9 +80,9 @@ template <size_t N> class byte_array : private internal::comparable<byte_array<N
   friend bool operator<(const byte_array& x, const byte_array& y) {
       return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
   }
-    ///@}
+    /// @}
 
-    /// Print byte array in hex.
+    /// Print byte array in hex
   friend std::ostream& operator<<(std::ostream& o, const byte_array& b) {
       internal::print_hex(o, b.begin(), b.size());
       return o;
@@ -88,6 +92,6 @@ template <size_t N> class byte_array : private internal::comparable<byte_array<N
     value_type bytes_[N];
 };
 
-}
+} // proton
 
-#endif // BYTE_ARRAY_HPP
+#endif // PROTON_BYTE_ARRAY_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/codec/amqp_types.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/codec/amqp_types.hpp b/proton-c/bindings/cpp/include/proton/codec/amqp_types.hpp
new file mode 100644
index 0000000..b245690
--- /dev/null
+++ b/proton-c/bindings/cpp/include/proton/codec/amqp_types.hpp
@@ -0,0 +1,106 @@
+#ifndef PROTON_CODEC_AMQP_TYPES_HPP
+#define PROTON_CODEC_AMQP_TYPES_HPP
+
+/*
+ *
+ * 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.
+ *
+ */
+
+namespace proton {
+namespace codec {
+
+/// @name Experimental - Typedefs for AMQP scalar types.
+///
+/// These typedefs associate AMQP scalar type names with the
+/// corresponding C++ types. They are provided as a convenience for
+/// those familiar with AMQP, but you do not need to use them.  You
+/// can use the C++ types directly.
+///
+/// The typedef names have a `_type` suffix to avoid ambiguity with
+/// C++ reserved and std library type names.
+///    
+/// @{
+
+// XXX Consider prefixing these with amqp_ and dropping _type, now
+// that they're in the codec namespace
+    
+/// True or false.
+typedef bool boolean_type;
+
+/// 8-bit unsigned byte 
+typedef uint8_t ubyte_type;
+
+/// 8-bit signed byte
+typedef int8_t byte_type;
+
+/// 16-bit unsigned short integer
+typedef uint16_t ushort_type;
+
+/// 16-bit signed short integer
+typedef int16_t short_type;
+
+/// 32-bit unsigned integer
+typedef uint32_t uint_type;
+
+/// 32-bit signed integer
+typedef int32_t int_type;
+
+/// 64-bit unsigned long integer
+typedef uint64_t ulong_type;
+
+/// 64-bit signed long integer
+typedef int64_t long_type;
+
+/// 32-bit unicode code point
+typedef wchar_t char_type;
+
+/// 32-bit binary floating point
+typedef float float_type;
+
+/// 64-bit binary floating point
+typedef double double_type;
+
+/// An AMQP string is unicode UTF-8 encoded.
+typedef std::string string_type;
+
+/// An AMQP symbol is ASCII 7-bit encoded.
+typedef proton::symbol symbol_type;
+
+/// An AMQP binary contains variable length raw binary data.
+typedef proton::binary binary_type;
+
+/// A timestamp in milliseconds since the epoch 00:00:00 (UTC), 1 January 1970.
+typedef proton::timestamp timestamp_type;
+
+/// A 16-byte universally unique identifier.
+typedef proton::uuid uuid_type;
+
+/// 32-bit decimal floating point
+typedef proton::decimal32 decimal32_type;
+
+/// 64-bit decimal floating point
+typedef proton::decimal64 decimal64_type;
+
+/// 128-bit decimal floating point
+typedef proton::decimal128 decimal128_type;
+
+} // codec
+} // proton
+
+#endif // PROTON_CODEC_AMQP_TYPES_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/codec/decoder.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/codec/decoder.hpp b/proton-c/bindings/cpp/include/proton/codec/decoder.hpp
new file mode 100644
index 0000000..7904982
--- /dev/null
+++ b/proton-c/bindings/cpp/include/proton/codec/decoder.hpp
@@ -0,0 +1,211 @@
+#ifndef PROTON_CODEC_DECODER_HPP
+#define PROTON_CODEC_DECODER_HPP
+
+/*
+ *
+ * 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/data.hpp"
+#include "proton/internal/type_traits.hpp"
+#include "proton/types_fwd.hpp"
+
+#include <utility>
+
+namespace proton {
+
+class annotation_key;
+class message_id;
+class scalar;
+class value;
+
+namespace internal {
+class value_base;
+}
+
+namespace codec {
+
+/// **Experimental** - Stream-like decoder from AMQP bytes to C++
+/// values.
+///
+/// For internal use only.
+///
+/// @see @ref types_page for the recommended ways to manage AMQP data
+class decoder : public data {
+  public:
+    /// Wrap a Proton C data object.  The exact flag if set means
+    /// decode only when there is an exact match between the AMQP and
+    /// C++ type. If not set then perform automatic conversions.
+    explicit decoder(const data& d, bool exact=false) : data(d), exact_(exact) {}
+
+    /// Attach decoder to a proton::value. The decoder is rewound to
+    /// the start of the data.
+    PN_CPP_EXTERN explicit decoder(const internal::value_base&, bool exact=false);
+
+    /// Decode AMQP data from a buffer and add it to the end of the
+    /// decoders stream.
+    PN_CPP_EXTERN void decode(const char* buffer, size_t size);
+
+    /// Decode AMQP data from a std::string and add it to the end of
+    /// the decoders stream.
+    PN_CPP_EXTERN void decode(const std::string&);
+
+    /// Return true if there are more value to extract at the current level.
+    PN_CPP_EXTERN bool more();
+
+    /// Get the type of the next value that will be read by
+    /// operator>>.
+    ///
+    /// @throw conversion_error if no more values. @see
+    /// decoder::more().
+    PN_CPP_EXTERN type_id next_type();
+
+    /// @name Extract built-in types
+    ///
+    /// @throw conversion_error if the decoder is empty or has an
+    /// incompatible type.
+    ///
+    /// @{
+    PN_CPP_EXTERN decoder& operator>>(bool&);
+    PN_CPP_EXTERN decoder& operator>>(uint8_t&);
+    PN_CPP_EXTERN decoder& operator>>(int8_t&);
+    PN_CPP_EXTERN decoder& operator>>(uint16_t&);
+    PN_CPP_EXTERN decoder& operator>>(int16_t&);
+    PN_CPP_EXTERN decoder& operator>>(uint32_t&);
+    PN_CPP_EXTERN decoder& operator>>(int32_t&);
+    PN_CPP_EXTERN decoder& operator>>(wchar_t&);
+    PN_CPP_EXTERN decoder& operator>>(uint64_t&);
+    PN_CPP_EXTERN decoder& operator>>(int64_t&);
+    PN_CPP_EXTERN decoder& operator>>(timestamp&);
+    PN_CPP_EXTERN decoder& operator>>(float&);
+    PN_CPP_EXTERN decoder& operator>>(double&);
+    PN_CPP_EXTERN decoder& operator>>(decimal32&);
+    PN_CPP_EXTERN decoder& operator>>(decimal64&);
+    PN_CPP_EXTERN decoder& operator>>(decimal128&);
+    PN_CPP_EXTERN decoder& operator>>(uuid&);
+    PN_CPP_EXTERN decoder& operator>>(std::string&);
+    PN_CPP_EXTERN decoder& operator>>(symbol&);
+    PN_CPP_EXTERN decoder& operator>>(binary&);
+    PN_CPP_EXTERN decoder& operator>>(message_id&);
+    PN_CPP_EXTERN decoder& operator>>(annotation_key&);
+    PN_CPP_EXTERN decoder& operator>>(scalar&);
+    PN_CPP_EXTERN decoder& operator>>(internal::value_base&);
+    PN_CPP_EXTERN decoder& operator>>(null&);
+    ///@}
+
+    /// Start decoding a container type, such as an ARRAY, LIST or
+    /// MAP.  This "enters" the container, more() will return false at
+    /// the end of the container.  Call finish() to "exit" the
+    /// container and move on to the next value.
+    PN_CPP_EXTERN decoder& operator>>(start&);
+
+    /// Finish decoding a container type, and move on to the next
+    /// value in the stream.
+    PN_CPP_EXTERN decoder& operator>>(const finish&);
+
+    /// @cond INTERNAL
+    template <class T> struct sequence_ref { T& ref; sequence_ref(T& r) : ref(r) {} };
+    template <class T> struct associative_ref { T& ref; associative_ref(T& r) : ref(r) {} };
+    template <class T> struct pair_sequence_ref { T& ref;  pair_sequence_ref(T& r) : ref(r) {} };
+
+    template <class T> static sequence_ref<T> sequence(T& x) { return sequence_ref<T>(x); }
+    template <class T> static associative_ref<T> associative(T& x) { return associative_ref<T>(x); }
+    template <class T> static pair_sequence_ref<T> pair_sequence(T& x) { return pair_sequence_ref<T>(x); }
+    /// @endcond
+
+    /// Extract any AMQP sequence (ARRAY, LIST or MAP) to a C++
+    /// sequence container of T if the elements types are convertible
+    /// to T. A MAP is extracted as `[key1, value1, key2, value2...]`.
+    template <class T> decoder& operator>>(sequence_ref<T> r)  {
+        start s;
+        *this >> s;
+        if (s.is_described) next();
+        r.ref.resize(s.size);
+        for (typename T::iterator i = r.ref.begin(); i != r.ref.end(); ++i)
+            *this >> *i;
+        return *this;
+    }
+
+    /// Extract an AMQP MAP to a C++ associative container
+    template <class T> decoder& operator>>(associative_ref<T> r)  {
+        using namespace internal;
+        start s;
+        *this >> s;
+        assert_type_equal(MAP, s.type);
+        r.ref.clear();
+        for (size_t i = 0; i < s.size/2; ++i) {
+            typename remove_const<typename T::key_type>::type k;
+            typename remove_const<typename T::mapped_type>::type v;
+            *this >> k >> v;
+            r.ref[k] = v;
+        }
+        return *this;
+    }
+
+    /// Extract an AMQP MAP to a C++ push_back sequence of pairs
+    /// preserving encoded order.
+    template <class T> decoder& operator>>(pair_sequence_ref<T> r)  {
+        using namespace internal;
+        start s;
+        *this >> s;
+        assert_type_equal(MAP, s.type);
+        r.ref.clear();
+        for (size_t i = 0; i < s.size/2; ++i) {
+            typedef typename T::value_type value_type;
+            typename remove_const<typename value_type::first_type>::type k;
+            typename remove_const<typename value_type::second_type>::type v;
+            *this >> k >> v;
+            r.ref.push_back(value_type(k, v));
+        }
+        return *this;
+    }
+
+  private:
+    type_id pre_get();
+    template <class T, class U> decoder& extract(T& x, U (*get)(pn_data_t*));
+    bool exact_;
+
+  friend class message;
+};
+
+/// @cond INTERNAL
+/// XXX Document this
+template<class T> T get(decoder& d) {
+    assert_type_equal(internal::type_id_of<T>::value, d.next_type());
+    T x;
+    d >> x;
+    return x;
+}
+/// @endcond
+
+/// operator>> for integer types that are not covered by the standard
+/// overrides.
+template <class T> typename internal::enable_if<internal::is_unknown_integer<T>::value, decoder&>::type
+operator>>(decoder& d, T& i)  {
+    using namespace internal;
+    typename integer_type<sizeof(T), is_signed<T>::value>::type v;
+    d >> v;                     // Extract as a known integer type
+    i = v;                      // C++ conversion to the target type.
+    return d;
+}
+
+} // codec
+} // proton
+
+#endif // PROTON_CODEC_DECODER_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/codec/deque.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/codec/deque.hpp b/proton-c/bindings/cpp/include/proton/codec/deque.hpp
new file mode 100644
index 0000000..2b64b0d
--- /dev/null
+++ b/proton-c/bindings/cpp/include/proton/codec/deque.hpp
@@ -0,0 +1,60 @@
+#ifndef PROTON_CODEC_DEQUE_HPP
+#define PROTON_CODEC_DEQUE_HPP
+
+/*
+ * 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/codec/encoder.hpp"
+#include "proton/codec/decoder.hpp"
+
+#include <deque>
+#include <utility>
+
+namespace proton {
+namespace codec {
+
+/// std::deque<T> for most T is encoded as an amqp::ARRAY (same type elements)
+template <class T, class A>
+encoder& operator<<(encoder& e, const std::deque<T, A>& x) {
+    return e << encoder::array(x, internal::type_id_of<T>::value);
+}
+
+/// std::deque<value> encodes as codec::list_type (mixed type elements)
+template <class A>
+encoder& operator<<(encoder& e, const std::deque<value, A>& x) { return e << encoder::list(x); }
+
+/// std::deque<scalar> encodes as codec::list_type (mixed type elements)
+template <class A>
+encoder& operator<<(encoder& e, const std::deque<scalar, A>& x) { return e << encoder::list(x); }
+
+/// std::deque<std::pair<k,t> > encodes as codec::map_type.
+/// Map entries are encoded in order they appear in the list.
+template <class A, class K, class T>
+encoder& operator<<(encoder& e, const std::deque<std::pair<K,T>, A>& x) { return e << encoder::map(x); }
+
+/// Decode to std::deque<T> from an amqp::LIST or amqp::ARRAY.
+template <class T, class A> decoder& operator>>(decoder& d, std::deque<T, A>& x) { return d >> decoder::sequence(x); }
+
+/// Decode to std::deque<std::pair<K, T> from an amqp::MAP.
+template <class A, class K, class T> decoder& operator>>(decoder& d, std::deque<std::pair<K, T> , A>& x) { return d >> decoder::pair_sequence(x); }
+
+} // codec
+} // proton
+
+#endif // PROTON_CODEC_DEQUE_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/codec/encoder.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/codec/encoder.hpp b/proton-c/bindings/cpp/include/proton/codec/encoder.hpp
new file mode 100644
index 0000000..e174c73
--- /dev/null
+++ b/proton-c/bindings/cpp/include/proton/codec/encoder.hpp
@@ -0,0 +1,199 @@
+#ifndef PROTON_CODEC_ENCODER_HPP
+#define PROTON_CODEC_ENCODER_HPP
+
+/*
+ *
+ * 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/data.hpp"
+#include "proton/internal/type_traits.hpp"
+#include "proton/types_fwd.hpp"
+
+namespace proton {
+
+namespace internal{
+class scalar_base;
+class value_base;
+}
+
+namespace codec {
+
+/// **Experimental** - Stream-like encoder from AMQP bytes to C++
+/// values.
+///
+/// For internal use only.
+///
+/// @see @ref types_page for the recommended ways to manage AMQP data
+class encoder : public data {
+  public:
+    /// Wrap Proton-C data object.
+    explicit encoder(const data& d) : data(d) {}
+
+    /// Encoder into v. Clears any current value in v.
+    PN_CPP_EXTERN explicit encoder(internal::value_base& v);
+
+    /// Encode the current values into buffer and update size to reflect the
+    /// number of bytes encoded.
+    ///
+    /// Clears the encoder.
+    ///
+    /// @return if buffer == 0 or size is too small, then return false
+    /// and size to the required size.  Otherwise, return true and set
+    /// size to the number of bytes encoded.
+    PN_CPP_EXTERN bool encode(char* buffer, size_t& size);
+
+    /// Encode the current values into a std::string and resize the
+    /// string if necessary. Clears the encoder.
+    PN_CPP_EXTERN void encode(std::string&);
+
+    /// Encode the current values into a std::string. Clears the
+    /// encoder.
+    PN_CPP_EXTERN std::string encode();
+
+    /// @name Insert built-in types
+    /// @{
+    PN_CPP_EXTERN encoder& operator<<(bool);
+    PN_CPP_EXTERN encoder& operator<<(uint8_t);
+    PN_CPP_EXTERN encoder& operator<<(int8_t);
+    PN_CPP_EXTERN encoder& operator<<(uint16_t);
+    PN_CPP_EXTERN encoder& operator<<(int16_t);
+    PN_CPP_EXTERN encoder& operator<<(uint32_t);
+    PN_CPP_EXTERN encoder& operator<<(int32_t);
+    PN_CPP_EXTERN encoder& operator<<(wchar_t);
+    PN_CPP_EXTERN encoder& operator<<(uint64_t);
+    PN_CPP_EXTERN encoder& operator<<(int64_t);
+    PN_CPP_EXTERN encoder& operator<<(timestamp);
+    PN_CPP_EXTERN encoder& operator<<(float);
+    PN_CPP_EXTERN encoder& operator<<(double);
+    PN_CPP_EXTERN encoder& operator<<(decimal32);
+    PN_CPP_EXTERN encoder& operator<<(decimal64);
+    PN_CPP_EXTERN encoder& operator<<(decimal128);
+    PN_CPP_EXTERN encoder& operator<<(const uuid&);
+    PN_CPP_EXTERN encoder& operator<<(const std::string&);
+    PN_CPP_EXTERN encoder& operator<<(const symbol&);
+    PN_CPP_EXTERN encoder& operator<<(const binary&);
+    PN_CPP_EXTERN encoder& operator<<(const internal::scalar_base&);
+    PN_CPP_EXTERN encoder& operator<<(const null&);
+    /// @}
+
+    /// Insert a proton::value.
+    ///
+    /// @internal NOTE insert value_base, not value to avoid recursive
+    /// implicit conversions.
+    PN_CPP_EXTERN encoder& operator<<(const internal::value_base&);
+
+    /// Start a complex type
+    PN_CPP_EXTERN encoder& operator<<(const start&);
+
+    /// Finish a complex type
+    PN_CPP_EXTERN encoder& operator<<(const finish&);
+
+    /// @cond INTERNAL
+
+    // Undefined template to  prevent pointers being implicitly converted to bool.
+    template <class T> void* operator<<(const T*);
+
+    template <class T> struct list_cref { T& ref; list_cref(T& r) : ref(r) {} };
+    template <class T> struct map_cref { T& ref;  map_cref(T& r) : ref(r) {} };
+
+    template <class T> struct array_cref {
+        start array_start;
+        T& ref;
+        array_cref(T& r, type_id el, bool described) : array_start(ARRAY, el, described), ref(r) {}
+    };
+
+    template <class T> static list_cref<T> list(T& x) { return list_cref<T>(x); }
+    template <class T> static map_cref<T> map(T& x) { return map_cref<T>(x); }
+    template <class T> static array_cref<T> array(T& x, type_id element, bool described=false) {
+        return array_cref<T>(x, element, described);
+    }
+
+    template <class T> encoder& operator<<(const map_cref<T>& x) {
+        state_guard sg(*this);
+        *this << start::map();
+        for (typename T::const_iterator i = x.ref.begin(); i != x.ref.end(); ++i)
+            *this << i->first << i->second;
+        *this << finish();
+        return *this;
+    }
+
+    template <class T> encoder& operator<<(const list_cref<T>& x) {
+        state_guard sg(*this);
+        *this << start::list();
+        for (typename T::const_iterator i = x.ref.begin(); i != x.ref.end(); ++i)
+            *this << *i;
+        *this << finish();
+        return *this;
+    }
+
+    template <class T> encoder& operator<<(const array_cref<T>& x) {
+        state_guard sg(*this);
+        *this << x.array_start;
+        for (typename T::const_iterator i = x.ref.begin(); i != x.ref.end(); ++i)
+            *this << *i;
+        *this << finish();
+        return *this;
+    }
+    /// @endcond
+
+  private:
+    template<class T, class U> encoder& insert(const T& x, int (*put)(pn_data_t*, U));
+    void check(long result);
+};
+
+/// Treat char* as string
+inline encoder& operator<<(encoder& e, const char* s) { return e << std::string(s); }
+
+/// operator << for integer types that are not covered by the standard overrides.
+template <class T> typename internal::enable_if<internal::is_unknown_integer<T>::value, encoder&>::type
+operator<<(encoder& e, T i)  {
+    using namespace internal;
+    return e << static_cast<typename integer_type<sizeof(T), is_signed<T>::value>::type>(i);
+}
+
+/// @cond INTERNAL
+    
+namespace is_encodable_impl {   // Protected the world from wildcard operator<<
+
+using namespace internal;
+
+sfinae::no operator<<(sfinae::wildcard, sfinae::wildcard); // Fallback
+
+template<typename T> struct is_encodable : public sfinae {
+    static yes test(encoder);
+    static no test(...);         // Failed test, no match.
+    static encoder &e;
+    static const T& t;
+    static bool const value = sizeof(test(e << t)) == sizeof(yes);
+};
+
+// Avoid recursion
+template <> struct is_encodable<value> : public true_type {};
+
+} // is_encodable_impl
+
+using is_encodable_impl::is_encodable;
+
+/// @endcond
+
+} // codec
+} // proton
+
+#endif /// PROTON_CODEC_ENCODER_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/codec/forward_list.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/codec/forward_list.hpp b/proton-c/bindings/cpp/include/proton/codec/forward_list.hpp
new file mode 100644
index 0000000..2096ba9
--- /dev/null
+++ b/proton-c/bindings/cpp/include/proton/codec/forward_list.hpp
@@ -0,0 +1,60 @@
+#ifndef PROTON_CODEC_FORWARD_LIST_HPP
+#define PROTON_CODEC_FORWARD_LIST_HPP
+
+/*
+ * 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/codec/encoder.hpp"
+#include "proton/codec/decoder.hpp"
+
+#include <forward_list>
+#include <utility>
+
+namespace proton {
+namespace codec {
+
+/// std::forward_list<T> for most T is encoded as an AMQP array.
+template <class T, class A>
+encoder& operator<<(encoder& e, const std::forward_list<T, A>& x) {
+    return e << encoder::array(x, internal::type_id_of<T>::value);
+}
+
+/// Specialize for std::forward_list<value>, encode as AMQP forward_list (variable type)
+template <class A>
+encoder& operator<<(encoder& e, const std::forward_list<value, A>& x) { return e << encoder::list(x); }
+
+/// Specialize for std::forward_list<scalar>, encode as AMQP list (variable type)
+template <class A>
+encoder& operator<<(encoder& e, const std::forward_list<scalar, A>& x) { return e << encoder::list(x); }
+
+/// Specialize for std::forward_list<std::pair<k,t> >, encode as AMQP map.
+/// Allows control over the order of encoding map entries.
+template <class A, class K, class T>
+encoder& operator<<(encoder& e, const std::forward_list<std::pair<K,T>, A>& x) { return e << encoder::map(x); }
+
+/// Decode to std::forward_list<T> from an amqp::LIST or amqp::ARRAY.
+template <class T, class A> decoder& operator>>(decoder& d, std::forward_list<T, A>& x) { return d >> decoder::sequence(x); }
+
+/// Decode to std::forward_list<std::pair<K, T> from an amqp::MAP.
+template <class A, class K, class T> decoder& operator>>(decoder& d, std::forward_list<std::pair<K, T> , A>& x) { return d >> decoder::pair_sequence(x); }
+
+} // codec
+} // proton
+
+#endif // PROTON_CODEC_FORWARD_LIST_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/codec/list.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/codec/list.hpp b/proton-c/bindings/cpp/include/proton/codec/list.hpp
new file mode 100644
index 0000000..40d2e7a
--- /dev/null
+++ b/proton-c/bindings/cpp/include/proton/codec/list.hpp
@@ -0,0 +1,62 @@
+#ifndef PROTON_CODEC_LIST_HPP
+#define PROTON_CODEC_LIST_HPP
+
+/*
+ *
+ * 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/codec/encoder.hpp"
+#include "proton/codec/decoder.hpp"
+
+#include <list>
+#include <utility>
+
+namespace proton {
+namespace codec {
+
+/// std::list<T> for most T is encoded as an AMQP array.
+template <class T, class A>
+encoder& operator<<(encoder& e, const std::list<T, A>& x) {
+    return e << encoder::array(x, internal::type_id_of<T>::value);
+}
+
+/// Specialize for std::list<value>, encode as AMQP list (variable type)
+template <class A>
+encoder& operator<<(encoder& e, const std::list<value, A>& x) { return e << encoder::list(x); }
+
+/// Specialize for std::list<scalar>, encode as AMQP list (variable type)
+template <class A>
+encoder& operator<<(encoder& e, const std::list<scalar, A>& x) { return e << encoder::list(x); }
+
+/// Specialize for std::list<std::pair<k,t> >, encode as AMQP map.
+/// Allows control over the order of encoding map entries.
+template <class A, class K, class T>
+encoder& operator<<(encoder& e, const std::list<std::pair<K,T>, A>& x) { return e << encoder::map(x); }
+
+/// Decode to std::list<T> from an amqp::LIST or amqp::ARRAY.
+template <class T, class A> decoder& operator>>(decoder& d, std::list<T, A>& x) { return d >> decoder::sequence(x); }
+
+/// Decode to std::list<std::pair<K, T> from an amqp::MAP.
+template <class A, class K, class T> decoder& operator>>(decoder& d, std::list<std::pair<K, T> , A>& x) { return d >> decoder::pair_sequence(x); }
+
+} // codec
+} // proton
+
+#endif // PROTON_CODEC_LIST_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/codec/map.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/codec/map.hpp b/proton-c/bindings/cpp/include/proton/codec/map.hpp
new file mode 100644
index 0000000..c9287c0
--- /dev/null
+++ b/proton-c/bindings/cpp/include/proton/codec/map.hpp
@@ -0,0 +1,44 @@
+#ifndef PROTON_CODEC_MAP_HPP
+#define PROTON_CODEC_MAP_HPP
+
+/*
+ *
+ * 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/codec/encoder.hpp"
+#include "proton/codec/decoder.hpp"
+
+#include <map>
+
+namespace proton {
+namespace codec {
+
+/// Encode std::map<K, T> as amqp::MAP.
+template <class K, class T, class C, class A>
+encoder& operator<<(encoder& e, const std::map<K, T, C, A>& m) { return e << encoder::map(m); }
+
+/// Decode to std::map<K, T> from amqp::MAP.
+template <class K, class T, class C, class A>
+decoder& operator>>(decoder& d, std::map<K, T, C, A>& m) { return d >> decoder::associative(m); }
+
+} // codec
+} // proton
+
+#endif // PROTON_CODEC_MAP_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/codec/unordered_map.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/codec/unordered_map.hpp b/proton-c/bindings/cpp/include/proton/codec/unordered_map.hpp
new file mode 100644
index 0000000..9be856f
--- /dev/null
+++ b/proton-c/bindings/cpp/include/proton/codec/unordered_map.hpp
@@ -0,0 +1,44 @@
+#ifndef PROTON_CODEC_UNORDERED_MAP_HPP
+#define PROTON_CODEC_UNORDERED_MAP_HPP
+
+/*
+ *
+ * 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/codec/encoder.hpp"
+#include "proton/codec/decoder.hpp"
+
+#include <unordered_map>
+
+namespace proton {
+namespace codec {
+
+/// Encode std::unordered_map<K, T> as amqp::UNORDERED_MAP.
+template <class K, class T, class C, class A>
+encoder& operator<<(encoder& e, const std::unordered_map<K, T, C, A>& m) { return e << encoder::map(m); }
+
+/// Decode to std::unordered_map<K, T> from amqp::UNORDERED_MAP.
+template <class K, class T, class C, class A>
+decoder& operator>>(decoder& d, std::unordered_map<K, T, C, A>& m) { return d >> decoder::associative(m); }
+
+} // codec
+} // proton
+
+#endif // PROTON_CODEC_UNORDERED_MAP_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/codec/vector.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/codec/vector.hpp b/proton-c/bindings/cpp/include/proton/codec/vector.hpp
new file mode 100644
index 0000000..0808229
--- /dev/null
+++ b/proton-c/bindings/cpp/include/proton/codec/vector.hpp
@@ -0,0 +1,58 @@
+#ifndef PROTON_CODEC_VECTOR_HPP
+#define PROTON_CODEC_VECTOR_HPP
+
+/*
+ *
+ * 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/codec/encoder.hpp"
+#include "proton/codec/decoder.hpp"
+
+#include <vector>
+#include <utility>
+
+namespace proton {
+namespace codec {
+
+/// Encode std::vector<T> as amqp::ARRAY (same type elements)
+template <class T, class A> encoder& operator<<(encoder& e, const std::vector<T, A>& x) {
+    return e << encoder::array(x, internal::type_id_of<T>::value);
+}
+
+/// Encode std::vector<value> encode as amqp::LIST (mixed type elements)
+template <class A> encoder& operator<<(encoder& e, const std::vector<value, A>& x) { return e << encoder::list(x); }
+
+/// Encode std::vector<scalar> as amqp::LIST (mixed type elements)
+template <class A> encoder& operator<<(encoder& e, const std::vector<scalar, A>& x) { return e << encoder::list(x); }
+
+/// Encode std::deque<std::pair<k,t> > as amqp::MAP, preserves order of entries.
+template <class A, class K, class T>
+encoder& operator<<(encoder& e, const std::vector<std::pair<K,T>, A>& x) { return e << encoder::map(x); }
+
+/// Decode to std::vector<T> from an amqp::LIST or amqp::ARRAY.
+template <class T, class A> decoder& operator>>(decoder& d, std::vector<T, A>& x) { return d >> decoder::sequence(x); }
+
+/// Decode to std::vector<std::pair<K, T> from an amqp::MAP.
+template <class A, class K, class T> decoder& operator>>(decoder& d, std::vector<std::pair<K, T> , A>& x) { return d >> decoder::pair_sequence(x); }
+
+} // codec
+} // proton
+
+#endif // PROTON_CODEC_VECTOR_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/comparable.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/comparable.hpp b/proton-c/bindings/cpp/include/proton/comparable.hpp
deleted file mode 100644
index 72bcbb4..0000000
--- a/proton-c/bindings/cpp/include/proton/comparable.hpp
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef COMPARABLE_HPP
-#define COMPARABLE_HPP
-
-/*
- * 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.
- */
-
-namespace proton {
-namespace internal {
-
-///@cond INTERNAL
-
-/// Base class for comparable types with operator< and
-/// operator==. Provides remaining operators.
-template <class T> class comparable {
-    friend bool operator>(const T &a, const T &b) { return b < a; }
-    friend bool operator<=(const T &a, const T &b) { return !(a > b); }
-    friend bool operator>=(const T &a, const T &b) { return !(a < b); }
-    friend bool operator!=(const T &a, const T &b) { return !(a == b); }
-};
-
-///@endcond
-
-}}
-
-#endif // COMPARABLE_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/config.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/config.hpp b/proton-c/bindings/cpp/include/proton/config.hpp
index f6b10d6..2e085d0 100644
--- a/proton-c/bindings/cpp/include/proton/config.hpp
+++ b/proton-c/bindings/cpp/include/proton/config.hpp
@@ -1,7 +1,8 @@
-#ifndef CONFIG_HPP
-#define CONFIG_HPP
+#ifndef PROTON_CONFIG_HPP
+#define PROTON_CONFIG_HPP
 
 /*
+ *
  * 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
@@ -18,6 +19,7 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
+ *
  */
 
 /// @cond INTERNAL
@@ -77,6 +79,6 @@
 #define PN_CPP_HAS_DELETED_FUNCTIONS PN_CPP_HAS_CPP11
 #endif
 
-#endif // CONFIG_HPP
+#endif // PROTON_CONFIG_HPP
 
 /// @endcond

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/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 1851625..bfe4000 100644
--- a/proton-c/bindings/cpp/include/proton/connection.hpp
+++ b/proton-c/bindings/cpp/include/proton/connection.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_CONNECTION_H
-#define PROTON_CPP_CONNECTION_H
+#ifndef PROTON_CONNECTION_HPP
+#define PROTON_CONNECTION_HPP
 
 /*
  *
@@ -24,8 +24,9 @@
 
 #include "proton/export.hpp"
 #include "proton/endpoint.hpp"
-#include "proton/object.hpp"
+#include "proton/internal/object.hpp"
 #include "proton/session.hpp"
+
 #include "proton/types.h"
 
 #include <string>
@@ -51,9 +52,9 @@ PN_CPP_CLASS_EXTERN connection : public internal::object<pn_connection_t>, publi
     /// @endcond
 
   public:
+    /// Create an empty connection.
     connection() : internal::object<pn_connection_t>(0) {}
 
-    /// Get the state of this connection.
     PN_CPP_EXTERN bool uninitialized() const;
     PN_CPP_EXTERN bool active() const;
     PN_CPP_EXTERN bool closed() const;
@@ -69,27 +70,27 @@ PN_CPP_CLASS_EXTERN connection : public internal::object<pn_connection_t>, publi
     /// Get the transport for the connection.
     PN_CPP_EXTERN class transport transport() const;
 
-    /// Return the AMQP host name for the connection.
+    /// Return the AMQP hostname attribute for the connection.
     PN_CPP_EXTERN std::string virtual_host() const;
 
     /// Return the container ID for the connection.
     PN_CPP_EXTERN std::string container_id() const;
 
-    /// Initiate local open.  The operation is not complete till
-    /// handler::on_connection_open().
+    /// Open the connection.
+    ///
+    /// @see endpoint_lifecycle
     PN_CPP_EXTERN void open();
+
+    /// @copydoc open
     PN_CPP_EXTERN void open(const connection_options &);
 
-    /// Initiate local close.  The operation is not complete till
-    /// handler::on_connection_close().
     PN_CPP_EXTERN void close();
-
-    /// Initiate close with an error condition.
-    /// The operation is not complete till handler::on_connection_close().
     PN_CPP_EXTERN void close(const error_condition&);
 
     /// Open a new session.
     PN_CPP_EXTERN session open_session();
+
+    /// @copydoc open_session
     PN_CPP_EXTERN session open_session(const session_options &);
 
     /// Get the default session.  A default session is created on the
@@ -98,10 +99,14 @@ PN_CPP_CLASS_EXTERN connection : public internal::object<pn_connection_t>, publi
 
     /// Open a sender for `addr` on default_session().
     PN_CPP_EXTERN sender open_sender(const std::string &addr);
+
+    /// @copydoc open_sender
     PN_CPP_EXTERN sender open_sender(const std::string &addr, const sender_options &);
 
     /// Open a receiver for `addr` on default_session().
     PN_CPP_EXTERN receiver open_receiver(const std::string &addr);
+
+    /// @copydoc open_receiver
     PN_CPP_EXTERN receiver open_receiver(const std::string &addr,
                                          const receiver_options &);
 
@@ -114,20 +119,32 @@ PN_CPP_CLASS_EXTERN connection : public internal::object<pn_connection_t>, publi
     /// Return all senders on this connection.
     PN_CPP_EXTERN sender_range senders() const;
 
+    /// Get the maximum frame size.
+    ///
+    /// @see @ref connection_options::max_frame_size
     PN_CPP_EXTERN uint32_t max_frame_size() const;
+
+    /// Get the maximum number of open sessions.
+    ///
+    /// @see @ref connection_options::max_sessions
     PN_CPP_EXTERN uint16_t max_sessions() const;
+
+    /// Get the idle timeout.
+    ///
+    /// @see @ref connection_options::idle_timeout
     PN_CPP_EXTERN uint32_t idle_timeout() const;
 
   private:
     void user(const std::string &);
     void password(const std::string &);
 
-    friend class internal::factory<connection>;
-    friend class connector;
+    /// @cond INTERNAL
+  friend class internal::factory<connection>;
+  friend class connector;
   friend class proton::thread_safe<connection>;
     /// @endcond
 };
 
-}
+} // proton
 
-#endif // PROTON_CPP_CONNECTION_H
+#endif // PROTON_CONNECTION_HPP


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


[3/4] qpid-proton git commit: PROTON-1200: Improve C++ binding documentation and header formatting

Posted by jr...@apache.org.
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/connection_options.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/connection_options.hpp b/proton-c/bindings/cpp/include/proton/connection_options.hpp
index 01826e7..5d80548 100644
--- a/proton-c/bindings/cpp/include/proton/connection_options.hpp
+++ b/proton-c/bindings/cpp/include/proton/connection_options.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_CONNECTION_OPTIONS_H
-#define PROTON_CPP_CONNECTION_OPTIONS_H
+#ifndef PROTON_CONNECTION_OPTIONS_H
+#define PROTON_CONNECTION_OPTIONS_H
 
 /*
  *
@@ -22,13 +22,12 @@
  *
  */
 
-#include <proton/config.hpp>
-#include <proton/export.hpp>
-#include <proton/duration.hpp>
-#include <proton/pn_unique_ptr.hpp>
-#include <proton/reconnect_timer.hpp>
-#include <proton/types_fwd.hpp>
-
+#include "proton/config.hpp"
+#include "proton/export.hpp"
+#include "proton/duration.hpp"
+#include "proton/internal/pn_unique_ptr.hpp"
+#include "proton/reconnect_timer.hpp"
+#include "proton/types_fwd.hpp"
 
 #include <vector>
 #include <string>
@@ -81,7 +80,7 @@ class connection_options {
     /// Copy options.
     PN_CPP_EXTERN connection_options& operator=(const connection_options&);
 
-    // XXX add C++11 move operations
+    // XXX add C++11 move operations - Still relevant, and applies to all options
 
     /// Set a connection handler.
     ///
@@ -105,11 +104,10 @@ class connection_options {
     PN_CPP_EXTERN connection_options& virtual_host(const std::string &name);
 
     /// @cond INTERNAL
-
-    /// XXX settle questions about reconnect_timer - consider simply
-    /// reconnect_options and making reconnect_timer internal
+    // XXX settle questions about reconnect_timer - consider simply
+    // reconnect_options and making reconnect_timer internal
+    /// **Experimental**
     PN_CPP_EXTERN connection_options& reconnect(const reconnect_timer &);
-
     /// @endcond
 
     /// Set SSL client options.
@@ -129,14 +127,11 @@ class connection_options {
     /// Specify the allowed mechanisms for use on the connection.
     PN_CPP_EXTERN connection_options& sasl_allowed_mechs(const std::string &);
 
-    /// Set the SASL configuration name.
+    /// **Experimental** - Set the SASL configuration name.
     PN_CPP_EXTERN connection_options& sasl_config_name(const std::string &);
 
-    /// @cond INTERNAL
-    /// XXX not clear this should be exposed
-    /// Set the SASL configuration path.
+    /// **Experimental** - Set the SASL configuration path.
     PN_CPP_EXTERN connection_options& sasl_config_path(const std::string &);
-    /// @endcond
 
     /// Update option values from values set in other.
     PN_CPP_EXTERN connection_options& update(const connection_options& other);
@@ -149,12 +144,14 @@ class connection_options {
     class impl;
     internal::pn_unique_ptr<impl> impl_;
 
-    friend class container_impl;
-    friend class connector;
-    friend class io::connection_engine;
-    friend class connection;
+    /// @cond INTERNAL
+  friend class container_impl;
+  friend class connector;
+  friend class io::connection_engine;
+  friend class connection;
+    /// @endcond
 };
 
-}
+} // proton
 
-#endif // PROTON_CPP_CONNECTION_OPTIONS_H
+#endif // PROTON_CONNECTION_OPTIONS_H

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/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 6d613e2..f72ea76 100644
--- a/proton-c/bindings/cpp/include/proton/container.hpp
+++ b/proton-c/bindings/cpp/include/proton/container.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_CONTAINER_H
-#define PROTON_CPP_CONTAINER_H
+#ifndef PROTON_CONTAINER_HPP
+#define PROTON_CONTAINER_HPP
 
 /*
  *
@@ -27,7 +27,7 @@
 #include <proton/connection_options.hpp>
 #include <proton/error_condition.hpp>
 #include <proton/listener.hpp>
-#include <proton/pn_unique_ptr.hpp>
+#include <proton/internal/pn_unique_ptr.hpp>
 #include <proton/thread_safe.hpp>
 
 #include <string>
@@ -47,21 +47,22 @@ class task;
 
 class container;
 
-/// A top-level container of connections, sessions, senders and receivers.
+/// A top-level container of connections, sessions, senders, and
+/// receivers.
 ///
 /// A container gives a unique identity to each communicating peer. It
 /// is often a process-level object.
 ///
-/// It serves as an entry point to the API, allowing connections, senders
-/// and receivers to be established. It can be supplied with an event handler
-/// in order to intercept important messaging events, such as newly
-/// received messages or newly issued credit for sending
+/// It serves as an entry point to the API, allowing connections,
+/// senders, and receivers to be established. It can be supplied with
+/// an event handler in order to intercept important messaging events,
+/// such as newly received messages or newly issued credit for sending
 /// messages.
 class PN_CPP_CLASS_EXTERN container {
- public:
+  public:
     PN_CPP_EXTERN virtual ~container();
 
-    /// Connect to url, send an `open` request to the remote peer.
+    /// Connect to `url` and send an open request to the remote peer.
     ///
     /// Options are applied to the connection as follows, values in later
     /// options override earlier ones:
@@ -70,18 +71,18 @@ class PN_CPP_CLASS_EXTERN container {
     ///  2. options passed to connect()
     ///
     /// The handler in the composed options is used to call
-    /// proton::handler::on_connection_open() when the remote peer's open response
-    /// is received.
-    ///@{
+    /// proton::handler::on_connection_open() when the remote peer's
+    /// open response is received.
     virtual returned<connection> connect(const std::string& url, const connection_options &) = 0;
+
+    /// Connect to `url` and send an open request to the remote peer.
     PN_CPP_EXTERN returned<connection> connect(const std::string& url);
-    ///@}
 
-    ///@cond INTERNAL
+    /// @cond INTERNAL
     /// Stop listening on url, must match the url string given to listen().
     /// You can also use the proton::listener object returned by listen()
     virtual void stop_listening(const std::string& url) = 0;
-    ///@endcond
+    /// @endcond
 
     // FIXME aconway 2016-05-13: doc options
 
@@ -109,79 +110,96 @@ class PN_CPP_CLASS_EXTERN container {
     /// With a multithreaded container, call run() in multiple threads to create a thread pool.
     virtual void run() = 0;
 
-    /// If true, the container will stop (i.e. run() will return) when all
-    /// active connections and listeners are closed. If false the container
-    /// will keep running till stop() is called.
+    /// If true, the container will stop (i.e., run() will return)
+    /// when all active connections and listeners are closed. If false
+    /// the container will keep running till stop() is called.
     ///
     /// auto_stop is set by default when a new container is created.
     // FIXME aconway 2016-05-06: doc
     virtual void auto_stop(bool) = 0;
 
-    ///@name Stop the container with an optional error_condition err.
-    /// - abort all open connections and listeners.
-    /// - process final handler events and injected functions
-    /// - if !err.empty(), handlers will receive on_transport_error(err)
-    /// - run() will return in all threads.
+    /// Stop the container with an optional error_condition err.
+    ///
+    ///  - Abort all open connections and listeners.
+    ///  - Process final handler events and injected functions
+    ///  - If `!err.empty()`, handlers will receive on_transport_error
+    ///  - run() will return in all threads.
     virtual void stop(const error_condition& err = error_condition()) = 0;
 
     /// Open a connection to `url` and open a sender for `url.path()`.
-    /// Any supplied sender or connection options will override the
-    /// container's template options.
-    /// @{
     PN_CPP_EXTERN virtual returned<sender> open_sender(const std::string &url);
+
+    /// Open a connection to `url` and open a sender for `url.path()`.
+    /// Any supplied sender options will override the container's
+    /// template options.
     PN_CPP_EXTERN virtual returned<sender> open_sender(const std::string &url,
                                                        const proton::sender_options &o);
+
+    /// Open a connection to `url` and open a sender for `url.path()`.
+    /// Any supplied sender or connection options will override the
+    /// container's template options.
     virtual returned<sender> open_sender(const std::string &url,
                                          const proton::sender_options &o,
                                          const connection_options &c) = 0;
-    //@}
 
     /// Open a connection to `url` and open a receiver for
-    /// `url.path()`.  Any supplied receiver or connection options will
-    /// override the container's template options.
-    /// @{
+    /// `url.path()`.
     PN_CPP_EXTERN virtual returned<receiver> open_receiver(const std::string&url);
+
+
+    /// Open a connection to `url` and open a receiver for
+    /// `url.path()`.  Any supplied receiver options will override the
+    /// container's template options.
     PN_CPP_EXTERN virtual returned<receiver> open_receiver(const std::string&url,
                                                            const proton::receiver_options &o);
+    
+    /// Open a connection to `url` and open a receiver for
+    /// `url.path()`.  Any supplied receiver or connection options will
+    /// override the container's template options.
     virtual returned<receiver> open_receiver(const std::string&url,
                                              const proton::receiver_options &o,
                                              const connection_options &c) = 0;
-    ///@}
 
     /// A unique identifier for the container.
     virtual std::string id() const = 0;
 
     // FIXME aconway 2016-05-04: need timed injection to replace schedule()
 
-    /// Connection options that will be to outgoing connections. These are
-    /// applied first and overriden by options provided in connect() and
-    /// handler::on_connection_open()
-    /// @{
+    /// Connection options that will be to outgoing connections. These
+    /// are applied first and overriden by options provided in
+    /// connect() and handler::on_connection_open().
     virtual void client_connection_options(const connection_options &) = 0;
+
+    /// @copydoc client_connection_options
     virtual connection_options client_connection_options() const = 0;
-    ///@}
 
-    /// Connection options that will be applied to incoming connections. These
-    /// are applied first and overridden by options provided in listen(),
-    /// listen_handler::on_accept() and handler::on_connection_open()
-    /// @{
+    /// Connection options that will be applied to incoming
+    /// connections. These are applied first and overridden by options
+    /// provided in listen(), listen_handler::on_accept() and
+    /// handler::on_connection_open().
     virtual void server_connection_options(const connection_options &) = 0;
+
+    /// @copydoc server_connection_options
     virtual connection_options server_connection_options() const = 0;
-    ///@}
 
-    /// Sender options applied to senders created by this container. They are
-    /// applied before handler::on_sender_open() and can be over-ridden.  @{
-    /// @{
+    /// Sender options applied to senders created by this
+    /// container. They are applied before handler::on_sender_open()
+    /// and can be overridden.
     virtual void sender_options(const sender_options &) = 0;
+
+    /// @copydoc sender_options
     virtual class sender_options sender_options() const = 0;
-    ///@}
 
-    /// Receiver options applied to receivers created by this container. They
-    /// are applied before handler::on_receiver_open() and can be over-ridden.
-    /// @{
+    /// Receiver options applied to receivers created by this
+    /// container. They are applied before handler::on_receiver_open()
+    /// and can be overridden.
     virtual void receiver_options(const receiver_options &) = 0;
+
+    /// @copydoc receiver_options
     virtual class receiver_options receiver_options() const = 0;
-    /// @}
+
 };
-}
-#endif // PROTON_CPP_CONTAINER_H
+
+} // proton
+
+#endif // PROTON_CONTAINER_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/data.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/data.hpp b/proton-c/bindings/cpp/include/proton/data.hpp
index d305693..968f243 100644
--- a/proton-c/bindings/cpp/include/proton/data.hpp
+++ b/proton-c/bindings/cpp/include/proton/data.hpp
@@ -1,7 +1,8 @@
-#ifndef PROTON_DATA_HPP
-#define PROTON_DATA_HPP
+#ifndef PROTON_CODEC_DATA_HPP
+#define PROTON_CODEC_DATA_HPP
 
 /*
+ *
  * 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
@@ -18,34 +19,30 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
+ *
  */
 
-#include <proton/object.hpp>
-#include <proton/types_fwd.hpp>
-#include <proton/type_id.hpp>
-
-///@file
+#include "proton/internal/object.hpp"
+#include "proton/types_fwd.hpp"
+#include "proton/type_id.hpp"
 
 struct pn_data_t;
 
 namespace proton {
 
 class value;
-///@defgroup codec Internal details of AMQP encoding.
-///
-/// You can use these classes on an experimental basis to create your own AMQP
-/// encodings for C++ types, but they may change in the future. For examples of use
-/// see the built-in encodings, for example in proton/vector.hpp or proton/map.hpp
 
-/// @ingroup codec
+// XXX -> internal namespace
 namespace codec {
 
+/// @cond INTERNAL
 /// Wrapper for a proton data object.
 class data : public internal::object<pn_data_t> {
     /// Wrap an existing proton-C data object.
     data(pn_data_t* d) : internal::object<pn_data_t>(d) {}
 
   public:
+    /// Create an empty data.
     data() : internal::object<pn_data_t>(0) {}
 
     /// Create a new data object.
@@ -81,20 +78,33 @@ class data : public internal::object<pn_data_t> {
   friend struct state_guard;
   friend PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const data&);
 };
+/// @endcond
 
-// state_guard saves the state and restores it in dtor unless cancel() is called.
+/// **Experimental** - Save and restore codec state
+///
+/// A state_guard saves the state and restores it in the destructor
+/// unless cancel() is called.
 struct state_guard {
+    /// @cond INTERNAL
     data& data_;
     void* point_;
     bool cancel_;
+    /// @endcond
 
+    /// @cond INTERNAL
     state_guard(data& d) : data_(d), point_(data_.point()), cancel_(false) {}
+    /// @endcond
+    
     ~state_guard() { if (!cancel_) data_.restore(point_); }
+
+    /// Discard the saved state.
     void cancel() { cancel_ = true; }
 };
 
-// Start encoding a complex type.
+/// **Experimental** - Start encoding a complex type.
 struct start {
+    /// @cond INTERNAL
+    /// XXX Document
     start(type_id type_=NULL_TYPE, type_id element_=NULL_TYPE,
           bool described_=false, size_t size_=0) :
         type(type_), element(element_), is_described(described_), size(size_) {}
@@ -103,18 +113,21 @@ struct start {
     type_id element;         ///< the element type for array only.
     bool is_described;       ///< true if first value is a descriptor.
     size_t size;             ///< the element count excluding the descriptor (if any)
+    /// @endcond
 
+    /// @cond INTERNAL
+    /// XXX Document
     static start array(type_id element, bool described=false) { return start(ARRAY, element, described); }
     static start list() { return start(LIST); }
     static start map() { return start(MAP); }
     static start described() { return start(DESCRIBED, NULL_TYPE, true); }
+    /// @endcond
 };
 
-// Finish inserting or extracting a complex type.
+/// **Experimental** - Finish inserting or extracting a complex type.
 struct finish {};
 
 } // codec
-
 } // proton
 
-#endif  /*!PROTON_DATA_HPP*/
+#endif // PROTON_CODEC_DATA_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/decimal.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/decimal.hpp b/proton-c/bindings/cpp/include/proton/decimal.hpp
index dada944..8ef5023 100644
--- a/proton-c/bindings/cpp/include/proton/decimal.hpp
+++ b/proton-c/bindings/cpp/include/proton/decimal.hpp
@@ -1,6 +1,8 @@
-#ifndef DECIMAL_HPP
-#define DECIMAL_HPP
+#ifndef PROTON_DECIMAL_HPP
+#define PROTON_DECIMAL_HPP
+
 /*
+ *
  * 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
@@ -17,19 +19,20 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
+ *
  */
 
 #include "proton/byte_array.hpp"
-#include "proton/comparable.hpp"
 #include "proton/export.hpp"
+#include "proton/internal/comparable.hpp"
 
-#include <proton/types.h>
+#include "proton/types.h"
 
 #include <iosfwd>
 
 namespace proton {
 
-///@name AMQP decimal types.
+/// @name AMQP decimal types.
 ///
 /// AMQP uses the standard IEEE 754-2008 encoding for decimal types.
 ///
@@ -49,16 +52,15 @@ class decimal64 : public byte_array<8> {};
 
 /// 128-bit decimal floating point.
 class decimal128 : public byte_array<16> {};
-///@}
+/// @}
 
 /// Print decimal values
-///@{
+/// @{
 PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const decimal32&);
 PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const decimal64&);
 PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const decimal128&);
-///@}
-
+/// @}
 
-}
+} // proton
 
-#endif // DECIMAL_HPP
+#endif // PROTON_DECIMAL_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/decoder.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/decoder.hpp b/proton-c/bindings/cpp/include/proton/decoder.hpp
deleted file mode 100644
index 32d3adb..0000000
--- a/proton-c/bindings/cpp/include/proton/decoder.hpp
+++ /dev/null
@@ -1,195 +0,0 @@
-#ifndef PROTON_DECODER_HPP
-#define PROTON_DECODER_HPP
-/*
- * 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/data.hpp>
-#include <proton/types_fwd.hpp>
-#include <proton/type_traits.hpp>
-
-#include <utility>
-
-// Proton namespace
-namespace proton {
-
-class annotation_key;
-class message_id;
-class scalar;
-class value;
-
-namespace internal {
-class value_base;
-}
-
-/// @ingroup codec
-namespace codec {
-
-/// Stream-like decoder from AMQP bytes to C++ values.
-///
-/// Internal use only, see proton::value, proton::scalar and \ref types
-/// for the recommended ways to manage AMQP data.
-class decoder : public data {
-  public:
-
-    /// Wrap Proton-C data object.
-    /// The exact flag if set means decode only when there is an exact match
-    /// between the AMQP and C++ type. If not set then perform automatic conversions.
-    explicit decoder(const data& d, bool exact=false) : data(d), exact_(exact) {}
-
-    /// Attach decoder to a proton::value. The decoder is rewound to the start of the data.
-    PN_CPP_EXTERN explicit decoder(const internal::value_base&, bool exact=false);
-
-    /// Decode AMQP data from a buffer and add it to the end of the decoders stream. */
-    PN_CPP_EXTERN void decode(const char* buffer, size_t size);
-
-    /// Decode AMQP data from a std::string and add it to the end of the decoders stream. */
-    PN_CPP_EXTERN void decode(const std::string&);
-
-    /// Return true if there are more value to extract at the current level.
-    PN_CPP_EXTERN bool more();
-
-    /// Get the type of the next value that will be read by operator>>.
-    /// @throw conversion_error if no more values. @see decoder::more().
-    PN_CPP_EXTERN type_id next_type();
-
-    /// @name Extract built-in types
-    /// @throw conversion_error if the decoder is empty or has an incompatible type.
-    /// @{
-    PN_CPP_EXTERN decoder& operator>>(bool&);
-    PN_CPP_EXTERN decoder& operator>>(uint8_t&);
-    PN_CPP_EXTERN decoder& operator>>(int8_t&);
-    PN_CPP_EXTERN decoder& operator>>(uint16_t&);
-    PN_CPP_EXTERN decoder& operator>>(int16_t&);
-    PN_CPP_EXTERN decoder& operator>>(uint32_t&);
-    PN_CPP_EXTERN decoder& operator>>(int32_t&);
-    PN_CPP_EXTERN decoder& operator>>(wchar_t&);
-    PN_CPP_EXTERN decoder& operator>>(uint64_t&);
-    PN_CPP_EXTERN decoder& operator>>(int64_t&);
-    PN_CPP_EXTERN decoder& operator>>(timestamp&);
-    PN_CPP_EXTERN decoder& operator>>(float&);
-    PN_CPP_EXTERN decoder& operator>>(double&);
-    PN_CPP_EXTERN decoder& operator>>(decimal32&);
-    PN_CPP_EXTERN decoder& operator>>(decimal64&);
-    PN_CPP_EXTERN decoder& operator>>(decimal128&);
-    PN_CPP_EXTERN decoder& operator>>(uuid&);
-    PN_CPP_EXTERN decoder& operator>>(std::string&);
-    PN_CPP_EXTERN decoder& operator>>(symbol&);
-    PN_CPP_EXTERN decoder& operator>>(binary&);
-    PN_CPP_EXTERN decoder& operator>>(message_id&);
-    PN_CPP_EXTERN decoder& operator>>(annotation_key&);
-    PN_CPP_EXTERN decoder& operator>>(scalar&);
-    PN_CPP_EXTERN decoder& operator>>(internal::value_base&);
-    PN_CPP_EXTERN decoder& operator>>(null&);
-    ///@}
-
-    /// Start decoding a container type, such as an ARRAY, LIST or MAP.
-    /// This "enters" the container, more() will return false at the end of the container.
-    /// Call finish() to "exit" the container and move on to the next value.
-    PN_CPP_EXTERN decoder& operator>>(start&);
-
-    /// Finish decoding a container type, and move on to the next value in the stream.
-    PN_CPP_EXTERN decoder& operator>>(const finish&);
-
-    ///@cond INTERNAL
-    template <class T> struct sequence_ref { T& ref; sequence_ref(T& r) : ref(r) {} };
-    template <class T> struct associative_ref { T& ref; associative_ref(T& r) : ref(r) {} };
-    template <class T> struct pair_sequence_ref { T& ref;  pair_sequence_ref(T& r) : ref(r) {} };
-
-    template <class T> static sequence_ref<T> sequence(T& x) { return sequence_ref<T>(x); }
-    template <class T> static associative_ref<T> associative(T& x) { return associative_ref<T>(x); }
-    template <class T> static pair_sequence_ref<T> pair_sequence(T& x) { return pair_sequence_ref<T>(x); }
-    ///@endcond
-
-    /** Extract any AMQP sequence (ARRAY, LIST or MAP) to a C++ sequence
-     * container of T if the elements types are convertible to T. A MAP is
-     * extracted as [key1, value1, key2, value2...]
-     */
-    template <class T> decoder& operator>>(sequence_ref<T> r)  {
-        start s;
-        *this >> s;
-        if (s.is_described) next();
-        r.ref.resize(s.size);
-        for (typename T::iterator i = r.ref.begin(); i != r.ref.end(); ++i)
-            *this >> *i;
-        return *this;
-    }
-
-    /** Extract an AMQP MAP to a C++ associative container */
-    template <class T> decoder& operator>>(associative_ref<T> r)  {
-        using namespace internal;
-        start s;
-        *this >> s;
-        assert_type_equal(MAP, s.type);
-        r.ref.clear();
-        for (size_t i = 0; i < s.size/2; ++i) {
-            typename remove_const<typename T::key_type>::type k;
-            typename remove_const<typename T::mapped_type>::type v;
-            *this >> k >> v;
-            r.ref[k] = v;
-        }
-        return *this;
-    }
-
-    /// Extract an AMQP MAP to a C++ push_back sequence of pairs
-    /// preserving encoded order.
-    template <class T> decoder& operator>>(pair_sequence_ref<T> r)  {
-        using namespace internal;
-        start s;
-        *this >> s;
-        assert_type_equal(MAP, s.type);
-        r.ref.clear();
-        for (size_t i = 0; i < s.size/2; ++i) {
-            typedef typename T::value_type value_type;
-            typename remove_const<typename value_type::first_type>::type k;
-            typename remove_const<typename value_type::second_type>::type v;
-            *this >> k >> v;
-            r.ref.push_back(value_type(k, v));
-        }
-        return *this;
-    }
-
-  private:
-    type_id pre_get();
-    template <class T, class U> decoder& extract(T& x, U (*get)(pn_data_t*));
-    bool exact_;
-
-  friend class message;
-};
-
-template<class T> T get(decoder& d) {
-    assert_type_equal(internal::type_id_of<T>::value, d.next_type());
-    T x;
-    d >> x;
-    return x;
-}
-
-// operator >> for integer types that are not covered by the standard overrides.
-template <class T> typename internal::enable_if<internal::is_unknown_integer<T>::value, decoder&>::type
-operator>>(decoder& d, T& i)  {
-    using namespace internal;
-    typename integer_type<sizeof(T), is_signed<T>::value>::type v;
-    d >> v;                     // Extract as a known integer type
-    i = v;                      // C++ conversion to the target type.
-    return d;
-}
-
-} // codec
-} // proton
-
-#endif // PROTON_DECODER_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/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 d3a7608..06ed37b 100644
--- a/proton-c/bindings/cpp/include/proton/default_container.hpp
+++ b/proton-c/bindings/cpp/include/proton/default_container.hpp
@@ -24,13 +24,15 @@
 
 // FIXME aconway 2016-05-04: doc
 
-#include <proton/container.hpp>
+#include "proton/container.hpp"
 
 namespace proton {
 
 // FIXME aconway 2016-05-04: doc
+
+/// A single-threaded container.    
 class PN_CPP_CLASS_EXTERN  default_container : public container {
- public:
+  public:
     /// Create a default, single-threaded container with a handler.
     /// The handler will be called for all events on all connections in the container.
     ///
@@ -50,14 +52,17 @@ class PN_CPP_CLASS_EXTERN  default_container : public container {
 
     /// Wrap an existing container implementation as a default_container.
     /// Takes ownership of c.
-    PN_CPP_EXTERN  explicit default_container(container* c) : impl_(c) {}
+    PN_CPP_EXTERN explicit default_container(container* c) : impl_(c) {}
 
     // FIXME aconway 2016-05-13: @copydoc all.
 
     PN_CPP_EXTERN returned<connection> connect(const std::string& url, const connection_options &) PN_CPP_OVERRIDE;
     PN_CPP_EXTERN listener listen(const std::string& url, listen_handler& l) PN_CPP_OVERRIDE;
 
+    /// @cond INTERNAL
+    /// XXX Make private
     PN_CPP_EXTERN void stop_listening(const std::string& url) PN_CPP_OVERRIDE;
+    /// @endcond
 
     PN_CPP_EXTERN void run() PN_CPP_OVERRIDE;
     PN_CPP_EXTERN void auto_stop(bool set) PN_CPP_OVERRIDE;
@@ -79,14 +84,17 @@ class PN_CPP_CLASS_EXTERN  default_container : public container {
     PN_CPP_EXTERN connection_options client_connection_options() const PN_CPP_OVERRIDE;
     PN_CPP_EXTERN void server_connection_options(const connection_options &o) PN_CPP_OVERRIDE;
     PN_CPP_EXTERN connection_options server_connection_options() const PN_CPP_OVERRIDE;
+    /// @copydoc container::sender_options
     PN_CPP_EXTERN void sender_options(const class sender_options &o) PN_CPP_OVERRIDE;
     PN_CPP_EXTERN class sender_options sender_options() const PN_CPP_OVERRIDE;
+    /// @copydoc container::receiver_options
     PN_CPP_EXTERN void receiver_options(const class receiver_options & o) PN_CPP_OVERRIDE;
     PN_CPP_EXTERN class receiver_options receiver_options() const PN_CPP_OVERRIDE;
 
- private:
+  private:
     internal::pn_unique_ptr<container> impl_;
 };
 
-}
+} // proton
+
 #endif // PROTON_DEFAULT_CONTAINER_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/delivery.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/delivery.hpp b/proton-c/bindings/cpp/include/proton/delivery.hpp
index 3f76166..c587214 100644
--- a/proton-c/bindings/cpp/include/proton/delivery.hpp
+++ b/proton-c/bindings/cpp/include/proton/delivery.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_DELIVERY_H
-#define PROTON_CPP_DELIVERY_H
+#ifndef PROTON_DELIVERY_HPP
+#define PROTON_DELIVERY_HPP
 
 /*
  *
@@ -23,7 +23,7 @@
  */
 
 #include "proton/export.hpp"
-#include "proton/object.hpp"
+#include "proton/internal/object.hpp"
 #include "proton/transfer.hpp"
 
 #include "proton/delivery.h"
@@ -33,9 +33,10 @@ namespace proton {
 
 class receiver;
 
-/// A message transfer.  Every delivery exists within the context of a
-/// proton::receiver.  A delivery attempt can fail. As a result, a
-/// particular message may correspond to multiple deliveries.
+/// A received message.
+/// 
+/// A delivery attempt can fail. As a result, a particular message may
+/// correspond to multiple deliveries.
 class delivery : public transfer {
     /// @cond INTERNAL
     delivery(pn_delivery_t* d);
@@ -44,19 +45,22 @@ class delivery : public transfer {
   public:
     delivery() {}
 
-    // Return the receiver for this delivery
+    /// Return the receiver for this delivery.
     PN_CPP_EXTERN class receiver receiver() const;
 
-    /// Settle with ACCEPTED state
+    // XXX ATM the following don't reflect the differing behaviors we
+    // get from the different delivery modes. - Deferred
+    
+    /// Settle with ACCEPTED state.
     PN_CPP_EXTERN void accept() { settle(ACCEPTED); }
 
-    /// Settle with REJECTED state
+    /// Settle with REJECTED state.
     PN_CPP_EXTERN void reject() { settle(REJECTED); }
 
-    /// Settle with RELEASED state
+    /// Settle with RELEASED state.
     PN_CPP_EXTERN void release() { settle(RELEASED); }
 
-    /// Settle with MODIFIED state
+    /// Settle with MODIFIED state.
     PN_CPP_EXTERN void modify() { settle(MODIFIED); }
 
     /// @cond INTERNAL
@@ -64,6 +68,6 @@ class delivery : public transfer {
     /// @endcond
 };
 
-}
+} // proton
 
-#endif // PROTON_CPP_DELIVERY_H
+#endif // PROTON_DELIVERY_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/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 fe420e6..97b350f 100644
--- a/proton-c/bindings/cpp/include/proton/delivery_mode.hpp
+++ b/proton-c/bindings/cpp/include/proton/delivery_mode.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_DELIVERY_MODE_H
-#define PROTON_CPP_DELIVERY_MODE_H
+#ifndef PROTON_DELIVERY_MODE_H
+#define PROTON_DELIVERY_MODE_H
 
 /*
  *
@@ -28,28 +28,33 @@ namespace proton {
 /// 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,
-    // Outgoing messages are settled immediately by the link.
-    // There are no duplicates.
-    AT_MOST_ONCE,
-    // The receiver settles the delivery first with an
-    // accept/reject/release disposition.  The sender waits to
-    // 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_;
+    /// Delivery modes
+    enum modes {
+        /// No set policy.  The application must settle messages
+        /// itself according to its own policy.
+        NONE = 0,
+        /// Outgoing messages are settled immediately by the link.
+        /// There are no duplicates.
+        AT_MOST_ONCE,
+        /// The receiver settles the delivery first with an
+        /// accept/reject/release disposition.  The sender waits to
+        /// settle until after the disposition notification is
+        /// received.
+        AT_LEAST_ONCE
+    };
+
+    /// @cond INTERNAL
+    
+    delivery_mode() : modes_(NONE) {}
+    delivery_mode(modes m) : modes_(m) {}
+    operator modes() { return modes_; }
+
+    /// @endcond
+
+  private:
+    modes modes_;
 };
 
-}
+} // proton
 
-#endif // PROTON_CPP_DELIVERY_MODE_H
+#endif // PROTON_DELIVERY_MODE_H

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/deque.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/deque.hpp b/proton-c/bindings/cpp/include/proton/deque.hpp
deleted file mode 100644
index 7d0b278..0000000
--- a/proton-c/bindings/cpp/include/proton/deque.hpp
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef PROTON_DEQUE_HPP
-#define PROTON_DEQUE_HPP
-/*
- * 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 <deque>
-#include <utility>
-
-#include <proton/encoder.hpp>
-#include <proton/decoder.hpp>
-
-namespace proton {
-namespace codec {
-
-/// std::deque<T> for most T is encoded as an amqp::ARRAY (same type elements)
-template <class T, class A>
-encoder& operator<<(encoder& e, const std::deque<T, A>& x) {
-    return e << encoder::array(x, internal::type_id_of<T>::value);
-}
-
-/// std::deque<value> encodes as amqp::LIST (mixed type elements)
-template <class A>
-encoder& operator<<(encoder& e, const std::deque<value, A>& x) { return e << encoder::list(x); }
-
-/// std::deque<scalar> encodes as amqp::LIST (mixed type elements)
-template <class A>
-encoder& operator<<(encoder& e, const std::deque<scalar, A>& x) { return e << encoder::list(x); }
-
-/// std::deque<std::pair<k,t> > encodes as amqp::MAP.
-/// Map entries are encoded in order they appear in the list.
-template <class A, class K, class T>
-encoder& operator<<(encoder& e, const std::deque<std::pair<K,T>, A>& x) { return e << encoder::map(x); }
-
-/// Decode to std::deque<T> from an amqp::LIST or amqp::ARRAY.
-template <class T, class A> decoder& operator>>(decoder& d, std::deque<T, A>& x) { return d >> decoder::sequence(x); }
-
-/// Decode to std::deque<std::pair<K, T> from an amqp::MAP.
-template <class A, class K, class T> decoder& operator>>(decoder& d, std::deque<std::pair<K, T> , A>& x) { return d >> decoder::pair_sequence(x); }
-
-}
-}
-#endif // PROTON_DEQUE_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/duration.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/duration.hpp b/proton-c/bindings/cpp/include/proton/duration.hpp
index 1b413a3..7f32e91 100644
--- a/proton-c/bindings/cpp/include/proton/duration.hpp
+++ b/proton-c/bindings/cpp/include/proton/duration.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_DURATION_H
-#define PROTON_CPP_DURATION_H
+#ifndef PROTON_DURATION_HPP
+#define PROTON_DURATION_HPP
 
 /*
  *
@@ -22,9 +22,9 @@
  *
  */
 
-#include <proton/export.hpp>
-#include <proton/comparable.hpp>
-#include <proton/types_fwd.hpp>
+#include "proton/export.hpp"
+#include "proton/internal/comparable.hpp"
+#include "proton/types_fwd.hpp"
 
 #include <iosfwd>
 
@@ -33,14 +33,19 @@ namespace proton {
 /// A span of time in milliseconds.
 class duration : private internal::comparable<duration> {
   public:
-    typedef int64_t numeric_type; ///< Numeric type used to store milliseconds
+    /// Numeric type used to store milliseconds    
+    typedef int64_t numeric_type;
 
-    explicit duration(numeric_type ms = 0) : ms_(ms) {} ///< Construct from milliseconds
-    duration& operator=(numeric_type ms) { ms_ = ms; return *this; } ///< Assign
+    /// Construct from milliseconds
+    explicit duration(numeric_type ms = 0) : ms_(ms) {}
 
-    numeric_type milliseconds() const { return ms_; } ///< Return milliseconds
+    /// Assign
+    duration& operator=(numeric_type ms) { ms_ = ms; return *this; }
 
-    PN_CPP_EXTERN static const duration FOREVER;   ///< Wait for ever
+    /// Return milliseconds
+    numeric_type milliseconds() const { return ms_; }
+
+    PN_CPP_EXTERN static const duration FOREVER;   ///< Wait forever
     PN_CPP_EXTERN static const duration IMMEDIATE; ///< Don't wait at all
     PN_CPP_EXTERN static const duration SECOND;    ///< One second
     PN_CPP_EXTERN static const duration MINUTE;    ///< One minute
@@ -52,8 +57,8 @@ class duration : private internal::comparable<duration> {
 /// Print duration
 PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, duration);
 
-///@name Comparison and arithmetic operators
-///@{
+/// @name Comparison and arithmetic operators
+/// @{
 inline bool operator<(duration x, duration y) { return x.milliseconds() < y.milliseconds(); }
 inline bool operator==(duration x, duration y) { return x.milliseconds() == y.milliseconds(); }
 
@@ -61,7 +66,8 @@ inline duration operator+(duration x, duration y) { return duration(x.millisecon
 inline duration operator-(duration x, duration y) { return duration(x.milliseconds() - y.milliseconds()); }
 inline duration operator*(duration d, uint64_t n) { return duration(d.milliseconds()*n); }
 inline duration operator*(uint64_t n, duration d) { return d * n; }
-///@}
-}
+/// @}
+
+} // proton
 
-#endif // PROTON_CPP_DURATION_H
+#endif // PROTON_DURATION_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/encoder.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/encoder.hpp b/proton-c/bindings/cpp/include/proton/encoder.hpp
deleted file mode 100644
index fd15128..0000000
--- a/proton-c/bindings/cpp/include/proton/encoder.hpp
+++ /dev/null
@@ -1,194 +0,0 @@
-#ifndef PROTON_ENCODER_HPP
-#define PROTON_ENCODER_HPP
-
-/*
- * 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/data.hpp>
-#include <proton/types_fwd.hpp>
-#include <proton/type_traits.hpp>
-
-namespace proton {
-
-namespace internal{
-class scalar_base;
-class value_base;
-}
-
-
-/// @ingroup codec
-namespace codec {
-
-/// Stream-like encoder from AMQP bytes to C++ values.
-///
-/// Internal use only, see proton::value, proton::scalar and \ref types
-/// for the recommended ways to manage AMQP data.
-class encoder : public data {
-  public:
-    /// Wrap Proton-C data object.
-    explicit encoder(const data& d) : data(d) {}
-
-    /// Encoder into v. Clears any current value in v.
-    PN_CPP_EXTERN explicit encoder(internal::value_base& v);
-
-    /**
-     * Encode the current values into buffer and update size to reflect the
-     * number of bytes encoded.
-     *
-     * Clears the encoder.
-     *
-     *@return if buffer==0 or size is too small then return false and  size to the required size.
-     *Otherwise return true and set size to the number of bytes encoded.
-     */
-    PN_CPP_EXTERN bool encode(char* buffer, size_t& size);
-
-    /** Encode the current values into a std::string, resize the string if necessary.
-     *
-     * Clears the encoder.
-     */
-    PN_CPP_EXTERN void encode(std::string&);
-
-    /** Encode the current values into a std::string. Clears the encoder. */
-    PN_CPP_EXTERN std::string encode();
-
-    /// @name Insert built-in types
-    /// @{
-    PN_CPP_EXTERN encoder& operator<<(bool);
-    PN_CPP_EXTERN encoder& operator<<(uint8_t);
-    PN_CPP_EXTERN encoder& operator<<(int8_t);
-    PN_CPP_EXTERN encoder& operator<<(uint16_t);
-    PN_CPP_EXTERN encoder& operator<<(int16_t);
-    PN_CPP_EXTERN encoder& operator<<(uint32_t);
-    PN_CPP_EXTERN encoder& operator<<(int32_t);
-    PN_CPP_EXTERN encoder& operator<<(wchar_t);
-    PN_CPP_EXTERN encoder& operator<<(uint64_t);
-    PN_CPP_EXTERN encoder& operator<<(int64_t);
-    PN_CPP_EXTERN encoder& operator<<(timestamp);
-    PN_CPP_EXTERN encoder& operator<<(float);
-    PN_CPP_EXTERN encoder& operator<<(double);
-    PN_CPP_EXTERN encoder& operator<<(decimal32);
-    PN_CPP_EXTERN encoder& operator<<(decimal64);
-    PN_CPP_EXTERN encoder& operator<<(decimal128);
-    PN_CPP_EXTERN encoder& operator<<(const uuid&);
-    PN_CPP_EXTERN encoder& operator<<(const std::string&);
-    PN_CPP_EXTERN encoder& operator<<(const symbol&);
-    PN_CPP_EXTERN encoder& operator<<(const binary&);
-    PN_CPP_EXTERN encoder& operator<<(const internal::scalar_base&);
-    PN_CPP_EXTERN encoder& operator<<(const null&);
-    ///@}
-
-    /// Insert a proton::value.
-    /// @internal NOTE insert value_base, not value to avoid recursive implicit conversions.
-    PN_CPP_EXTERN encoder& operator<<(const internal::value_base&);
-
-    /// Start a complex type
-    PN_CPP_EXTERN encoder& operator<<(const start&);
-    /// Finish a complex type
-    PN_CPP_EXTERN encoder& operator<<(const finish&);
-
-    ///@cond INTERNAL
-
-    // Undefined template to  prevent pointers being implicitly converted to bool.
-    template <class T> void* operator<<(const T*);
-
-    template <class T> struct list_cref { T& ref; list_cref(T& r) : ref(r) {} };
-    template <class T> struct map_cref { T& ref;  map_cref(T& r) : ref(r) {} };
-
-    template <class T> struct array_cref {
-        start array_start;
-        T& ref;
-        array_cref(T& r, type_id el, bool described) : array_start(ARRAY, el, described), ref(r) {}
-    };
-
-    template <class T> static list_cref<T> list(T& x) { return list_cref<T>(x); }
-    template <class T> static map_cref<T> map(T& x) { return map_cref<T>(x); }
-    template <class T> static array_cref<T> array(T& x, type_id element, bool described=false) {
-        return array_cref<T>(x, element, described);
-    }
-
-    template <class T> encoder& operator<<(const map_cref<T>& x) {
-        state_guard sg(*this);
-        *this << start::map();
-        for (typename T::const_iterator i = x.ref.begin(); i != x.ref.end(); ++i)
-            *this << i->first << i->second;
-        *this << finish();
-        return *this;
-    }
-
-    template <class T> encoder& operator<<(const list_cref<T>& x) {
-        state_guard sg(*this);
-        *this << start::list();
-        for (typename T::const_iterator i = x.ref.begin(); i != x.ref.end(); ++i)
-            *this << *i;
-        *this << finish();
-        return *this;
-    }
-
-    template <class T> encoder& operator<<(const array_cref<T>& x) {
-        state_guard sg(*this);
-        *this << x.array_start;
-        for (typename T::const_iterator i = x.ref.begin(); i != x.ref.end(); ++i)
-            *this << *i;
-        *this << finish();
-        return *this;
-    }
-    ///@endcond
-
-  private:
-    template<class T, class U> encoder& insert(const T& x, int (*put)(pn_data_t*, U));
-    void check(long result);
-};
-
-
-/// Treat char* as string
-inline encoder& operator<<(encoder& e, const char* s) { return e << std::string(s); }
-
-/// operator << for integer types that are not covered by the standard overrides.
-template <class T> typename internal::enable_if<internal::is_unknown_integer<T>::value, encoder&>::type
-operator<<(encoder& e, T i)  {
-    using namespace internal;
-    return e << static_cast<typename integer_type<sizeof(T), is_signed<T>::value>::type>(i);
-}
-
-///@cond INTERNAL
-namespace is_encodable_impl {   // Protected the world from wildcard operator<<
-
-using namespace internal;
-
-sfinae::no operator<<(sfinae::wildcard, sfinae::wildcard); // Fallback
-
-template<typename T> struct is_encodable : public sfinae {
-    static yes test(encoder);
-    static no test(...);         // Failed test, no match.
-    static encoder &e;
-    static const T& t;
-    static bool const value = sizeof(test(e << t)) == sizeof(yes);
-};
-// Avoid recursion
-template <> struct is_encodable<value> : public true_type {};
-
-} // namespace is_encodable_impl
-
-using is_encodable_impl::is_encodable;
-///@endcond
-
-} // codec
-} // proton
-
-#endif  /*!PROTON_ENCODER_HPP*/

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/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 88259ca..c908bac 100644
--- a/proton-c/bindings/cpp/include/proton/endpoint.hpp
+++ b/proton-c/bindings/cpp/include/proton/endpoint.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_ENDPOINT_H
-#define PROTON_CPP_ENDPOINT_H
+#ifndef PROTON_ENDPOINT_HPP
+#define PROTON_ENDPOINT_HPP
 
 /*
  *
@@ -22,10 +22,10 @@
  *
  */
 
-#include "proton/comparable.hpp"
 #include "proton/config.hpp"
 #include "proton/error_condition.hpp"
 #include "proton/export.hpp"
+#include "proton/internal/comparable.hpp"
 
 namespace proton {
 
@@ -35,23 +35,35 @@ PN_CPP_CLASS_EXTERN endpoint {
   public:
     PN_CPP_EXTERN virtual ~endpoint();
 
-    /// True if the local end is uninitialized
+    // XXX Add the container accessor here.
+    
+    /// True if the local end is uninitialized.
     virtual bool uninitialized() const = 0;
-    /// True if the local end is active
+    
+    /// True if the local end is active.
     virtual bool active() const = 0;
-    /// True if the connection is fully closed, i.e. local and remote
-    /// ends are closed.
+    
+    /// True if the local and remote ends are closed.
     virtual bool closed() const = 0;
 
     /// Get the error condition of the remote endpoint.
     virtual class error_condition error() const = 0;
 
-    /// Close endpoint
+    // XXX Add virtual open() and open(endpoint_options)
+    
+    /// Close the endpoint.
+    ///
+    /// @see endpoint_lifecycle
     virtual void close() = 0;
+
+    /// Close the endpoint with an error condition.
+    ///
+    /// @see endpoint_lifecycle
     virtual void close(const error_condition&) = 0;
 
 #if PN_CPP_HAS_DEFAULTED_FUNCTIONS
     // Make everything explicit for C++11 compilers
+    
     endpoint() = default;
     endpoint& operator=(const endpoint&) = default;
     endpoint& operator=(endpoint&&) = default;
@@ -61,7 +73,6 @@ PN_CPP_CLASS_EXTERN endpoint {
 #endif
 };
 
-///@cond INTERNAL
 namespace internal {
 
 template <class T, class D> class iter_base {
@@ -73,7 +84,7 @@ template <class T, class D> class iter_base {
     D operator++(int) { D x(*this); ++(*this); return x; }
     bool operator==(const iter_base<T, D>& x) const { return obj_ == x.obj_; }
     bool operator!=(const iter_base<T, D>& x) const { return obj_ != x.obj_; }
-    ///@}
+    
   protected:
     explicit iter_base(T p = 0) : obj_(p) {}
     T obj_;
@@ -87,13 +98,12 @@ template<class I> class iter_range {
     I begin() const { return begin_; }
     I end() const { return end_; }
     bool empty() const { return begin_ == end_; }
+    
   private:
     I begin_, end_;
 };
 
-} // namespace internal
-///@endcond
-
-} // namespace proton
+} // internal
+} // proton
 
-#endif // PROTON_CPP_H
+#endif // PROTON_ENDPOINT_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/error.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/error.hpp b/proton-c/bindings/cpp/include/proton/error.hpp
index 1b77b3f..df4c30e 100644
--- a/proton-c/bindings/cpp/include/proton/error.hpp
+++ b/proton-c/bindings/cpp/include/proton/error.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_EXCEPTIONS_H
-#define PROTON_CPP_EXCEPTIONS_H
+#ifndef PROTON_ERROR_HPP
+#define PROTON_ERROR_HPP
 
 /*
  *
@@ -22,9 +22,9 @@
  *
  */
 
-#include <proton/config.hpp>
-#include <proton/export.hpp>
-#include <proton/value.hpp>
+#include "proton/config.hpp"
+#include "proton/export.hpp"
+#include "proton/value.hpp"
 
 #include <stdexcept>
 #include <string>
@@ -33,27 +33,30 @@ namespace proton {
 
 class value;
 
-/// The base proton error.
+/// The base Proton error.
 ///
 /// All exceptions thrown from functions in the proton namespace are
 /// subclasses of proton::error.
 struct
 PN_CPP_CLASS_EXTERN error : public std::runtime_error {
-    PN_CPP_EXTERN explicit error(const std::string&); ///< Construct with message
+    /// Construct the error with a message.
+    PN_CPP_EXTERN explicit error(const std::string&);
 };
 
-/// Raised if a timeout expires.
+/// An operation timed out.
 struct
 PN_CPP_CLASS_EXTERN timeout_error : public error {
-    PN_CPP_EXTERN explicit timeout_error(const std::string&);  ///< Construct with message
+    /// Construct the error with a message.
+    PN_CPP_EXTERN explicit timeout_error(const std::string&);
 };
 
-/// Raised if there is an error converting between AMQP and C++ data.
+/// An error converting between AMQP and C++ data.
 struct
 PN_CPP_CLASS_EXTERN conversion_error : public error {
-    PN_CPP_EXTERN explicit conversion_error(const std::string&);  ///< Construct with message
+    /// Construct the error with a message.
+    PN_CPP_EXTERN explicit conversion_error(const std::string&);
 };
 
-}
+} // proton
 
-#endif // PROTON_CPP_EXCEPTIONS_H
+#endif // PROTON_ERROR_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/error_condition.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/error_condition.hpp b/proton-c/bindings/cpp/include/proton/error_condition.hpp
index 232c4fd..10ffeba 100644
--- a/proton-c/bindings/cpp/include/proton/error_condition.hpp
+++ b/proton-c/bindings/cpp/include/proton/error_condition.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_ERROR_CONDITION_H
-#define PROTON_CPP_ERROR_CONDITION_H
+#ifndef PROTON_ERROR_CONDITION_H
+#define PROTON_ERROR_CONDITION_H
 
 /*
  *
@@ -24,7 +24,6 @@
 
 #include "proton/export.hpp"
 #include "proton/value.hpp"
-
 #include "proton/config.hpp"
 
 #include <string>
@@ -41,13 +40,18 @@ class error_condition {
     /// @endcond
 
   public:
+    /// Create an empty error condition.
     error_condition() {}
-    /// Construct an error condition with only a description - in this case a default
-    /// name will be used ("proton:io:error")
+
+    /// Create an error condition with only a description. A default
+    /// name will be used ("proton:io:error").
     PN_CPP_EXTERN error_condition(std::string description);
-    /// Construct an error_condition with a name and a description
+
+    /// Create an error condition with a name and description.
     PN_CPP_EXTERN error_condition(std::string name, std::string description);
-    /// Construct an error_condition with name, description and some informational properties
+
+    /// **Experimental** - Create an error condition with name,
+    /// description, and informational properties.
     PN_CPP_EXTERN error_condition(std::string name, std::string description, proton::value properties);
 
 #if PN_CPP_HAS_DEFAULTED_FUNCTIONS
@@ -57,8 +61,9 @@ class error_condition {
     error_condition& operator=(error_condition&&) = default;
 #endif
 
-    /// If you are using a C++11 compiler you may use an error_condition
-    /// in boolean contexts and the expression will be true if the error_condition is set
+    /// If you are using a C++11 compiler, you may use an
+    /// error_condition in boolean contexts. The expression will be
+    /// true if the error_condition is set.
 #if PN_CPP_HAS_EXPLICIT_CONVERSIONS
     PN_CPP_EXTERN explicit operator bool() const;
 #endif
@@ -81,20 +86,22 @@ class error_condition {
     /// Simple printable string for condition.
     PN_CPP_EXTERN std::string what() const;
 
-    /// @cond INTERNAL
   private:
     std::string name_;
     std::string description_;
     proton::value properties_;
 
-    friend class internal::factory<error_condition>;
+    /// @cond INTERNAL
+  friend class internal::factory<error_condition>;
     /// @endcond
 };
 
+/// @cond INTERNAL
+// XXX Document these 
 PN_CPP_EXTERN bool operator==(const error_condition& x, const error_condition& y);
-
 PN_CPP_EXTERN std::ostream& operator<<(std::ostream& o, const error_condition& err);
+/// @endcond
 
-}
+} // proton
 
-#endif // PROTON_CPP_ERROR_CONDITION_H
+#endif // PROTON_ERROR_CONDITION_H

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/event_loop.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/event_loop.hpp b/proton-c/bindings/cpp/include/proton/event_loop.hpp
index ad358c8..9b3d69a 100644
--- a/proton-c/bindings/cpp/include/proton/event_loop.hpp
+++ b/proton-c/bindings/cpp/include/proton/event_loop.hpp
@@ -1,7 +1,8 @@
-#ifndef PROTON_IO_EVENT_LOOP_HPP
-#define PROTON_IO_EVENT_LOOP_HPP
+#ifndef PROTON_EVENT_LOOP_HPP
+#define PROTON_EVENT_LOOP_HPP
 
 /*
+ *
  * 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
@@ -18,9 +19,10 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
+ *
  */
 
-#include <proton/config.hpp>
+#include "proton/config.hpp"
 
 #include <functional>
 
@@ -37,35 +39,46 @@ namespace proton {
 
 // FIXME aconway 2016-05-04: doc
 
+/// **Experimental** - A handler for injected code.
 class inject_handler {
   public:
     virtual ~inject_handler() {}
+
+    // XXX I feel like the name of this isn't quite right.  The event
+    // isn't injection, it's execution.
+    /// The code is executed.
     virtual void on_inject() = 0;
 };
 
+/// **Experimental** - A serial execution context.
 class PN_CPP_CLASS_EXTERN event_loop {
- public:
+  public:
     virtual ~event_loop() {}
 
     // FIXME aconway 2016-05-05: doc, note bool return not throw because no
     // atomic way to determine closd status and throw during shutdown is bad.
+    /// Send code to the event loop for execution.
     virtual bool inject(inject_handler&) = 0;
+
 #if PN_CPP_HAS_CPP11
+    /// Send code to the event loop for execution.
     virtual bool inject(std::function<void()>) = 0;
 #endif
 
- protected:
+  protected:
     event_loop() {}
 
- private:
+  private:
     PN_CPP_EXTERN static event_loop* get(pn_connection_t*);
     PN_CPP_EXTERN static event_loop* get(pn_session_t*);
     PN_CPP_EXTERN static event_loop* get(pn_link_t*);
 
+    /// @cond INTERNAL
   friend class connection;
- template <class T> friend class thread_safe;
+  template <class T> friend class thread_safe;
+    /// @endcond
 };
 
-}
+} // proton
 
-#endif // PROTON_IO_EVENT_LOOP_HPP
+#endif // PROTON_EVENT_LOOP_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/export.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/export.hpp b/proton-c/bindings/cpp/include/proton/export.hpp
index 788235f..8dc1204 100644
--- a/proton-c/bindings/cpp/include/proton/export.hpp
+++ b/proton-c/bindings/cpp/include/proton/export.hpp
@@ -1,5 +1,5 @@
-#ifndef PN_CPP_IMPORTEXPORT_H
-#define PN_CPP_IMPORTEXPORT_H
+#ifndef PROTON_EXPORT_HPP
+#define PROTON_EXPORT_HPP
 
 /*
  *
@@ -54,4 +54,4 @@
 
 /// @endcond
 
-#endif // PN_CPP_IMPORTEXPORT_H
+#endif // PROTON_EXPORT_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/forward_list.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/forward_list.hpp b/proton-c/bindings/cpp/include/proton/forward_list.hpp
deleted file mode 100644
index 00e3b2c..0000000
--- a/proton-c/bindings/cpp/include/proton/forward_list.hpp
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef PROTON_FORWARD_LIST_HPP
-#define PROTON_FORWARD_LIST_HPP
-/*
- * 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 <forward_list>
-#include <utility>
-
-#include <proton/encoder.hpp>
-#include <proton/decoder.hpp>
-
-namespace proton {
-namespace codec {
-/// std::forward_list<T> for most T is encoded as an AMQP array.
-template <class T, class A>
-encoder& operator<<(encoder& e, const std::forward_list<T, A>& x) {
-    return e << encoder::array(x, internal::type_id_of<T>::value);
-}
-
-/// Specialize for std::forward_list<value>, encode as AMQP forward_list (variable type)
-template <class A>
-encoder& operator<<(encoder& e, const std::forward_list<value, A>& x) { return e << encoder::list(x); }
-
-/// Specialize for std::forward_list<scalar>, encode as AMQP list (variable type)
-template <class A>
-encoder& operator<<(encoder& e, const std::forward_list<scalar, A>& x) { return e << encoder::list(x); }
-
-/// Specialize for std::forward_list<std::pair<k,t> >, encode as AMQP map.
-/// Allows control over the order of encoding map entries.
-template <class A, class K, class T>
-encoder& operator<<(encoder& e, const std::forward_list<std::pair<K,T>, A>& x) { return e << encoder::map(x); }
-
-/// Decode to std::forward_list<T> from an amqp::LIST or amqp::ARRAY.
-template <class T, class A> decoder& operator>>(decoder& d, std::forward_list<T, A>& x) { return d >> decoder::sequence(x); }
-
-/// Decode to std::forward_list<std::pair<K, T> from an amqp::MAP.
-template <class A, class K, class T> decoder& operator>>(decoder& d, std::forward_list<std::pair<K, T> , A>& x) { return d >> decoder::pair_sequence(x); }
-
-}
-}
-
-#endif // PROTON_FORWARD_LIST_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/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 c145fed..d367fd4 100644
--- a/proton-c/bindings/cpp/include/proton/handler.hpp
+++ b/proton-c/bindings/cpp/include/proton/handler.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_MESSAGING_HANDLER_H
-#define PROTON_CPP_MESSAGING_HANDLER_H
+#ifndef PROTON_HANDLER_HPP
+#define PROTON_HANDLER_HPP
 
 /*
  *
@@ -23,8 +23,7 @@
  */
 
 #include "proton/export.hpp"
-
-#include "proton/pn_unique_ptr.hpp"
+#include "proton/internal/pn_unique_ptr.hpp"
 
 namespace proton {
 
@@ -45,121 +44,134 @@ namespace io {
 class connection_engine;
 }
 
-/// Callback functions for handling proton events.
+/// A handler for Proton messaging events.
+///
+/// Subclass and override the event-handling member functions.
+///
+/// #### Close and error handling
 ///
-/// Subclass and override event-handling member functions.
+/// There are several objects that have `on_X_close` and `on_X_error`
+/// functions.  They are called as follows:
 ///
-/// Close and error handling: there are several objects that have on_X_close and on_X_error functions.
-/// They are called as follows:
+/// - If `X` is closed cleanly, with no error status, then `on_X_close`
+///   is called.
+/// - If `X` is closed with an error, then `on_X_error` is called,
+///   followed by `on_X_close`. The error condition is also available
+///   in `on_X_close` from `X::condition()`.
 ///
-/// - If X is closed cleanly, with no error status then on_X_close() is called.
-/// - If X is closed with an error then on_X_error() is called followed by on_X_close()
-///   Note the error condition is also available in on_X_close from X::condition().
+/// By default, if you do not implement `on_X_error`, it will call
+/// `on_error`.  If you do not implement `on_error` it will throw a
+/// @ref proton::error exception, which may not be what you want but
+/// does help to identify forgotten error handling quickly.
 ///
-/// By default, if you do not implement on_X_error, it will call
-/// on_unhandled_error().  If you do not implement on_unhandled_error() it will
-/// throw a proton::error exception, which may not be what you want but does
-/// help to identify forgotten error handling quickly.
+/// #### Resource cleanup
 ///
-/// @see proton::event
+/// Every `on_X_open` event is paired with an `on_X_close` event which
+/// can clean up any resources created by the open handler.  In
+/// particular this is still true if an error is reported with an
+/// `on_X_error` event.  The error-handling logic doesn't have to
+/// manage resource clean up.  It can assume that the close event will
+/// be along to handle it.
 class
-PN_CPP_CLASS_EXTERN handler
-{
+PN_CPP_CLASS_EXTERN handler {
   public:
     PN_CPP_EXTERN handler();
     PN_CPP_EXTERN virtual ~handler();
 
-    /// @name Event callbacks
-    ///
-    /// Override these member functions to handle events.
-    ///
-    /// @{
-
     /// The container event loop is starting.
     PN_CPP_EXTERN virtual void on_container_start(container &c);
+
     /// A message is received.
     PN_CPP_EXTERN virtual void on_message(delivery &d, message &m);
+
     /// A message can be sent.
     PN_CPP_EXTERN virtual void on_sendable(sender &s);
 
-    /// Note that every ..._open event is paired with a ..._close event which can clean
-    /// up any resources created by the ..._open handler.
-    /// In particular this is still true if an error is reported with an ..._error event.
-    /// This makes resource management easier so that the error handling logic doesn't also
-    /// have to manage the resource clean up, but can just assume that the close event will
-    /// be along in a minute to handle the clean up.
-
     /// The underlying network transport is open
     PN_CPP_EXTERN virtual void on_transport_open(transport &t);
+    
     /// The underlying network transport has closed.
     PN_CPP_EXTERN virtual void on_transport_close(transport &t);
+
     /// The underlying network transport has closed with an error
     /// condition.
     PN_CPP_EXTERN virtual void on_transport_error(transport &t);
 
     /// The remote peer opened the connection.
     PN_CPP_EXTERN virtual void on_connection_open(connection &c);
+
     /// The remote peer closed the connection.
     PN_CPP_EXTERN virtual void on_connection_close(connection &c);
+
     /// The remote peer closed the connection with an error condition.
     PN_CPP_EXTERN virtual void on_connection_error(connection &c);
 
     /// The remote peer opened the session.
     PN_CPP_EXTERN virtual void on_session_open(session &s);
+
     /// The remote peer closed the session.
     PN_CPP_EXTERN virtual void on_session_close(session &s);
+
     /// The remote peer closed the session with an error condition.
     PN_CPP_EXTERN virtual void on_session_error(session &s);
 
     /// The remote peer opened the link.
     PN_CPP_EXTERN virtual void on_receiver_open(receiver& l);
+
     /// The remote peer closed the link.
     PN_CPP_EXTERN virtual void on_receiver_close(receiver& l);
+
     /// The remote peer closed the link with an error condition.
     PN_CPP_EXTERN virtual void on_receiver_error(receiver& l);
 
     /// The remote peer opened the link.
     PN_CPP_EXTERN virtual void on_sender_open(sender& l);
+
     /// The remote peer closed the link.
     PN_CPP_EXTERN virtual void on_sender_close(sender& l);
+
     /// The remote peer closed the link with an error condition.
     PN_CPP_EXTERN virtual void on_sender_error(sender& l);
 
     /// The receiving peer accepted a transfer.
     PN_CPP_EXTERN virtual void on_tracker_accept(tracker &d);
+
     /// The receiving peer rejected a transfer.
     PN_CPP_EXTERN virtual void on_tracker_reject(tracker &d);
+
     /// The receiving peer released a transfer.
     PN_CPP_EXTERN virtual void on_tracker_release(tracker &d);
+
     /// The receiving peer settled a transfer.
     PN_CPP_EXTERN virtual void on_tracker_settle(tracker &d);
+
     /// The sending peer settled a transfer.
     PN_CPP_EXTERN virtual void on_delivery_settle(delivery &d);
 
     /// The receiving peer has requested a drain of remaining credit.
     PN_CPP_EXTERN virtual void on_sender_drain_start(sender &s);
-    /// The credit outstanding at the time of the call to receiver::drain has been consumed or returned.
+    
+    /// The credit outstanding at the time of the call to
+    /// receiver::drain has been consumed or returned.
     PN_CPP_EXTERN virtual void on_receiver_drain_finish(receiver &r);
 
     /// Fallback error handling.
     PN_CPP_EXTERN virtual void on_error(const error_condition &c);
 
-    /// @}
-
-    /// @cond INTERNAL
   private:
     internal::pn_unique_ptr<messaging_adapter> messaging_adapter_;
 
-    friend class container;
-    friend class container_impl;
-    friend class io::connection_engine;
-    friend class connection_options;
-    friend class receiver_options;
-    friend class sender_options;
-    friend class session_options;
+    /// @cond INTERNAL
+  friend class container;
+  friend class container_impl;
+  friend class io::connection_engine;
+  friend class connection_options;
+  friend class receiver_options;
+  friend class sender_options;
+  friend class session_options;
     /// @endcond
 };
 
-}
+} // proton
 
-#endif // PROTON_CPP_MESSAGING_HANDLER_H
+#endif // PROTON_HANDLER_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/internal/comparable.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/internal/comparable.hpp b/proton-c/bindings/cpp/include/proton/internal/comparable.hpp
new file mode 100644
index 0000000..b93ec4b
--- /dev/null
+++ b/proton-c/bindings/cpp/include/proton/internal/comparable.hpp
@@ -0,0 +1,40 @@
+#ifndef PROTON_INTERNAL_COMPARABLE_HPP
+#define PROTON_INTERNAL_COMPARABLE_HPP
+
+/*
+ *
+ * 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.
+ *
+ */
+
+namespace proton {
+namespace internal {
+
+/// Base class for comparable types with operator< and
+/// operator==. Provides remaining operators.
+template <class T> class comparable {
+    friend bool operator>(const T &a, const T &b) { return b < a; }
+    friend bool operator<=(const T &a, const T &b) { return !(a > b); }
+    friend bool operator>=(const T &a, const T &b) { return !(a < b); }
+    friend bool operator!=(const T &a, const T &b) { return !(a == b); }
+};
+
+} // internal
+} // proton
+
+#endif // PROTON_INTERNAL_COMPARABLE_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/internal/object.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/internal/object.hpp b/proton-c/bindings/cpp/include/proton/internal/object.hpp
new file mode 100644
index 0000000..4ca7e0a
--- /dev/null
+++ b/proton-c/bindings/cpp/include/proton/internal/object.hpp
@@ -0,0 +1,108 @@
+#ifndef PROTON_INTERNAL_OBJECT_HPP
+#define PROTON_INTERNAL_OBJECT_HPP
+
+/*
+ *
+ * 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/config.hpp"
+#include "proton/export.hpp"
+#include "proton/internal/comparable.hpp"
+
+#include <memory>
+
+namespace proton {
+
+template <class T> class thread_safe;
+
+namespace internal {
+
+class pn_ptr_base {
+  protected:
+    PN_CPP_EXTERN static void incref(void* p);
+    PN_CPP_EXTERN static void decref(void* p);
+};
+
+template <class T> class pn_ptr : private pn_ptr_base, private comparable<pn_ptr<T> > {
+  public:
+    pn_ptr() : ptr_(0) {}
+    pn_ptr(T* p) : ptr_(p) { incref(ptr_); }
+    pn_ptr(const pn_ptr& o) : ptr_(o.ptr_) { incref(ptr_); }
+
+#if PN_CPP_HAS_RVALUE_REFERENCES
+    pn_ptr(pn_ptr&& o) : ptr_(0) { std::swap(ptr_, o.ptr_); }
+#endif
+
+    ~pn_ptr() { decref(ptr_); }
+
+    pn_ptr& operator=(pn_ptr o) { std::swap(ptr_, o.ptr_); return *this; }
+
+    T* get() const { return ptr_; }
+    T* release() { T *p = ptr_; ptr_ = 0; return p; }
+
+    bool operator!() const { return !ptr_; }
+
+#if PN_CPP_HAS_EXPLICIT_CONVERSIONS
+    explicit operator bool() const { return !!ptr_; }
+#endif
+
+    static pn_ptr take_ownership(T* p) { return pn_ptr<T>(p, true); }
+
+  private:
+    T *ptr_;
+
+    // Note that it is the presence of the bool in the constructor signature that matters
+    // to get the "transfer ownership" constructor: The value of the bool isn't checked.
+    pn_ptr(T* p, bool) : ptr_(p) {}
+
+    friend bool operator==(const pn_ptr& a, const pn_ptr& b) { return a.ptr_ == b.ptr_; }
+    friend bool operator<(const pn_ptr& a, const pn_ptr& b) { return a.ptr_ < b.ptr_; }
+};
+
+template <class T> pn_ptr<T> take_ownership(T* p) { return pn_ptr<T>::take_ownership(p); }
+
+/// Base class for proton object types.
+template <class T> class object : private comparable<object<T> > {
+  public:
+    bool operator!() const { return !object_; }
+#if PN_CPP_HAS_EXPLICIT_CONVERSIONS
+    explicit operator bool() const { return object_; }
+#endif
+
+  protected:
+    typedef T pn_type;
+    object(pn_ptr<T> o) : object_(o) {}
+    T* pn_object() const { return object_.get(); }
+
+  private:
+    pn_ptr<T> object_;
+
+    friend bool operator==(const object& a, const object& b) { return a.object_ == b.object_; }
+    friend bool operator<(const object& a, const object& b) { return a.object_ < b.object_; }
+  template <class U> friend class proton::thread_safe;
+};
+
+/// Factory class used internally to make wrappers and extract proton objects
+template <class T> class factory;
+
+} // internal
+} // proton
+
+#endif // PROTON_INTERNAL_OBJECT_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/internal/pn_unique_ptr.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/internal/pn_unique_ptr.hpp b/proton-c/bindings/cpp/include/proton/internal/pn_unique_ptr.hpp
new file mode 100644
index 0000000..b14b442
--- /dev/null
+++ b/proton-c/bindings/cpp/include/proton/internal/pn_unique_ptr.hpp
@@ -0,0 +1,68 @@
+#ifndef PROTON_INTERNAL_UNIQUE_PTR_HPP
+#define PROTON_INTERNAL_UNIQUE_PTR_HPP
+
+/*
+ *
+ * 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/config.hpp"
+
+#include <memory>
+
+namespace proton {
+namespace internal {
+
+/// A simple unique ownership pointer, used as a return value from
+/// functions that transfer ownership to the caller.
+///
+/// pn_unique_ptr return values should be converted immediately to
+/// std::unique_ptr if that is available or std::auto_ptr (by calling
+/// release()) for older C++. You should not use pn_unique_ptr in your
+/// own code.  It is a limited pointer class designed only to work
+/// around differences between C++11 and C++03.
+template <class T> class pn_unique_ptr {
+  public:
+    pn_unique_ptr(T* p=0) : ptr_(p) {}
+#if PN_CPP_HAS_RVALUE_REFERENCES
+    pn_unique_ptr(pn_unique_ptr&& x) : ptr_(0)  { std::swap(ptr_, x.ptr_); }
+#else
+    pn_unique_ptr(const pn_unique_ptr& x) : ptr_() { std::swap(ptr_, const_cast<pn_unique_ptr&>(x).ptr_); }
+#endif
+    ~pn_unique_ptr() { delete(ptr_); }
+    T& operator*() const { return *ptr_; }
+    T* operator->() const { return ptr_; }
+    T* get() const { return ptr_; }
+    void reset(T* p = 0) { pn_unique_ptr<T> tmp(p); std::swap(ptr_, tmp.ptr_); }
+    T* release() { T *p = ptr_; ptr_ = 0; return p; }
+    operator bool() const { return get(); }
+    bool operator !() const { return get(); }
+
+#if PN_CPP_HAS_STD_PTR
+    operator std::unique_ptr<T>() { T *p = ptr_; ptr_ = 0; return std::unique_ptr<T>(p); }
+#endif
+
+  private:
+    T* ptr_;
+};
+
+} // internal
+} // proton
+
+#endif // PROTON_INTERNAL_UNIQUE_PTR_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/internal/scalar_base.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/internal/scalar_base.hpp b/proton-c/bindings/cpp/include/proton/internal/scalar_base.hpp
new file mode 100644
index 0000000..b68daf4
--- /dev/null
+++ b/proton-c/bindings/cpp/include/proton/internal/scalar_base.hpp
@@ -0,0 +1,181 @@
+#ifndef PROTON_INTERNAL_SCALAR_BASE_HPP
+#define PROTON_INTERNAL_SCALAR_BASE_HPP
+
+/*
+ *
+ * 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/binary.hpp"
+#include "proton/decimal.hpp"
+#include "proton/error.hpp"
+#include "proton/export.hpp"
+#include "proton/internal/comparable.hpp"
+#include "proton/internal/type_traits.hpp"
+#include "proton/symbol.hpp"
+#include "proton/timestamp.hpp"
+#include "proton/type_id.hpp"
+#include "proton/types_fwd.hpp"
+#include "proton/uuid.hpp"
+
+#include <iosfwd>
+#include <string>
+
+namespace proton {
+class message;
+
+namespace codec {
+class decoder;
+class encoder;
+}
+
+namespace internal {
+
+/// Base class for scalar types.
+class scalar_base : private comparable<scalar_base> {
+  public:
+    /// AMQP type of data stored in the scalar
+    PN_CPP_EXTERN type_id type() const;
+
+    // XXX I don't think many folks ever used this stuff.  Let's
+    // remove it. - Yes, try to remove them.
+    /// @cond INTERNAL
+    /// deprecated
+    template <class T> void get(T& x) const { get_(x); }
+    template <class T> T get() const { T x; get_(x); return x; }
+    /// @endcond
+
+    /// Compare
+  friend PN_CPP_EXTERN bool operator<(const scalar_base& x, const scalar_base& y);
+    /// Compare
+  friend PN_CPP_EXTERN bool operator==(const scalar_base& x, const scalar_base& y);
+    /// Print the contained value
+  friend PN_CPP_EXTERN std::ostream& operator<<(std::ostream& o, const scalar_base& x);
+
+  protected:
+    PN_CPP_EXTERN scalar_base(const pn_atom_t& a);
+    PN_CPP_EXTERN scalar_base();
+    PN_CPP_EXTERN scalar_base(const scalar_base&);
+    PN_CPP_EXTERN scalar_base& operator=(const scalar_base&);
+
+    PN_CPP_EXTERN void put_(bool);
+    PN_CPP_EXTERN void put_(uint8_t);
+    PN_CPP_EXTERN void put_(int8_t);
+    PN_CPP_EXTERN void put_(uint16_t);
+    PN_CPP_EXTERN void put_(int16_t);
+    PN_CPP_EXTERN void put_(uint32_t);
+    PN_CPP_EXTERN void put_(int32_t);
+    PN_CPP_EXTERN void put_(uint64_t);
+    PN_CPP_EXTERN void put_(int64_t);
+    PN_CPP_EXTERN void put_(wchar_t);
+    PN_CPP_EXTERN void put_(float);
+    PN_CPP_EXTERN void put_(double);
+    PN_CPP_EXTERN void put_(timestamp);
+    PN_CPP_EXTERN void put_(const decimal32&);
+    PN_CPP_EXTERN void put_(const decimal64&);
+    PN_CPP_EXTERN void put_(const decimal128&);
+    PN_CPP_EXTERN void put_(const uuid&);
+    PN_CPP_EXTERN void put_(const std::string&);
+    PN_CPP_EXTERN void put_(const symbol&);
+    PN_CPP_EXTERN void put_(const binary&);
+    PN_CPP_EXTERN void put_(const char* s); ///< Treated as an AMQP string
+    PN_CPP_EXTERN void put_(const null&);
+
+    PN_CPP_EXTERN void get_(bool&) const;
+    PN_CPP_EXTERN void get_(uint8_t&) const;
+    PN_CPP_EXTERN void get_(int8_t&) const;
+    PN_CPP_EXTERN void get_(uint16_t&) const;
+    PN_CPP_EXTERN void get_(int16_t&) const;
+    PN_CPP_EXTERN void get_(uint32_t&) const;
+    PN_CPP_EXTERN void get_(int32_t&) const;
+    PN_CPP_EXTERN void get_(uint64_t&) const;
+    PN_CPP_EXTERN void get_(int64_t&) const;
+    PN_CPP_EXTERN void get_(wchar_t&) const;
+    PN_CPP_EXTERN void get_(float&) const;
+    PN_CPP_EXTERN void get_(double&) const;
+    PN_CPP_EXTERN void get_(timestamp&) const;
+    PN_CPP_EXTERN void get_(decimal32&) const;
+    PN_CPP_EXTERN void get_(decimal64&) const;
+    PN_CPP_EXTERN void get_(decimal128&) const;
+    PN_CPP_EXTERN void get_(uuid&) const;
+    PN_CPP_EXTERN void get_(std::string&) const;
+    PN_CPP_EXTERN void get_(symbol&) const;
+    PN_CPP_EXTERN void get_(binary&) const;
+    PN_CPP_EXTERN void get_(null&) const;
+
+  private:
+    void ok(pn_type_t) const;
+    void set(const pn_atom_t&);
+    void set(const binary& x, pn_type_t t);
+
+    pn_atom_t atom_;
+    binary bytes_; // Hold binary data.
+
+    /// @cond INTERNAL
+  friend class proton::message;
+  friend class codec::encoder;
+  friend class codec::decoder;
+    /// @endcond
+};
+
+template<class T> T get(const scalar_base& s) { T x; s.get(x); return x; }
+
+template <class R, class F> R visit(const scalar_base& s, F f) {
+    switch(s.type()) {
+      case BOOLEAN: return f(s.get<bool>());
+      case UBYTE: return f(s.get<uint8_t>());
+      case BYTE: return f(s.get<int8_t>());
+      case USHORT: return f(s.get<uint16_t>());
+      case SHORT: return f(s.get<int16_t>());
+      case UINT: return f(s.get<uint32_t>());
+      case INT: return f(s.get<int32_t>());
+      case CHAR: return f(s.get<wchar_t>());
+      case ULONG: return f(s.get<uint64_t>());
+      case LONG: return f(s.get<int64_t>());
+      case TIMESTAMP: return f(s.get<timestamp>());
+      case FLOAT: return f(s.get<float>());
+      case DOUBLE: return f(s.get<double>());
+      case DECIMAL32: return f(s.get<decimal32>());
+      case DECIMAL64: return f(s.get<decimal64>());
+      case DECIMAL128: return f(s.get<decimal128>());
+      case UUID: return f(s.get<uuid>());
+      case BINARY: return f(s.get<binary>());
+      case STRING: return f(s.get<std::string>());
+      case SYMBOL: return f(s.get<symbol>());
+      default: throw conversion_error("invalid scalar type "+type_name(s.type()));
+    }
+}
+
+template<class T> struct coerce_op {
+    template <class U>
+    typename enable_if<is_convertible<U, T>::value, T>::type operator()(const U& x) {
+        return static_cast<T>(x);
+    }
+    template <class U>
+    typename enable_if<!is_convertible<U, T>::value, T>::type operator()(const U&) {
+        throw conversion_error("cannot coerce from " + type_name(type_id_of<U>::value));
+    }
+};
+
+template <class T> T coerce(const scalar_base& s) { return visit<T>(s, coerce_op<T>()); }
+
+} // internal
+} // proton
+
+#endif // PROTON_INTERNAL_SCALAR_BASE_HPP


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


[2/4] qpid-proton git commit: PROTON-1200: Improve C++ binding documentation and header formatting

Posted by jr...@apache.org.
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/internal/type_traits.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/internal/type_traits.hpp b/proton-c/bindings/cpp/include/proton/internal/type_traits.hpp
new file mode 100644
index 0000000..3798cee
--- /dev/null
+++ b/proton-c/bindings/cpp/include/proton/internal/type_traits.hpp
@@ -0,0 +1,153 @@
+#ifndef PROTON_INTERNAL_TYPE_TRAITS_HPP
+#define PROTON_INTERNAL_TYPE_TRAITS_HPP
+
+/*
+ *
+ * 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.
+ *
+ */
+
+/// @file
+///
+/// Internal: Type traits for mapping between AMQP and C++ types.
+///
+/// Also provides workarounds for missing type_traits classes on older
+/// C++ compilers.
+
+#include "proton/config.hpp"
+#include "proton/types_fwd.hpp"
+#include "proton/type_id.hpp"
+
+namespace proton {
+namespace internal {
+
+class decoder;
+class encoder;
+
+template <bool, class T=void> struct enable_if {};
+template <class T> struct enable_if<true, T> { typedef T type; };
+
+struct true_type { static const bool value = true; };
+struct false_type { static const bool value = false; };
+
+template <class T> struct is_integral : public false_type {};
+template <class T> struct is_signed : public false_type {};
+
+template <> struct is_integral<char> : public true_type {};
+template <> struct is_signed<char> : public false_type {};
+
+template <> struct is_integral<unsigned char> : public true_type {};
+template <> struct is_integral<unsigned short> : public true_type {};
+template <> struct is_integral<unsigned int> : public true_type {};
+template <> struct is_integral<unsigned long> : public true_type {};
+
+template <> struct is_integral<signed char> : public true_type {};
+template <> struct is_integral<signed short> : public true_type {};
+template <> struct is_integral<signed int> : public true_type {};
+template <> struct is_integral<signed long> : public true_type {};
+
+template <> struct is_signed<unsigned short> : public false_type {};
+template <> struct is_signed<unsigned int> : public false_type {};
+template <> struct is_signed<unsigned long> : public false_type {};
+
+template <> struct is_signed<signed char> : public true_type {};
+template <> struct is_signed<signed short> : public true_type {};
+template <> struct is_signed<signed int> : public true_type {};
+template <> struct is_signed<signed long> : public true_type {};
+
+#if PN_CPP_HAS_LONG_LONG
+template <> struct is_integral<unsigned long long> : public true_type {};
+template <> struct is_integral<signed long long> : public true_type {};
+template <> struct is_signed<unsigned long long> : public false_type {};
+template <> struct is_signed<signed long long> : public true_type {};
+#endif
+
+template <class T, class U> struct is_same { static const bool value=false; };
+template <class T> struct is_same<T,T> { static const bool value=true; };
+
+template< class T > struct remove_const          { typedef T type; };
+template< class T > struct remove_const<const T> { typedef T type; };
+
+template <type_id ID, class T> struct type_id_constant {
+    typedef T type;
+    static const type_id value = ID;
+};
+
+/// @name Metafunction returning AMQP type for scalar C++ types.
+/// @{
+template <class T> struct type_id_of;
+template<> struct type_id_of<bool> : public type_id_constant<BOOLEAN, bool> {};
+template<> struct type_id_of<uint8_t> : public type_id_constant<UBYTE, uint8_t> {};
+template<> struct type_id_of<int8_t> : public type_id_constant<BYTE, int8_t> {};
+template<> struct type_id_of<uint16_t> : public type_id_constant<USHORT, uint16_t> {};
+template<> struct type_id_of<int16_t> : public type_id_constant<SHORT, int16_t> {};
+template<> struct type_id_of<uint32_t> : public type_id_constant<UINT, uint32_t> {};
+template<> struct type_id_of<int32_t> : public type_id_constant<INT, int32_t> {};
+template<> struct type_id_of<uint64_t> : public type_id_constant<ULONG, uint64_t> {};
+template<> struct type_id_of<int64_t> : public type_id_constant<LONG, int64_t> {};
+template<> struct type_id_of<wchar_t> : public type_id_constant<CHAR, wchar_t> {};
+template<> struct type_id_of<float> : public type_id_constant<FLOAT, float> {};
+template<> struct type_id_of<double> : public type_id_constant<DOUBLE, double> {};
+template<> struct type_id_of<timestamp> : public type_id_constant<TIMESTAMP, timestamp> {};
+template<> struct type_id_of<decimal32> : public type_id_constant<DECIMAL32, decimal32> {};
+template<> struct type_id_of<decimal64> : public type_id_constant<DECIMAL64, decimal64> {};
+template<> struct type_id_of<decimal128> : public type_id_constant<DECIMAL128, decimal128> {};
+template<> struct type_id_of<uuid> : public type_id_constant<UUID, uuid> {};
+template<> struct type_id_of<std::string> : public type_id_constant<STRING, std::string> {};
+template<> struct type_id_of<symbol> : public type_id_constant<SYMBOL, symbol> {};
+template<> struct type_id_of<binary> : public type_id_constant<BINARY, binary> {};
+/// @}
+
+/// Metafunction to test if a class has a type_id.
+template <class T, class Enable=void> struct has_type_id : public false_type {};
+template <class T> struct has_type_id<T, typename type_id_of<T>::type>  : public true_type {};
+
+// Map arbitrary integral types to known AMQP integral types.
+template<size_t SIZE, bool IS_SIGNED> struct integer_type;
+template<> struct integer_type<1, true> { typedef int8_t type; };
+template<> struct integer_type<2, true> { typedef int16_t type; };
+template<> struct integer_type<4, true> { typedef int32_t type; };
+template<> struct integer_type<8, true> { typedef int64_t type; };
+template<> struct integer_type<1, false> { typedef uint8_t type; };
+template<> struct integer_type<2, false> { typedef uint16_t type; };
+template<> struct integer_type<4, false> { typedef uint32_t type; };
+template<> struct integer_type<8, false> { typedef uint64_t type; };
+
+// True if T is an integer type that does not have an explicit type_id.
+template <class T> struct is_unknown_integer {
+    static const bool value = !has_type_id<T>::value && is_integral<T>::value;
+};
+
+// Helper base for SFINAE test templates.
+struct sfinae {
+    typedef char yes;
+    typedef double no;
+    struct wildcard { wildcard(...); };
+};
+
+template <class From, class To> struct is_convertible : public sfinae {
+    static yes test(const To&);
+    static no test(...);
+    static const From& from;
+    static bool const value = sizeof(test(from)) == sizeof(yes);
+};
+
+} // internal
+} // proton
+
+#endif // PROTON_INTERNAL_TYPE_TRAITS_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/io/connection_engine.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/io/connection_engine.hpp b/proton-c/bindings/cpp/include/proton/io/connection_engine.hpp
index 8b8838f..c66db5e 100644
--- a/proton-c/bindings/cpp/include/proton/io/connection_engine.hpp
+++ b/proton-c/bindings/cpp/include/proton/io/connection_engine.hpp
@@ -1,7 +1,8 @@
-#ifndef CONNECTION_ENGINE_HPP
-#define CONNECTION_ENGINE_HPP
+#ifndef PROTON_IO_CONNECTION_ENGINE_HPP
+#define PROTON_IO_CONNECTION_ENGINE_HPP
 
 /*
+ *
  * 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
@@ -18,6 +19,7 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
+ *
  */
 
 #include "proton/config.hpp"
@@ -26,7 +28,7 @@
 #include "proton/error.hpp"
 #include "proton/error_condition.hpp"
 #include "proton/export.hpp"
-#include "proton/pn_unique_ptr.hpp"
+#include "proton/internal/pn_unique_ptr.hpp"
 #include "proton/transport.hpp"
 #include "proton/types.hpp"
 
@@ -43,26 +45,11 @@ class proton_handler;
 
 // FIXME aconway 2016-05-04: doc
 
-/** @page integration
-
-This namespace contains a low-level "Service Provider Interface" that can be
-used to implement the proton API over any native or 3rd party IO library.
-
-The io::connection_engine is the core engine that converts raw AMQP bytes read
-from any IO source into proton::handler event calls, and generates AMQP
-byte-encoded output that can be written to any IO destination.
-
-The integration needs to implement two user-visible interfaces:
- - proton::container lets the user initiate or listen for connections.
- - proton::event_loop lets the user serialize their own work with a connection.
-
- @see epoll_container.cpp for an example of an integration.
-*/
 namespace io {
 
 class link_namer;
 
-/// Pointer to a mutable memory region with a size.
+/// **Experimental** - Pointer to a mutable memory region with a size.
 struct mutable_buffer {
     char* data;                 ///< Beginning of the buffered data.
     size_t size;                ///< Number of bytes in the buffer.
@@ -71,7 +58,7 @@ struct mutable_buffer {
     mutable_buffer(char* data_=0, size_t size_=0) : data(data_), size(size_) {}
 };
 
-/// Pointer to a const memory region with a size.
+/// **Experimental** - Pointer to a const memory region with a size.
 struct const_buffer {
     const char* data;           ///< Beginning of the buffered data.
     size_t size;                ///< Number of bytes in the buffer.
@@ -80,34 +67,38 @@ struct const_buffer {
     const_buffer(const char* data_=0, size_t size_=0) : data(data_), size(size_) {}
 };
 
-/// A protocol engine to integrate AMQP into any IO or concurrency framework.
+/// **Experimental** - An AMQP protocol engine for a single
+/// connection.
+///
+/// A connection_engine is a protocol engine that integrates AMQP into
+/// any IO or concurrency framework.
 ///
 /// io::connection_engine manages a single proton::connection and dispatches
 /// events to a proton::handler. It does no IO of its own, but allows you to
 /// integrate AMQP protocol handling into any IO or concurrency framework.
 ///
-/// The application is coded the same way as for the proton::container. The
-/// application implements a proton::handler to respond to transport,
-/// connection, session, link and message events. With a little care, the same
-/// handler classes can be used for both container and connection_engine, the
-/// \ref broker.cpp example illustrates this.
+/// The application is coded the same way as for the
+/// proton::container. The application implements a
+/// proton::messaging_handler to respond to transport, connection,
+/// session, link, and message events. With a little care, the same
+/// handler classes can be used for both container and
+/// connection_engine. the @ref broker.cpp example illustrates this.
 ///
-/// You need to write the IO code to read AMQP data to the read_buffer(). The
-/// engine parses the AMQP frames. dispatch() calls the appropriate functions on
-/// the applications proton::handler. You write output data from the engines
-/// write_buffer() to your IO.
+/// You need to write the IO code to read AMQP data to the
+/// read_buffer(). The engine parses the AMQP frames. dispatch() calls
+/// the appropriate functions on the applications proton::handler. You
+/// write output data from the engine's write_buffer() to your IO.
 ///
-/// The engine is not safe for concurrent use, but you can process different
-/// engines concurrently. A common pattern for high-performance servers is to
-/// serialize read/write activity per-connection and dispatch in a fixed-size
-/// thread pool.
+/// The engine is not safe for concurrent use, but you can process
+/// different engines concurrently. A common pattern for
+/// high-performance servers is to serialize read/write activity
+/// per connection and dispatch in a fixed-size thread pool.
 ///
-/// The engine is designed to work with a classic reactor (e.g. select, poll,
-/// epoll) or an async-request driven proactor (e.g. windows completion ports,
-/// boost.asio, libuv etc.)
+/// The engine is designed to work with a classic reactor (e.g.,
+/// select, poll, epoll) or an async-request driven proactor (e.g.,
+/// windows completion ports, boost.asio, libuv).
 ///
 /// The engine never throws exceptions.
-///
 class
 PN_CPP_CLASS_EXTERN connection_engine {
   public:
@@ -209,6 +200,7 @@ PN_CPP_CLASS_EXTERN connection_engine {
     proton::container& container_;
 };
 
-}}
+} // io
+} // proton
 
-#endif // CONNECTION_ENGINE_HPP
+#endif // PROTON_IO_CONNECTION_ENGINE_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/io/container_impl_base.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/io/container_impl_base.hpp b/proton-c/bindings/cpp/include/proton/io/container_impl_base.hpp
index d3fd74a..858102e 100644
--- a/proton-c/bindings/cpp/include/proton/io/container_impl_base.hpp
+++ b/proton-c/bindings/cpp/include/proton/io/container_impl_base.hpp
@@ -2,6 +2,7 @@
 #define PROTON_IO_CONTAINER_IMPL_BASE_HPP
 
 /*
+ *
  * 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
@@ -18,10 +19,11 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
+ *
  */
 
-#include <proton/io/link_namer.hpp>
-#include <proton/container.hpp>
+#include "proton/io/link_namer.hpp"
+#include "proton/container.hpp"
 
 #include <mutex>
 #include <sstream>
@@ -29,53 +31,70 @@
 namespace proton {
 namespace io {
 
-/// Thread-safe partial implementation of proton::container interface to reduce
-/// boilerplate code in container implementations. Requires C++11.
+/// **Experimental** - A base container implementation.
 ///
-/// You can ignore this class if you want to implement the functions in a
-/// different way.
+/// This is a thread-safe partial implementation of the
+/// proton::container interface to reduce boilerplate code in
+/// container implementations. Requires C++11.
 ///
+/// You can ignore this class if you want to implement the functions
+/// in a different way.
 class container_impl_base : public container {
   public:
-
+    /// @copydoc container::client_connection_options
     void client_connection_options(const connection_options & opts) {
         store(client_copts_, opts);
     }
+    
+    /// @copydoc container::client_connection_options
     connection_options client_connection_options() const {
         return load(client_copts_);
     }
+    
+    /// @copydoc container::server_connection_options
     void server_connection_options(const connection_options & opts) {
         store(server_copts_, opts);
     }
+    
+    /// @copydoc container::server_connection_options
     connection_options server_connection_options() const {
         return load(server_copts_);
     }
+    
+    /// @copydoc container::sender_options
     void sender_options(const class sender_options & opts) {
         store(sender_opts_, opts);
     }
+    
+    /// @copydoc container::sender_options
     class sender_options sender_options() const {
         return load(sender_opts_);
     }
+    
+    /// @copydoc container::receiver_options
     void receiver_options(const class receiver_options & opts) {
         store(receiver_opts_, opts);
     }
+    
+    /// @copydoc container::receiver_options
     class receiver_options receiver_options() const {
         return load(receiver_opts_);
     }
 
+    /// @copydoc container::open_sender
     returned<sender> open_sender(
         const std::string &url, const class sender_options &opts, const connection_options &copts)
     {
         return open_link<sender, class sender_options>(url, opts, copts, &connection::open_sender);
     }
 
+    /// @copydoc container::open_receiver
     returned<receiver> open_receiver(
         const std::string &url, const class receiver_options &opts, const connection_options &copts)
     {
         return open_link<receiver>(url, opts, copts, &connection::open_receiver);
     }
 
-
   private:
     template<class T, class Opts>
     returned<T> open_link(
@@ -115,6 +134,7 @@ class container_impl_base : public container {
     class sender_options sender_opts_;
 };
 
-}}
+} // io
+} // proton
 
 #endif // PROTON_IO_CONTAINER_IMPL_BASE_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/io/link_namer.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/io/link_namer.hpp b/proton-c/bindings/cpp/include/proton/io/link_namer.hpp
index 8add9a3..281503b 100644
--- a/proton-c/bindings/cpp/include/proton/io/link_namer.hpp
+++ b/proton-c/bindings/cpp/include/proton/io/link_namer.hpp
@@ -1,6 +1,8 @@
-#ifndef PROTON_IO_LINK_NAMER
-#define PROTON_IO_LINK_NAMER
+#ifndef PROTON_IO_LINK_NAMER_HPP
+#define PROTON_IO_LINK_NAMER_HPP
+
 /*
+ *
  * 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
@@ -17,6 +19,7 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
+ *
  */
 
 #include <string>
@@ -24,14 +27,18 @@
 namespace proton {
 namespace io {
 
-/// Generate default link names that are unique within a container.
-/// base_container provides a default implementation.
+/// **Experimental** - Generate default link names that are unique
+/// within a container.  base_container provides a default
+/// implementation.
 class link_namer {
   public:
     virtual ~link_namer() {}
+
+    /// Generate a unique link name.
     virtual std::string link_name() = 0;
 };
 
-}}
+} // io
+} // proton
 
-#endif // PROTON_IO_LINK_NAMER
+#endif // PROTON_IO_LINK_NAMER_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/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 1a5347c..6eca93e 100644
--- a/proton-c/bindings/cpp/include/proton/link.hpp
+++ b/proton-c/bindings/cpp/include/proton/link.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_LINK_H
-#define PROTON_CPP_LINK_H
+#ifndef PROTON_LINK_HPP
+#define PROTON_LINK_HPP
 
 /*
  *
@@ -22,16 +22,16 @@
  *
  */
 
-#include <proton/endpoint.hpp>
-#include <proton/export.hpp>
-#include <proton/message.hpp>
-#include <proton/source.hpp>
-#include <proton/target.hpp>
-#include <proton/object.hpp>
-#include <proton/sender_options.hpp>
-#include <proton/receiver_options.hpp>
+#include "proton/endpoint.hpp"
+#include "proton/export.hpp"
+#include "proton/message.hpp"
+#include "proton/source.hpp"
+#include "proton/target.hpp"
+#include "proton/internal/object.hpp"
+#include "proton/sender_options.hpp"
+#include "proton/receiver_options.hpp"
 
-#include <proton/types.h>
+#include "proton/types.h"
 
 #include <string>
 
@@ -60,60 +60,59 @@ PN_CPP_CLASS_EXTERN link : public internal::object<pn_link_t> , public endpoint
     /// @endcond
 
   public:
+    /// Create an empty link.
     link() : internal::object<pn_link_t>(0) {}
 
-    // Endpoint behaviours
     PN_CPP_EXTERN bool uninitialized() const;
     PN_CPP_EXTERN bool active() const;
     PN_CPP_EXTERN bool closed() const;
 
     PN_CPP_EXTERN class error_condition error() const;
 
-    /// Locally close the link.  The operation is not complete till
-    /// handler::on_link_close.
     PN_CPP_EXTERN void close();
-
-    /// Initiate close with an error condition.
-    /// The operation is not complete till handler::on_connection_close().
     PN_CPP_EXTERN void close(const error_condition&);
 
     /// Suspend the link without closing it.  A suspended link may be
-    /// reopened with the same or different link options if supported by
-    /// the peer. A suspended durable subscriptions becomes inactive
+    /// reopened with the same or different link options if supported
+    /// by the peer. A suspended durable subscription becomes inactive
     /// without cancelling it.
+    // XXX Should take error condition
     PN_CPP_EXTERN void detach();
 
     /// Credit available on the link.
     PN_CPP_EXTERN int credit() const;
 
     /// True for a receiver if a drain cycle has been started and the
-    /// corresponding on_receiver_drain_finish event is still pending.
-    /// @see receiver::drain.  True for a sender if the receiver has
-    /// requested a drain of credit and the sender has unused credit.
+    /// corresponding `on_receiver_drain_finish` event is still
+    /// pending.  True for a sender if the receiver has requested a
+    /// drain of credit and the sender has unused credit.
+    ///
+    /// @see @ref receiver::drain. 
     PN_CPP_EXTERN bool draining();
 
     /// Get the link name.
     PN_CPP_EXTERN std::string name() const;
 
-    /// Return the container for this link
+    /// The container for this link.
     PN_CPP_EXTERN class container &container() const;
 
-    /// Connection that owns this link.
+    /// The connection that owns this link.
     PN_CPP_EXTERN class connection connection() const;
 
-    /// Session that owns this link.
+    /// The session that owns this link.
     PN_CPP_EXTERN class session session() const;
 
-    ///@cond INTERNAL
   protected:
-    /// Initiate the AMQP attach frame.  The operation is not complete till
-    /// handler::on_link_open.
+    /// @cond INTERNAL
+    
+    // Initiate the AMQP attach frame.
     void attach();
 
-    friend class internal::factory<link>;
-    ///@endcond
+  friend class internal::factory<link>;
+
+    /// @endcond
 };
 
 }
 
-#endif // PROTON_CPP_LINK_H
+#endif // PROTON_LINK_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/list.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/list.hpp b/proton-c/bindings/cpp/include/proton/list.hpp
deleted file mode 100644
index 1a996a0..0000000
--- a/proton-c/bindings/cpp/include/proton/list.hpp
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef PROTON_LIST_HPP
-#define PROTON_LIST_HPP
-/*
- * 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 <list>
-#include <utility>
-
-#include <proton/encoder.hpp>
-#include <proton/decoder.hpp>
-
-namespace proton {
-namespace codec {
-/// std::list<T> for most T is encoded as an AMQP array.
-template <class T, class A>
-encoder& operator<<(encoder& e, const std::list<T, A>& x) {
-    return e << encoder::array(x, internal::type_id_of<T>::value);
-}
-
-/// Specialize for std::list<value>, encode as AMQP list (variable type)
-template <class A>
-encoder& operator<<(encoder& e, const std::list<value, A>& x) { return e << encoder::list(x); }
-
-/// Specialize for std::list<scalar>, encode as AMQP list (variable type)
-template <class A>
-encoder& operator<<(encoder& e, const std::list<scalar, A>& x) { return e << encoder::list(x); }
-
-/// Specialize for std::list<std::pair<k,t> >, encode as AMQP map.
-/// Allows control over the order of encoding map entries.
-template <class A, class K, class T>
-encoder& operator<<(encoder& e, const std::list<std::pair<K,T>, A>& x) { return e << encoder::map(x); }
-
-/// Decode to std::list<T> from an amqp::LIST or amqp::ARRAY.
-template <class T, class A> decoder& operator>>(decoder& d, std::list<T, A>& x) { return d >> decoder::sequence(x); }
-
-/// Decode to std::list<std::pair<K, T> from an amqp::MAP.
-template <class A, class K, class T> decoder& operator>>(decoder& d, std::list<std::pair<K, T> , A>& x) { return d >> decoder::pair_sequence(x); }
-
-}
-}
-
-#endif // PROTON_LIST_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/listen_handler.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/listen_handler.hpp b/proton-c/bindings/cpp/include/proton/listen_handler.hpp
index f836513..fc2c49e 100644
--- a/proton-c/bindings/cpp/include/proton/listen_handler.hpp
+++ b/proton-c/bindings/cpp/include/proton/listen_handler.hpp
@@ -2,6 +2,7 @@
 #define PROTON_LISTEN_HANDLER_HPP
 
 /*
+ *
  * 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
@@ -18,13 +19,16 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
+ *
  */
 
-
 namespace proton {
 
-/// Implement this interface and pass to proton::container::listen() to be
-/// notified of new connections.
+// XXX Discuss more
+/// **Experimental** - A handler for incoming connections.
+///
+/// Implement this interface and pass to proton::container::listen()
+/// to be notified of new connections.
 class listen_handler {
   public:
     virtual ~listen_handler() {}
@@ -44,7 +48,7 @@ class listen_handler {
     /// Called when this listen_handler is no longer needed, and can be deleted.
     virtual void on_close() {}
 };
-}
 
+} // proton
 
 #endif // PROTON_LISTEN_HANDLER_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/listener.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/listener.hpp b/proton-c/bindings/cpp/include/proton/listener.hpp
index 2441e2b..0cdd7a5 100644
--- a/proton-c/bindings/cpp/include/proton/listener.hpp
+++ b/proton-c/bindings/cpp/include/proton/listener.hpp
@@ -20,7 +20,7 @@
  * under the License.
  */
 
-#include <proton/export.hpp>
+#include "proton/export.hpp"
 
 #include <string>
 
@@ -28,16 +28,18 @@ namespace proton {
 
 class container;
 
-/// Returned by container::listen to allow you to stop listening on that address.
+/// A listener for incoming connections.
 class PN_CPP_CLASS_EXTERN listener {
   public:
+    /// Create an empty listener.
     PN_CPP_EXTERN listener();
-    ///@cond internal
+
+    /// @cond INTERNAL
     PN_CPP_EXTERN listener(container&, const std::string&);
-    ///@endcond internal
+    /// @endcond
 
-    /// Stop listening on the address provided to the call to container::listen that
-    /// returned this listener.
+    /// Stop listening on the address provided to the call to
+    /// container::listen that returned this listener.
     PN_CPP_EXTERN void stop();
 
  private:
@@ -45,7 +47,6 @@ class PN_CPP_CLASS_EXTERN listener {
     container* container_;
 };
 
-
-}
+} // proton
 
 #endif // PROTON_LISTENER_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/map.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/map.hpp b/proton-c/bindings/cpp/include/proton/map.hpp
deleted file mode 100644
index e640bab..0000000
--- a/proton-c/bindings/cpp/include/proton/map.hpp
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef PROTON_MAP_HPP
-#define PROTON_MAP_HPP
-/*
- * 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 <map>
-#include <proton/encoder.hpp>
-#include <proton/decoder.hpp>
-
-namespace proton {
-namespace codec {
-
-/// Encode std::map<K, T> as amqp::MAP.
-template <class K, class T, class C, class A>
-encoder& operator<<(encoder& e, const std::map<K, T, C, A>& m) { return e << encoder::map(m); }
-
-/// Decode to std::map<K, T> from amqp::MAP.
-template <class K, class T, class C, class A>
-decoder& operator>>(decoder& d, std::map<K, T, C, A>& m) { return d >> decoder::associative(m); }
-
-} // internal
-} // proton
-
-#endif // PROTON_MAP_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/message.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/message.hpp b/proton-c/bindings/cpp/include/proton/message.hpp
index 2dbb4ec..a6bc215 100644
--- a/proton-c/bindings/cpp/include/proton/message.hpp
+++ b/proton-c/bindings/cpp/include/proton/message.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_MESSAGE_H
-#define PROTON_CPP_MESSAGE_H
+#ifndef PROTON_MESSAGE_HPP
+#define PROTON_MESSAGE_HPP
 
 /*
  *
@@ -22,13 +22,13 @@
  *
  */
 
-#include <proton/map.hpp>
-#include <proton/annotation_key.hpp>
-#include <proton/duration.hpp>
-#include <proton/export.hpp>
-#include <proton/message_id.hpp>
-#include <proton/pn_unique_ptr.hpp>
-#include <proton/value.hpp>
+#include "proton/annotation_key.hpp"
+#include "proton/codec/map.hpp"
+#include "proton/duration.hpp"
+#include "proton/export.hpp"
+#include "proton/message_id.hpp"
+#include "proton/internal/pn_unique_ptr.hpp"
+#include "proton/value.hpp"
 
 #include <string>
 #include <vector>
@@ -44,13 +44,16 @@ class annotation_key;
 
 /// An AMQP message.
 ///
-/// Value semantics: can be copied or assigned to make a new message.
+/// Value semantics: A message can be copied or assigned to make a new
+/// message.
 class message {
   public:
-    /// A map of string keys and AMQP scalar values.
+    /// **Experimental** - A map of string keys and AMQP scalar
+    /// values.
     typedef std::map<std::string, scalar> property_map;
 
-    /// A map of AMQP annotation keys and AMQP values.
+    /// **Experimental** - A map of AMQP annotation keys and AMQP
+    /// values.
     typedef std::map<annotation_key, value> annotation_map;
 
     /// Create an empty message.
@@ -65,6 +68,8 @@ class message {
 #if PN_CPP_HAS_RVALUE_REFERENCES
     /// Move a message.
     PN_CPP_EXTERN message(message&&);
+
+    /// Move a message.
     PN_CPP_EXTERN message& operator=(message&&);
 #endif
 
@@ -80,10 +85,19 @@ class message {
     /// Clear the message content and properties.
     PN_CPP_EXTERN void clear();
 
+    /// Set the message ID.
+    ///
+    /// The message ID uniquely identifies a message within a
+    /// messaging system.
     PN_CPP_EXTERN void id(const message_id& id);
+
+    /// Get the message ID.
     PN_CPP_EXTERN message_id id() const;
 
+    /// Set the user name or ID.
     PN_CPP_EXTERN void user(const std::string &user);
+
+    /// Get the user name or ID.
     PN_CPP_EXTERN std::string user() const;
 
     /// Encode entire message into a byte vector, growing it if
@@ -101,17 +115,28 @@ class message {
     /// @name Routing
     /// @{
 
+    /// Set the destination address.
     PN_CPP_EXTERN void to(const std::string &addr);
+
+    /// Get the destination address.
     PN_CPP_EXTERN std::string to() const;
 
+    /// @cond INTERNAL
     /// These are aliases for to()
     PN_CPP_EXTERN void address(const std::string &addr);
     PN_CPP_EXTERN std::string address() const;
+    /// @endcond
 
+    /// Set the address for replies.
     PN_CPP_EXTERN void reply_to(const std::string &addr);
-    PN_CPP_EXTERN std::string reply_to() const;
 
+    /// Get the address for replies.
+    PN_CPP_EXTERN std::string reply_to() const;
+    
+    /// Set the ID for matching related messages.
     PN_CPP_EXTERN void correlation_id(const message_id&);
+
+    /// Get the ID for matching related messages.
     PN_CPP_EXTERN message_id correlation_id() const;
 
     /// @}
@@ -119,34 +144,49 @@ class message {
     /// @name Content
     /// @{
 
-    /// Set the body, equivalent to body() = x
+    /// Set the body.  Equivalent to `body() = x`.
     PN_CPP_EXTERN void body(const value& x);
 
     /// Get the body.
     PN_CPP_EXTERN const value& body() const;
 
-    /// Get a reference to the body that can be modified in-place.
+    /// Get a reference to the body that can be modified in place.
     PN_CPP_EXTERN value& body();
 
+    /// Set the subject.
     PN_CPP_EXTERN void subject(const std::string &s);
+
+    /// Get the subject.
     PN_CPP_EXTERN std::string subject() const;
 
+    /// Set the content type of the body.
     PN_CPP_EXTERN void content_type(const std::string &s);
+
+    /// Get the content type of the body.
     PN_CPP_EXTERN std::string content_type() const;
 
+    /// Set the content encoding of the body.
     PN_CPP_EXTERN void content_encoding(const std::string &s);
+
+    /// Get the content encoding of the body.
     PN_CPP_EXTERN std::string content_encoding() const;
 
+    /// Set the expiration time.
     PN_CPP_EXTERN void expiry_time(timestamp t);
+
+    /// Get the expiration time.
     PN_CPP_EXTERN timestamp expiry_time() const;
 
+    /// Set the creation time.
     PN_CPP_EXTERN void creation_time(timestamp t);
+
+    /// Get the creation time.
     PN_CPP_EXTERN timestamp creation_time() const;
 
-    /// Get the inferred flag for a message.
+    /// Get the inferred flag.
     ///
     /// The inferred flag for a message indicates how the message
-    /// content is encoded into AMQP sections. If inferred is true
+    /// content is encoded into AMQP sections. If the inferred is true
     /// then binary and list values in the body of the message will be
     /// encoded as AMQP DATA and AMQP SEQUENCE sections,
     /// respectively. If inferred is false, then all values in the
@@ -154,7 +194,7 @@ class message {
     /// regardless of their type.
     PN_CPP_EXTERN bool inferred() const;
 
-    /// Set the inferred flag for a message.
+    /// Set the inferred flag.
     PN_CPP_EXTERN void inferred(bool);
 
     /// @}
@@ -162,39 +202,38 @@ class message {
     /// @name Transfer headers
     /// @{
 
-    /// Get the durable flag for a message.
+    /// Get the durable flag.
     ///
     /// The durable flag indicates that any parties taking
     /// responsibility for the message must durably store the content.
-    ///
-    /// @return the value of the durable flag
     PN_CPP_EXTERN bool durable() const;
-    /// Set the durable flag for a message.
+
+    /// Set the durable flag.
     PN_CPP_EXTERN void durable(bool);
 
-    /// Get the TTL for a message.
+    /// Get the TTL.
     ///
     /// The TTL (time to live) for a message determines how long a
     /// message is considered live. When a message is held for
     /// retransmit, the TTL is decremented. Once the TTL reaches zero,
     /// the message is considered dead. Once a message is considered
-    /// dead it may be dropped.
+    /// dead, it may be dropped.
     PN_CPP_EXTERN duration ttl() const;
 
-    /// Set the TTL for a message.
+    /// Set the TTL.
     PN_CPP_EXTERN void ttl(duration);
 
-    /// Get the priority for a message.
+    /// Get the priority.
     ///
     /// The priority of a message impacts ordering guarantees. Within
     /// a given ordered context, higher priority messages may jump
     /// ahead of lower priority messages.
     PN_CPP_EXTERN uint8_t priority() const;
 
-    /// Set the priority for a message.
+    /// Set the priority.
     PN_CPP_EXTERN void priority(uint8_t);
 
-    /// Get the first acquirer flag for a message.
+    /// Get the first acquirer flag.
     ///
     /// When set to true, the first acquirer flag for a message
     /// indicates that the recipient of the message is the first
@@ -202,18 +241,21 @@ class message {
     /// failed delivery attempts to other acquirers.  Note that this
     /// does not mean the message has not been delivered to, but not
     /// acquired, by other recipients.
+
+    // XXX The triple-not in the last sentence above is confusing.
+    
     PN_CPP_EXTERN bool first_acquirer() const;
 
-    /// Set the first acquirer flag for a message.
+    /// Set the first acquirer flag.
     PN_CPP_EXTERN void first_acquirer(bool);
 
-    /// Get the delivery count for a message.
+    /// Get the delivery count.
     ///
-    /// The delivery count field tracks how many attempts have been made to
-    /// delivery a message.
+    /// The delivery count field tracks how many attempts have been
+    /// made to deliver a message.
     PN_CPP_EXTERN uint32_t delivery_count() const;
 
-    /// Get the delivery count for a message.
+    /// Get the delivery count.
     PN_CPP_EXTERN void delivery_count(uint32_t);
 
     /// @}
@@ -221,18 +263,25 @@ class message {
     /// @name Message groups
     /// @{
 
+    /// Set the message group ID.
     PN_CPP_EXTERN void group_id(const std::string &s);
+
+    /// Get the message group ID.
     PN_CPP_EXTERN std::string group_id() const;
 
+    /// Set the reply-to group ID.
     PN_CPP_EXTERN void reply_to_group_id(const std::string &s);
+
+    /// Get the reply-to group ID.
     PN_CPP_EXTERN std::string reply_to_group_id() const;
 
-    /// Get the group sequence for a message.
+    /// Get the group sequence.
     ///
     /// The group sequence of a message identifies the relative
     /// ordering of messages within a group. The default value for the
     /// group sequence of a message is zero.
     PN_CPP_EXTERN int32_t group_sequence() const;
+
     /// Set the group sequence for a message.
     PN_CPP_EXTERN void group_sequence(int32_t);
 
@@ -241,16 +290,28 @@ class message {
     /// @name Extended attributes
     /// @{
 
-    /// Application properties map, can be modified in place.
+    /// **Experimental** - Get the application properties map.  It can
+    /// be modified in place.
     PN_CPP_EXTERN property_map& properties();
+
+    /// **Experimental** - Get the application properties map.  It can
+    /// be modified in place.
     PN_CPP_EXTERN const property_map& properties() const;
 
-    /// Message annotations map, can be modified in place.
+    /// **Experimental** - Get the message annotations map.  It can be
+    /// modified in place.
     PN_CPP_EXTERN annotation_map& message_annotations();
+
+    /// **Experimental** - Get the message annotations map.  It can be
+    /// modified in place.
     PN_CPP_EXTERN const annotation_map& message_annotations() const;
 
-    /// Delivery annotations map, can be modified in place.
+    /// **Experimental** - Get the delivery annotations map.  It can
+    /// be modified in place.
     PN_CPP_EXTERN annotation_map& delivery_annotations();
+
+    /// **Experimental** - Get the delivery annotations map.  It can
+    /// be modified in place.
     PN_CPP_EXTERN const annotation_map& delivery_annotations() const;
 
     /// @}
@@ -268,11 +329,11 @@ class message {
     /// Decode the message corresponding to a delivery from a link.
     void decode(proton::delivery);
 
-    PN_CPP_EXTERN friend void swap(message&, message&);
-    friend class messaging_adapter;
+  PN_CPP_EXTERN friend void swap(message&, message&);
+  friend class messaging_adapter;
     /// @endcond
 };
 
-}
+} // proton
 
-#endif // PROTON_CPP_MESSAGE_H
+#endif // PROTON_MESSAGE_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/message_id.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/message_id.hpp b/proton-c/bindings/cpp/include/proton/message_id.hpp
index abf4fe2..59b6f75 100644
--- a/proton-c/bindings/cpp/include/proton/message_id.hpp
+++ b/proton-c/bindings/cpp/include/proton/message_id.hpp
@@ -1,7 +1,8 @@
-#ifndef MESSAGE_ID_HPP
-#define MESSAGE_ID_HPP
+#ifndef PROTON_MESSAGE_ID_HPP
+#define PROTON_MESSAGE_ID_HPP
 
 /*
+ *
  * 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
@@ -18,11 +19,12 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
+ *
  */
 
-#include <proton/binary.hpp>
-#include <proton/scalar_base.hpp>
-#include <proton/uuid.hpp>
+#include "proton/binary.hpp"
+#include "proton/internal/scalar_base.hpp"
+#include "proton/uuid.hpp"
 
 #include <string>
 
@@ -39,10 +41,10 @@ namespace proton {
 ///
 class message_id : public internal::scalar_base {
   public:
-    /// An empty message_id has a uint64_t == 0 value.
+    /// An empty message_id has a uint64_t value set to 0.
     message_id() { put_(uint64_t(0)); }
 
-    /// Construct from any type that can be assigned
+    /// Construct from any type that can be assigned.
     template <class T> message_id(const T& x) { *this = x; }
 
     /// @name Assignment operators
@@ -65,9 +67,10 @@ class message_id : public internal::scalar_base {
     ///@endcond
 };
 
-///@cond internal
+/// @cond INTERNAL
+// XXX Document this?
 template <class T> T get(const message_id& x);
-///@endcond
+/// @endcond
 
 /// Get the uint64_t value or throw conversion_error. @related message_id
 template<> inline uint64_t get<uint64_t>(const message_id& x) { return internal::get<uint64_t>(x); }
@@ -81,5 +84,7 @@ template<> inline std::string get<std::string>(const message_id& x) { return int
 /// @copydoc scalar::coerce
 /// @related message_id
 template<class T> T coerce(const message_id& x) { return internal::coerce<T>(x); }
-}
-#endif // MESSAGE_ID_HPP
+
+} // proton
+
+#endif // PROTON_MESSAGE_ID_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/namespaces.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/namespaces.hpp b/proton-c/bindings/cpp/include/proton/namespaces.hpp
new file mode 100644
index 0000000..62b4913
--- /dev/null
+++ b/proton-c/bindings/cpp/include/proton/namespaces.hpp
@@ -0,0 +1,44 @@
+#ifndef PROTON_NAMESPACES_HPP
+#define PROTON_NAMESPACES_HPP
+
+/*
+ * 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.
+ */
+
+/// The main Proton namespace.
+namespace proton {
+
+/// **Experimental** - AMQP data encoding and decoding.
+///
+/// You can use these classes on an experimental basis to create your
+/// own AMQP encodings for C++ types, but they may change in the
+/// future. For examples of use see the built-in encodings, for
+/// example in proton/vector.hpp or proton/map.hpp
+namespace codec {
+}
+
+/// **Experimental** - An SPI for multithreaded network IO.
+namespace io {
+}
+
+namespace internal {
+}
+
+} // proton
+
+#endif // PROTON_NAMESPACES_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/object.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/object.hpp b/proton-c/bindings/cpp/include/proton/object.hpp
deleted file mode 100644
index e94e4e6..0000000
--- a/proton-c/bindings/cpp/include/proton/object.hpp
+++ /dev/null
@@ -1,108 +0,0 @@
-#ifndef OBJECT_HPP
-#define OBJECT_HPP
-
-/*
- * 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.
- */
-
-/// @cond INTERNAL
-
-#include "proton/config.hpp"
-#include "proton/export.hpp"
-#include "proton/comparable.hpp"
-#include <memory>
-
-namespace proton {
-
-template <class T> class thread_safe;
-
-namespace internal {
-
-class pn_ptr_base {
-  protected:
-    PN_CPP_EXTERN static void incref(void* p);
-    PN_CPP_EXTERN static void decref(void* p);
-};
-
-template <class T> class pn_ptr : private pn_ptr_base, private comparable<pn_ptr<T> > {
-  public:
-    pn_ptr() : ptr_(0) {}
-    pn_ptr(T* p) : ptr_(p) { incref(ptr_); }
-    pn_ptr(const pn_ptr& o) : ptr_(o.ptr_) { incref(ptr_); }
-
-#if PN_CPP_HAS_RVALUE_REFERENCES
-    pn_ptr(pn_ptr&& o) : ptr_(0) { std::swap(ptr_, o.ptr_); }
-#endif
-
-    ~pn_ptr() { decref(ptr_); }
-
-    pn_ptr& operator=(pn_ptr o) { std::swap(ptr_, o.ptr_); return *this; }
-
-    T* get() const { return ptr_; }
-    T* release() { T *p = ptr_; ptr_ = 0; return p; }
-
-    bool operator!() const { return !ptr_; }
-
-#if PN_CPP_HAS_EXPLICIT_CONVERSIONS
-    explicit operator bool() const { return !!ptr_; }
-#endif
-
-    static pn_ptr take_ownership(T* p) { return pn_ptr<T>(p, true); }
-
-  private:
-    T *ptr_;
-
-    // Note that it is the presence of the bool in the constructor signature that matters
-    // to get the "transfer ownership" constructor: The value of the bool isn't checked.
-    pn_ptr(T* p, bool) : ptr_(p) {}
-
-    friend bool operator==(const pn_ptr& a, const pn_ptr& b) { return a.ptr_ == b.ptr_; }
-    friend bool operator<(const pn_ptr& a, const pn_ptr& b) { return a.ptr_ < b.ptr_; }
-};
-
-template <class T> pn_ptr<T> take_ownership(T* p) { return pn_ptr<T>::take_ownership(p); }
-
-/// Base class for proton object types.
-template <class T> class object : private comparable<object<T> > {
-  public:
-    bool operator!() const { return !object_; }
-#if PN_CPP_HAS_EXPLICIT_CONVERSIONS
-    explicit operator bool() const { return object_; }
-#endif
-
-  protected:
-    typedef T pn_type;
-    object(pn_ptr<T> o) : object_(o) {}
-    T* pn_object() const { return object_.get(); }
-
-  private:
-    pn_ptr<T> object_;
-
-    friend bool operator==(const object& a, const object& b) { return a.object_ == b.object_; }
-    friend bool operator<(const object& a, const object& b) { return a.object_ < b.object_; }
-  template <class U> friend class proton::thread_safe;
-};
-
-/// Factory class used internally to make wrappers and extract proton objects
-template <class T> class factory;
-
-}}
-
-/// @endcond
-
-#endif // OBJECT_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/pn_unique_ptr.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/pn_unique_ptr.hpp b/proton-c/bindings/cpp/include/proton/pn_unique_ptr.hpp
deleted file mode 100644
index 56f8aba..0000000
--- a/proton-c/bindings/cpp/include/proton/pn_unique_ptr.hpp
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef UNIQUE_PTR_HPP
-#define UNIQUE_PTR_HPP
-/*
- * 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.
- */
-
-/// @cond INTERNAL
-
-#include "proton/config.hpp"
-#include <memory>
-
-namespace proton {
-namespace internal {
-
-/// A simple unique ownership pointer, used as a return value from
-/// functions that transfer ownership to the caller.
-///
-/// pn_unique_ptr return values should be converted immediately to
-/// std::unique_ptr if that is available or std::auto_ptr (by calling
-/// release()) for older C++. You should not use pn_unique_ptr in your
-/// own code.  It is a limited pointer class designed only to work
-/// around differences between C++11 and C++03.
-template <class T> class pn_unique_ptr {
-  public:
-    pn_unique_ptr(T* p=0) : ptr_(p) {}
-#if PN_CPP_HAS_RVALUE_REFERENCES
-    pn_unique_ptr(pn_unique_ptr&& x) : ptr_(0)  { std::swap(ptr_, x.ptr_); }
-#else
-    pn_unique_ptr(const pn_unique_ptr& x) : ptr_() { std::swap(ptr_, const_cast<pn_unique_ptr&>(x).ptr_); }
-#endif
-    ~pn_unique_ptr() { delete(ptr_); }
-    T& operator*() const { return *ptr_; }
-    T* operator->() const { return ptr_; }
-    T* get() const { return ptr_; }
-    void reset(T* p = 0) { pn_unique_ptr<T> tmp(p); std::swap(ptr_, tmp.ptr_); }
-    T* release() { T *p = ptr_; ptr_ = 0; return p; }
-    operator bool() const { return get(); }
-    bool operator !() const { return get(); }
-
-#if PN_CPP_HAS_STD_PTR
-    operator std::unique_ptr<T>() { T *p = ptr_; ptr_ = 0; return std::unique_ptr<T>(p); }
-#endif
-
-  private:
-    T* ptr_;
-};
-
-}}
-
-/// @endcond
-
-#endif // UNIQUE_PTR_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/receiver.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/receiver.hpp b/proton-c/bindings/cpp/include/proton/receiver.hpp
index f0fd2c0..3a3b69b 100644
--- a/proton-c/bindings/cpp/include/proton/receiver.hpp
+++ b/proton-c/bindings/cpp/include/proton/receiver.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_RECEIVER_H
-#define PROTON_CPP_RECEIVER_H
+#ifndef PROTON_RECEIVER_HPP
+#define PROTON_RECEIVER_HPP
 
 /*
  *
@@ -26,6 +26,7 @@
 #include "proton/endpoint.hpp"
 #include "proton/link.hpp"
 #include "proton/types.h"
+
 #include <string>
 
 struct pn_connection_t;
@@ -33,7 +34,7 @@ struct pn_connection_t;
 namespace proton {
 template <class T> class thread_safe;
 
-/// A link for receiving messages.
+/// A channel for receiving messages.
 class
 PN_CPP_CLASS_EXTERN receiver : public link {
     /// @cond INTERNAL
@@ -41,11 +42,15 @@ PN_CPP_CLASS_EXTERN receiver : public link {
     /// @endcond
 
   public:
+    /// Create an empty receiver.
     receiver() {}
 
-    /// Locally open the receiver.  The operation is not complete till
-    /// handler::on_receiver_open.
+    /// Open the receiver.
+    ///
+    /// @see endpoint_lifecycle
     PN_CPP_EXTERN void open();
+
+    /// @copydoc open
     PN_CPP_EXTERN void open(const receiver_options &opts);
 
     /// Get the source node.
@@ -76,29 +81,33 @@ PN_CPP_CLASS_EXTERN receiver : public link {
     /// @endcond
 };
 
+/// @cond INTERNAL
+    
+/// An iterator of receivers.
 class receiver_iterator : public internal::iter_base<receiver, receiver_iterator> {
-    ///@cond INTERNAL
     explicit receiver_iterator(receiver r, pn_session_t* s = 0) :
         internal::iter_base<receiver, receiver_iterator>(r), session_(s) {}
-    ///@endcond
 
   public:
+    /// Create an iterator of receivers.
     explicit receiver_iterator() :
         internal::iter_base<receiver, receiver_iterator>(0), session_(0) {}
-    /// Advance
+
+    /// Advance to the next receiver.
     PN_CPP_EXTERN receiver_iterator operator++();
 
   private:
     pn_session_t* session_;
 
-    friend class connection;
-    friend class session;
+  friend class connection;
+  friend class session;
 };
 
 /// A range of receivers.
 typedef internal::iter_range<receiver_iterator> receiver_range;
 
+/// @endcond
 
-}
+} // proton
 
-#endif // PROTON_CPP_RECEIVER_H
+#endif // PROTON_RECEIVER_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/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 f40066f..6621232 100644
--- a/proton-c/bindings/cpp/include/proton/receiver_options.hpp
+++ b/proton-c/bindings/cpp/include/proton/receiver_options.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_RECEIVER_OPTIONS_H
-#define PROTON_CPP_RECEIVER_OPTIONS_H
+#ifndef PROTON_RECEIVER_OPTIONS_HPP
+#define PROTON_RECEIVER_OPTIONS_HPP
 
 /*
  *
@@ -24,7 +24,7 @@
 
 #include "proton/config.hpp"
 #include "proton/export.hpp"
-#include "proton/pn_unique_ptr.hpp"
+#include "proton/internal/pn_unique_ptr.hpp"
 #include "proton/types.hpp"
 #include "proton/delivery_mode.hpp"
 #include "proton/terminus.hpp"
@@ -83,10 +83,10 @@ class receiver_options {
     PN_CPP_EXTERN receiver_options& delivery_mode(delivery_mode);
 
     /// Automatically accept inbound messages that aren't otherwise
-    /// released, rejected or modified (default value:true).
+    /// released, rejected, or modified (default is true).
     PN_CPP_EXTERN receiver_options& auto_accept(bool);
 
-    /// Automatically settle messages (default value: true).
+    /// Automatically settle messages (default is true).
     PN_CPP_EXTERN receiver_options& auto_settle(bool);
 
     /// Options for the source node of the receiver.
@@ -95,13 +95,10 @@ class receiver_options {
     /// Options for the target node of the receiver.
     PN_CPP_EXTERN receiver_options& target(target_options &);
 
-    /// @cond INTERNAL
-    /// XXX moving to ???
     /// Set automated flow control to pre-fetch this many messages
-    /// (default value:10).  Set to zero to disable automatic credit
+    /// (default is 10).  Set to zero to disable automatic credit
     /// replenishing.
     PN_CPP_EXTERN receiver_options& credit_window(int);
-    /// @endcond
 
     /// @cond INTERNAL
   private:
@@ -114,6 +111,6 @@ class receiver_options {
     /// @endcond
 };
 
-}
+} // proton
 
-#endif // PROTON_CPP_RECEIVER_OPTIONS_H
+#endif // PROTON_RECEIVER_OPTIONS_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/reconnect_timer.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/reconnect_timer.hpp b/proton-c/bindings/cpp/include/proton/reconnect_timer.hpp
index 802863c..8ac157d 100644
--- a/proton-c/bindings/cpp/include/proton/reconnect_timer.hpp
+++ b/proton-c/bindings/cpp/include/proton/reconnect_timer.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_RECONNECT_H
-#define PROTON_CPP_RECONNECT_H
+#ifndef PROTON_RECONNECT_TIMER_HPP
+#define PROTON_RECONNECT_TIMER_HPP
 
 /*
  *
@@ -23,29 +23,34 @@
  */
 
 /// @cond INTERNAL
-/// XXX more discussion
+/// XXX Needs more discussion
 
 #include "proton/export.hpp"
 #include "proton/duration.hpp"
 #include "proton/timestamp.hpp"
 #include "proton/types.hpp"
+
 #include <string>
 
 namespace proton {
 
-/** A class that generates a series of delays to coordinate reconnection attempts.  They may be open ended or limited in time.  They may be evenly spaced or doubling at an exponential rate. */
-class reconnect_timer
-{
+/// **Experimental** - A class that generates a series of delays to
+/// coordinate reconnection attempts.  They may be open ended or
+/// limited in time.  They may be evenly spaced or doubling at an
+/// exponential rate.
+class reconnect_timer {
   public:
-    /** TODO:
-     */
     PN_CPP_EXTERN reconnect_timer(uint32_t first = 0, int32_t max = -1, uint32_t increment = 100,
                                   bool doubling = true, int32_t max_retries = -1, int32_t timeout = -1);
 
-    /** Indicate a successful connection, resetting the internal timer values */
+    /// Indicate a successful connection, resetting the internal timer
+    /// values.
     PN_CPP_EXTERN void reset();
 
-    /** Obtain the timer's computed time to delay before attempting a reconnection attempt (in milliseconds).  -1 means that the retry limit or timeout has been exceeded and reconnection attempts should cease. */
+    /// Obtain the timer's computed time to delay before attempting a
+    /// reconnection attempt (in milliseconds).  -1 means that the
+    /// retry limit or timeout has been exceeded and reconnection
+    /// attempts should cease.
     PN_CPP_EXTERN int next_delay(timestamp now);
 
   private:
@@ -60,7 +65,8 @@ class reconnect_timer
     timestamp timeout_deadline_;
 };
 
+} // proton
+
 /// @endcond
-}
 
-#endif // PROTON_CPP_RECONNECT_H
+#endif // PROTON_RECONNECT_TIMER_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/sasl.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/sasl.hpp b/proton-c/bindings/cpp/include/proton/sasl.hpp
index db6b77a..0359c99 100644
--- a/proton-c/bindings/cpp/include/proton/sasl.hpp
+++ b/proton-c/bindings/cpp/include/proton/sasl.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_SASL_H
-#define PROTON_CPP_SASL_H
+#ifndef PROTON_SASL_HPP
+#define PROTON_SASL_HPP
 
 /*
  *
@@ -24,9 +24,10 @@
 
 #include "proton/export.hpp"
 #include "proton/config.hpp"
-#include "proton/object.hpp"
+#include "proton/internal/object.hpp"
 
 #include "proton/sasl.h"
+
 #include <string>
 
 namespace proton {
@@ -75,6 +76,6 @@ class sasl {
     /// @endcond
 };
 
-}
+} // proton
 
-#endif // PROTON_CPP_SASL_H
+#endif // PROTON_SASL_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/scalar.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/scalar.hpp b/proton-c/bindings/cpp/include/proton/scalar.hpp
index a08aa48..2aa73b9 100644
--- a/proton-c/bindings/cpp/include/proton/scalar.hpp
+++ b/proton-c/bindings/cpp/include/proton/scalar.hpp
@@ -20,7 +20,7 @@
  * under the License.
  */
 
-#include <proton/scalar_base.hpp>
+#include "proton/internal/scalar_base.hpp"
 
 namespace proton {
 
@@ -29,32 +29,32 @@ class decoder;
 class encoder;
 }
 
-/// A holder for an instance of any scalar AMQP type, see \ref types.
+/// A holder for an instance of any scalar AMQP type.
 ///
+/// @see @ref types_page
 class scalar : public internal::scalar_base {
   public:
     /// Create an empty scalar.
     PN_CPP_EXTERN scalar() {}
 
-    /// Construct from any scalar type, see \ref types.
+    /// Construct from any scalar type.
     template <class T> scalar(const T& x) { *this = x; }
 
-    /// Assign from any scalar type, see \ref types.
+    /// Assign from any scalar type.
     template <class T> scalar& operator=(const T& x) { put_(x); return *this; }
 
-    /// No contents, type() == NULL_TYPE
+    /// True if type() == NULL_TYPE.
     bool empty() const { return type() == NULL_TYPE; }
 
-    /// Clear the scalar, make it empty()
+    /// Clear the scalar, making it empty().
     void clear() { *this = null(); }
-
 };
 
 /// Get a contained value of type T. For example:
 ///
 ///      uint64_t i = get<uint64_t>(x)
 ///
-/// Will succeed if and only if x contains a uint64_t value.
+/// This will succeed if and only if x contains a uint64_t value.
 ///
 /// @throw conversion_error if contained value is not of type T.
 /// @related scalar
@@ -64,13 +64,14 @@ template<class T> T get(const scalar& s) { return internal::get<T>(s); }
 ///
 ///      uint64_t i = get<uint64_t>(x)
 ///
-/// Will succeed if x contains any numeric value, but may lose precision if it
-/// contains a float or double value.
+/// This will succeed if x contains any numeric value, but may lose
+/// precision if it contains a float or double value.
 ///
-/// @throw conversion_error if the value cannot be converted to T according to `std::is_convertible`
+/// @throw conversion_error if the value cannot be converted to T
+/// according to `std::is_convertible`
 /// @related scalar
 template<class T> T coerce(const scalar& x) { return internal::coerce<T>(x); }
 
-}
+} // proton
 
-#endif  /*!PROTON_SCALAR_HPP*/
+#endif // PROTON_SCALAR_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/scalar_base.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/scalar_base.hpp b/proton-c/bindings/cpp/include/proton/scalar_base.hpp
deleted file mode 100644
index eea3fb2..0000000
--- a/proton-c/bindings/cpp/include/proton/scalar_base.hpp
+++ /dev/null
@@ -1,177 +0,0 @@
-#ifndef PROTON_SCALAR_BASE_HPP
-#define PROTON_SCALAR_BASE_HPP
-
-/*
- * 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/binary.hpp>
-#include <proton/comparable.hpp>
-#include <proton/decimal.hpp>
-#include <proton/error.hpp>
-#include <proton/export.hpp>
-#include <proton/symbol.hpp>
-#include <proton/timestamp.hpp>
-#include <proton/type_id.hpp>
-#include <proton/types_fwd.hpp>
-#include <proton/type_traits.hpp>
-#include <proton/uuid.hpp>
-
-#include <iosfwd>
-#include <string>
-
-namespace proton {
-class message;
-
-namespace codec {
-class decoder;
-class encoder;
-}
-
-namespace internal {
-
-/// Base class for scalar types.
-class scalar_base : private comparable<scalar_base> {
-  public:
-    /// AMQP type of data stored in the scalar
-    PN_CPP_EXTERN type_id type() const;
-
-    /// @cond INTERNAL
-    /// deprecated
-    template <class T> void get(T& x) const { get_(x); }
-    template <class T> T get() const { T x; get_(x); return x; }
-    /// @endcond
-
-    /// Compare
-  friend PN_CPP_EXTERN bool operator<(const scalar_base& x, const scalar_base& y);
-    /// Compare
-  friend PN_CPP_EXTERN bool operator==(const scalar_base& x, const scalar_base& y);
-    /// Print contained value
-  friend PN_CPP_EXTERN std::ostream& operator<<(std::ostream& o, const scalar_base& x);
-
-  protected:
-    PN_CPP_EXTERN scalar_base(const pn_atom_t& a);
-    PN_CPP_EXTERN scalar_base();
-    PN_CPP_EXTERN scalar_base(const scalar_base&);
-    PN_CPP_EXTERN scalar_base& operator=(const scalar_base&);
-
-    PN_CPP_EXTERN void put_(bool);
-    PN_CPP_EXTERN void put_(uint8_t);
-    PN_CPP_EXTERN void put_(int8_t);
-    PN_CPP_EXTERN void put_(uint16_t);
-    PN_CPP_EXTERN void put_(int16_t);
-    PN_CPP_EXTERN void put_(uint32_t);
-    PN_CPP_EXTERN void put_(int32_t);
-    PN_CPP_EXTERN void put_(uint64_t);
-    PN_CPP_EXTERN void put_(int64_t);
-    PN_CPP_EXTERN void put_(wchar_t);
-    PN_CPP_EXTERN void put_(float);
-    PN_CPP_EXTERN void put_(double);
-    PN_CPP_EXTERN void put_(timestamp);
-    PN_CPP_EXTERN void put_(const decimal32&);
-    PN_CPP_EXTERN void put_(const decimal64&);
-    PN_CPP_EXTERN void put_(const decimal128&);
-    PN_CPP_EXTERN void put_(const uuid&);
-    PN_CPP_EXTERN void put_(const std::string&);
-    PN_CPP_EXTERN void put_(const symbol&);
-    PN_CPP_EXTERN void put_(const binary&);
-    PN_CPP_EXTERN void put_(const char* s); ///< Treated as an AMQP string
-    PN_CPP_EXTERN void put_(const null&);
-
-    PN_CPP_EXTERN void get_(bool&) const;
-    PN_CPP_EXTERN void get_(uint8_t&) const;
-    PN_CPP_EXTERN void get_(int8_t&) const;
-    PN_CPP_EXTERN void get_(uint16_t&) const;
-    PN_CPP_EXTERN void get_(int16_t&) const;
-    PN_CPP_EXTERN void get_(uint32_t&) const;
-    PN_CPP_EXTERN void get_(int32_t&) const;
-    PN_CPP_EXTERN void get_(uint64_t&) const;
-    PN_CPP_EXTERN void get_(int64_t&) const;
-    PN_CPP_EXTERN void get_(wchar_t&) const;
-    PN_CPP_EXTERN void get_(float&) const;
-    PN_CPP_EXTERN void get_(double&) const;
-    PN_CPP_EXTERN void get_(timestamp&) const;
-    PN_CPP_EXTERN void get_(decimal32&) const;
-    PN_CPP_EXTERN void get_(decimal64&) const;
-    PN_CPP_EXTERN void get_(decimal128&) const;
-    PN_CPP_EXTERN void get_(uuid&) const;
-    PN_CPP_EXTERN void get_(std::string&) const;
-    PN_CPP_EXTERN void get_(symbol&) const;
-    PN_CPP_EXTERN void get_(binary&) const;
-    PN_CPP_EXTERN void get_(null&) const;
-
-  private:
-    void ok(pn_type_t) const;
-    void set(const pn_atom_t&);
-    void set(const binary& x, pn_type_t t);
-
-    pn_atom_t atom_;
-    binary bytes_;              // Hold binary data.
-
-  friend class proton::message;
-  friend class codec::encoder;
-  friend class codec::decoder;
-};
-
-template<class T> T get(const scalar_base& s) { T x; s.get(x); return x; }
-
-template <class R, class F> R visit(const scalar_base& s, F f) {
-    switch(s.type()) {
-      case BOOLEAN: return f(s.get<bool>());
-      case UBYTE: return f(s.get<uint8_t>());
-      case BYTE: return f(s.get<int8_t>());
-      case USHORT: return f(s.get<uint16_t>());
-      case SHORT: return f(s.get<int16_t>());
-      case UINT: return f(s.get<uint32_t>());
-      case INT: return f(s.get<int32_t>());
-      case CHAR: return f(s.get<wchar_t>());
-      case ULONG: return f(s.get<uint64_t>());
-      case LONG: return f(s.get<int64_t>());
-      case TIMESTAMP: return f(s.get<timestamp>());
-      case FLOAT: return f(s.get<float>());
-      case DOUBLE: return f(s.get<double>());
-      case DECIMAL32: return f(s.get<decimal32>());
-      case DECIMAL64: return f(s.get<decimal64>());
-      case DECIMAL128: return f(s.get<decimal128>());
-      case UUID: return f(s.get<uuid>());
-      case BINARY: return f(s.get<binary>());
-      case STRING: return f(s.get<std::string>());
-      case SYMBOL: return f(s.get<symbol>());
-      default: throw conversion_error("invalid scalar type "+type_name(s.type()));
-    }
-}
-
-template<class T> struct coerce_op {
-    template <class U>
-    typename enable_if<is_convertible<U, T>::value, T>::type operator()(const U& x) {
-        return static_cast<T>(x);
-    }
-    template <class U>
-    typename enable_if<!is_convertible<U, T>::value, T>::type operator()(const U&) {
-        throw conversion_error("cannot coerce from " + type_name(type_id_of<U>::value));
-    }
-};
-
-template <class T> T coerce(const scalar_base& s) { return visit<T>(s, coerce_op<T>()); }
-
-} // internal
-
-
-} // proton
-
-#endif  /*!PROTON_SCALAR_BASE_HPP*/

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/sender.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/sender.hpp b/proton-c/bindings/cpp/include/proton/sender.hpp
index 114e8bb..1944e36 100644
--- a/proton-c/bindings/cpp/include/proton/sender.hpp
+++ b/proton-c/bindings/cpp/include/proton/sender.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_SENDER_H
-#define PROTON_CPP_SENDER_H
+#ifndef PROTON_SENDER_HPP
+#define PROTON_SENDER_HPP
 
 /*
  *
@@ -28,6 +28,7 @@
 #include "proton/tracker.hpp"
 
 #include "proton/types.h"
+
 #include <string>
 
 struct pn_connection_t;
@@ -35,20 +36,23 @@ struct pn_connection_t;
 namespace proton {
 template <class T> class thread_safe;
 
-/// A link for sending messages.
+/// A channel for sending messages.
 class
-PN_CPP_CLASS_EXTERN sender : public link
-{
+PN_CPP_CLASS_EXTERN sender : public link {
     /// @cond INTERNAL
     PN_CPP_EXTERN sender(pn_link_t* s);
     /// @endcond
 
   public:
+    /// Create an empty sender.
     sender() {}
 
-    /// Locally open the sender.  The operation is not complete till
-    /// handler::on_sender_open.
+    /// Open the sender.
+    ///
+    /// @see endpoint_lifecycle
     PN_CPP_EXTERN void open();
+
+    /// @copydoc open
     PN_CPP_EXTERN void open(const sender_options &opts);
 
     /// Send a message on the sender.
@@ -63,39 +67,43 @@ PN_CPP_CLASS_EXTERN sender : public link
     /// Return all unused credit to the receiver in response to a
     /// drain request.  Has no effect unless there has been a drain
     /// request and there is remaining credit to use or return.
-    /// @see receiver::drain.
+    ///
+    /// @see receiver::drain
     PN_CPP_EXTERN void return_credit();
 
-  /// @cond INTERNAL
+    /// @cond INTERNAL
   friend class internal::factory<sender>;
   friend class sender_iterator;
   friend class thread_safe<sender>;
-  /// @endcond
+    /// @endcond
 };
 
+/// @cond INTERNAL
+
+/// An iterator of senders.
 class sender_iterator : public internal::iter_base<sender, sender_iterator> {
-    ///@cond INTERNAL
     sender_iterator(sender snd, pn_session_t* s = 0) :
         internal::iter_base<sender, sender_iterator>(snd), session_(s) {}
-    ///@endcond
 
   public:
+    /// Create an iterator of senders.
     sender_iterator() :
         internal::iter_base<sender, sender_iterator>(0), session_(0) {}
-    /// Advance
+    /// Advance to the next sender.
     PN_CPP_EXTERN sender_iterator operator++();
 
   private:
     pn_session_t* session_;
 
-    friend class connection;
-    friend class session;
+  friend class connection;
+  friend class session;
 };
 
 /// A range of senders.
 typedef internal::iter_range<sender_iterator> sender_range;
 
+/// @endcond
 
 }
 
-#endif // PROTON_CPP_SENDER_H
+#endif // PROTON_SENDER_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/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 d74f1f8..b3f1f4c 100644
--- a/proton-c/bindings/cpp/include/proton/sender_options.hpp
+++ b/proton-c/bindings/cpp/include/proton/sender_options.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_SENDER_OPTIONS_H
-#define PROTON_CPP_SENDER_OPTIONS_H
+#ifndef PROTON_SENDER_OPTIONS_HPP
+#define PROTON_SENDER_OPTIONS_HPP
 
 /*
  *
@@ -24,7 +24,7 @@
 
 #include "proton/config.hpp"
 #include "proton/export.hpp"
-#include "proton/pn_unique_ptr.hpp"
+#include "proton/internal/pn_unique_ptr.hpp"
 #include "proton/types.hpp"
 #include "proton/delivery_mode.hpp"
 #include "proton/terminus.hpp"
@@ -60,6 +60,7 @@ class target_options;
 ///
 /// Normal value semantics: copy or assign creates a separate copy of
 /// the options.
+// XXX opts.browsing is not a good example here
 class sender_options {
   public:
     /// Create an empty set of options.
@@ -85,7 +86,7 @@ class sender_options {
     /// Set the delivery mode on the sender.
     PN_CPP_EXTERN sender_options& delivery_mode(delivery_mode);
 
-    /// Automatically settle messages (default value: true).
+    /// Automatically settle messages (default is true).
     PN_CPP_EXTERN sender_options& auto_settle(bool);
 
     /// Options for the source node of the sender.
@@ -94,7 +95,6 @@ class sender_options {
     /// Options for the receiver node of the receiver.
     PN_CPP_EXTERN sender_options& target(target_options &);
 
-
     /// @cond INTERNAL
   private:
     void apply(sender&) const;
@@ -106,6 +106,6 @@ class sender_options {
     /// @endcond
 };
 
-}
+} // proton
 
-#endif // PROTON_CPP_SENDER_OPTIONS_H
+#endif // PROTON_SENDER_OPTIONS_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/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 540f1bd..164a5bd 100644
--- a/proton-c/bindings/cpp/include/proton/session.hpp
+++ b/proton-c/bindings/cpp/include/proton/session.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_SESSION_H
-#define PROTON_CPP_SESSION_H
+#ifndef PROTON_SESSION_HPP
+#define PROTON_SESSION_HPP
 
 /*
  *
@@ -30,6 +30,7 @@
 
 #include "proton/types.h"
 #include "proton/link.h"
+
 #include <string>
 
 struct pn_connection_t;
@@ -43,39 +44,34 @@ template <class T> class thread_safe;
 
 /// A container of senders and receivers.
 class
-PN_CPP_CLASS_EXTERN session : public internal::object<pn_session_t>, public endpoint
-{
+PN_CPP_CLASS_EXTERN session : public internal::object<pn_session_t>, public endpoint {
+  public:
     /// @cond INTERNAL
     PN_CPP_EXTERN session(pn_session_t* s) : internal::object<pn_session_t>(s) {}
     /// @endcond
 
   public:
+    /// Create an empty session.
     session() : internal::object<pn_session_t>(0) {}
 
-    // Endpoint behaviours
-
-    /// Get the state of this session.
     PN_CPP_EXTERN bool uninitialized() const;
     PN_CPP_EXTERN bool active() const;
     PN_CPP_EXTERN bool closed() const;
 
     PN_CPP_EXTERN class error_condition error() const;
 
-    /// Initiate local open.  The operation is not complete till
-    /// handler::on_session_open().
+    /// Open the session.
+    ///
+    /// @see endpoint_lifecycle
     PN_CPP_EXTERN void open();
+
+    /// @copydoc open
     PN_CPP_EXTERN void open(const session_options &opts);
 
-    /// Initiate local close.  The operation is not complete till
-    /// handler::on_session_close().
     PN_CPP_EXTERN void close();
-
-    /// Initiate close with an error condition.
-    /// The operation is not complete till handler::on_connection_close().
     PN_CPP_EXTERN void close(const error_condition&);
 
-
-    /// Return the container for this session
+    /// Get the container for this session.
     PN_CPP_EXTERN class container &container() const;
 
     /// Get the connection this session belongs to.
@@ -83,10 +79,14 @@ PN_CPP_CLASS_EXTERN session : public internal::object<pn_session_t>, public endp
 
     /// Open a sender for `addr`.
     PN_CPP_EXTERN sender open_sender(const std::string &addr);
+
+    /// @copydoc open_sender
     PN_CPP_EXTERN sender open_sender(const std::string &addr, const sender_options &opts);
 
     /// Open a receiver for `addr`.
     PN_CPP_EXTERN receiver open_receiver(const std::string &addr);
+
+    /// @copydoc open_receiver
     PN_CPP_EXTERN receiver open_receiver(const std::string &addr, const receiver_options &opts);
 
     /// The number of incoming bytes currently buffered.
@@ -101,24 +101,29 @@ PN_CPP_CLASS_EXTERN session : public internal::object<pn_session_t>, public endp
     /// Return the receivers on this session.
     PN_CPP_EXTERN receiver_range receivers() const;
 
-    friend class internal::factory<session>;
-    friend class session_iterator;
-    friend class thread_safe<session>;
+    /// @cond INTERNAL
+  friend class internal::factory<session>;
+  friend class session_iterator;
+  friend class thread_safe<session>;
+    /// @endcond
 };
 
-
-/// An iterator for sessions.
+/// @cond INTERNAL
+    
+/// An iterator of sessions.
 class session_iterator : public internal::iter_base<session, session_iterator> {
  public:
-    ///@cond INTERNAL
     explicit session_iterator(session s = 0) : internal::iter_base<session, session_iterator>(s) {}
-    ///@endcond
-    PN_CPP_EXTERN session_iterator operator++();     ///< Advance
+
+    /// Advance to the next session.
+    PN_CPP_EXTERN session_iterator operator++();
 };
 
 /// A range of sessions.
 typedef internal::iter_range<session_iterator> session_range;
 
-}
+/// @endcond
+    
+} // proton
 
-#endif // PROTON_CPP_SESSION_H
+#endif // PROTON_SESSION_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/session_options.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/session_options.hpp b/proton-c/bindings/cpp/include/proton/session_options.hpp
index 0711022..bf88f51 100644
--- a/proton-c/bindings/cpp/include/proton/session_options.hpp
+++ b/proton-c/bindings/cpp/include/proton/session_options.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_SESSION_OPTIONS_H
-#define PROTON_CPP_SESSION_OPTIONS_H
+#ifndef PROTON_SESSION_OPTIONS_HPP
+#define PROTON_SESSION_OPTIONS_HPP
 
 /*
  *
@@ -24,25 +24,23 @@
 
 #include "proton/config.hpp"
 #include "proton/export.hpp"
-#include "proton/pn_unique_ptr.hpp"
+#include "proton/internal/pn_unique_ptr.hpp"
 #include "proton/types.hpp"
 
-
 namespace proton {
 
 class handler;
 class session;
 
-
 /// Options for creating a session.
 ///
-/// Options can be "chained" (@see proton::connection_options).
+/// Options can be "chained" (see proton::connection_options).
 ///
 /// Normal value semantics: copy or assign creates a separate copy of
 /// the options.
+// XXX Does this need the CLASS_EXTERN stuff? - Add just for consistency
 class session_options {
   public:
-
     /// Create an empty set of options.
     PN_CPP_EXTERN session_options();
 
@@ -69,6 +67,6 @@ class session_options {
     /// @endcond
 };
 
-}
+} // proton
 
-#endif // PROTON_CPP_SESSION_OPTIONS_H
+#endif // PROTON_SESSION_OPTIONS_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/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 a30a866..7546f7d 100644
--- a/proton-c/bindings/cpp/include/proton/source.hpp
+++ b/proton-c/bindings/cpp/include/proton/source.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_SOURCE_H
-#define PROTON_CPP_SOURCE_H
+#ifndef PROTON_SOURCE_HPP
+#define PROTON_SOURCE_HPP
 
 /*
  *
@@ -23,10 +23,10 @@
  */
 
 #include "proton/export.hpp"
-#include "proton/object.hpp"
+#include "proton/internal/object.hpp"
 #include "proton/value.hpp"
 #include "proton/terminus.hpp"
-#include <proton/map.hpp>
+#include "proton/codec/map.hpp"
 
 #include <string>
 
@@ -35,21 +35,28 @@ namespace proton {
 class sender;
 class receiver;
 
-///
 /// The source node is where messages originate.
 ///
-/// @see proton::sender proton::receiver proton::target
+/// @see proton::sender, proton::receiver, proton::target
 class source : public terminus {
   public:
-    /// A map of AMQP symbol keys and filter specifiers.
+    /// **Experimental** - A map of AMQP symbol keys and filter
+    /// specifiers.
     typedef std::map<symbol, value> filter_map;
 
+    /// Create an empty source.
     source() : terminus() {}
 
+    /// The policy for distributing messages.
     enum distribution_mode {
-      UNSPECIFIED = PN_DIST_MODE_UNSPECIFIED,
-      COPY = PN_DIST_MODE_COPY,
-      MOVE = PN_DIST_MODE_MOVE
+        // XXX Why is unspecified needed?  The protocol doesn't have
+        // it.
+        /// Unspecified
+        UNSPECIFIED = PN_DIST_MODE_UNSPECIFIED,
+        /// Once transferred, the message remains available to ther links
+        COPY = PN_DIST_MODE_COPY,
+        /// Once transferred, the message is unavailable to other links
+        MOVE = PN_DIST_MODE_MOVE                
     };
 
     using terminus::durability_mode;
@@ -61,19 +68,21 @@ class source : public terminus {
     /// Get the distribution mode.
     PN_CPP_EXTERN enum distribution_mode distribution_mode() const;
 
-    /// Obtain the set of message filters.
+    /// **Experimental** - Obtain the set of message filters.
     PN_CPP_EXTERN filter_map filters() const;
-    /// @cond INTERNAL
+
   private:
     source(pn_terminus_t* t);
     source(const sender&);
     source(const receiver&);
+
+    /// @cond INTERNAL
   friend class proton::internal::factory<source>;
   friend class sender;
   friend class receiver;
     /// @endcond
 };
 
-}
+} // proton
 
-#endif // PROTON_CPP_SOURCE_H
+#endif // PROTON_SOURCE_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/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 0312d06..3738184 100644
--- a/proton-c/bindings/cpp/include/proton/source_options.hpp
+++ b/proton-c/bindings/cpp/include/proton/source_options.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_SOURCE_OPTIONS_H
-#define PROTON_CPP_SOURCE_OPTIONS_H
+#ifndef PROTON_SOURCE_OPTIONS_HPP
+#define PROTON_SOURCE_OPTIONS_HPP
 
 /*
  *
@@ -24,7 +24,7 @@
 
 #include "proton/config.hpp"
 #include "proton/export.hpp"
-#include "proton/pn_unique_ptr.hpp"
+#include "proton/internal/pn_unique_ptr.hpp"
 #include "proton/types.hpp"
 #include "proton/delivery_mode.hpp"
 #include "proton/source.hpp"
@@ -36,7 +36,6 @@ namespace proton {
 
 class proton_handler;
 
-
 /// Options for creating a source node for a sender or receiver.
 ///
 /// Options can be "chained" (@see proton::connection_options).
@@ -76,23 +75,24 @@ class source_options {
     /// Control when the clock for expiration begins.
     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.
+    /// **Experimental** - Specify a filter mechanism on the source
+    /// that restricts message flow to a subset of the available
+    /// messages.
     PN_CPP_EXTERN source_options& filters(const source::filter_map&);
 
-    /// @cond INTERNAL
   private:
     void apply(source&) const;
 
     class impl;
     internal::pn_unique_ptr<impl> impl_;
 
-    friend class source;
-    friend class sender_options;
-    friend class receiver_options;
+    /// @cond INTERNAL
+  friend class source;
+  friend class sender_options;
+  friend class receiver_options;
     /// @endcond
 };
 
-}
+} // proton
 
-#endif // PROTON_CPP_SOURCE_OPTIONS_H
+#endif // PROTON_SOURCE_OPTIONS_HPP

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2dc4afe0/proton-c/bindings/cpp/include/proton/ssl.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/ssl.hpp b/proton-c/bindings/cpp/include/proton/ssl.hpp
index b41b657..b6e3917 100644
--- a/proton-c/bindings/cpp/include/proton/ssl.hpp
+++ b/proton-c/bindings/cpp/include/proton/ssl.hpp
@@ -1,5 +1,5 @@
-#ifndef PROTON_CPP_SSL_H
-#define PROTON_CPP_SSL_H
+#ifndef PROTON_SSL_HPP
+#define PROTON_SSL_HPP
 
 /*
  *
@@ -23,9 +23,10 @@
  */
 
 #include "proton/export.hpp"
-#include "proton/object.hpp"
+#include "proton/internal/object.hpp"
 
 #include "proton/ssl.h"
+
 #include <string>
 
 namespace proton {
@@ -39,6 +40,7 @@ class ssl {
     /// @endcond
 
   public:
+    /// Create an empty ssl object.
     ssl() : object_(0) {}
 
     /// Determines the level of peer validation.
@@ -85,25 +87,28 @@ class ssl {
 
     /// @endcond
 
-    /// @cond INTERNAL
   private:
     pn_ssl_t* object_;
 
-    friend class internal::factory<ssl>;
+    /// @cond INTERNAL
+  friend class internal::factory<ssl>;
     /// @endcond
 };
 
+/// **Experimental** - An SSL certificate.
 class ssl_certificate {
   public:
     /// Create an SSL certificate.
     PN_CPP_EXTERN ssl_certificate(const std::string &certdb_main);
+
+    // XXX Document the following constructors
+    
+    /// @copydoc ssl_certificate
     PN_CPP_EXTERN ssl_certificate(const std::string &certdb_main, const std::string &certdb_extra);
 
-    /// Create an SSL certificate.
-    ///
-    /// @internal
-    /// XXX what is the difference between these?
+    /// @copydoc ssl_certificate
     PN_CPP_EXTERN ssl_certificate(const std::string &certdb_main, const std::string &certdb_extra, const std::string &passwd);
+    /// @endcond
 
   private:
     std::string certdb_main_;
@@ -112,8 +117,8 @@ class ssl_certificate {
     bool pw_set_;
 
     /// @cond INTERNAL
-    friend class ssl_client_options;
-    friend class ssl_server_options;
+  friend class ssl_client_options;
+  friend class ssl_server_options;
     /// @endcond
 };
 
@@ -139,7 +144,7 @@ class ssl_domain {
 
 }
 
-/// SSL configuration for inbound connections.
+/// **Experimental** - SSL configuration for inbound connections.
 class ssl_server_options : private internal::ssl_domain {
   public:
     /// Server SSL options based on the supplied X.509 certificate
@@ -162,11 +167,11 @@ class ssl_server_options : private internal::ssl_domain {
     using internal::ssl_domain::pn_domain;
 
     /// @cond INTERNAL
-    friend class connection_options;
+  friend class connection_options;
     /// @endcond
 };
 
-/// SSL configuration for outbound connections.
+/// **Experimental** - SSL configuration for outbound connections.
 class ssl_client_options : private internal::ssl_domain {
   public:
     /// Create SSL client options (no client certificate).
@@ -187,10 +192,10 @@ class ssl_client_options : private internal::ssl_domain {
     using internal::ssl_domain::pn_domain;
 
     /// @cond INTERNAL
-    friend class connection_options;
+  friend class connection_options;
     /// @endcond
 };
 
-}
+} // proton
 
-#endif // PROTON_CPP_SSL_H
+#endif // PROTON_SSL_HPP


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