qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kp...@apache.org
Subject [4/4] qpid-proton git commit: PROTON-1159: Merge with trunk
Date Thu, 17 Mar 2016 15:34:27 GMT
PROTON-1159: Merge with trunk


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

Branch: refs/heads/kvdr-PROTON-1159
Commit: e15bcdd097f5db718a0ca8204e734ad5727787f2
Parents: a8b63a1 d70dab5
Author: Kim van der Riet <kpvdr@apache.org>
Authored: Thu Mar 17 11:33:57 2016 -0400
Committer: Kim van der Riet <kpvdr@apache.org>
Committed: Thu Mar 17 11:33:57 2016 -0400

----------------------------------------------------------------------
 examples/cpp/README.dox                         | 198 +++++++++
 examples/cpp/README.hpp                         | 198 ---------
 examples/cpp/direct_recv.cpp                    |   8 +-
 examples/cpp/encode_decode.cpp                  |  13 +-
 examples/cpp/engine/server.cpp                  |   2 +-
 examples/cpp/server.cpp                         |   2 +-
 examples/cpp/server_direct.cpp                  |  12 +-
 proton-c/bindings/cpp/CMakeLists.txt            |   2 +-
 proton-c/bindings/cpp/docs/CMakeLists.txt       |   1 +
 proton-c/bindings/cpp/docs/tutorial.dox         | 428 +++++++++++++++++++
 proton-c/bindings/cpp/docs/tutorial.hpp         | 428 -------------------
 proton-c/bindings/cpp/docs/user.doxygen.in      |  10 +-
 proton-c/bindings/cpp/include/proton/amqp.hpp   |  40 +-
 .../cpp/include/proton/annotation_key.hpp       |  51 ++-
 proton-c/bindings/cpp/include/proton/binary.hpp |  26 +-
 .../bindings/cpp/include/proton/byte_array.hpp  |  52 ++-
 .../bindings/cpp/include/proton/comparable.hpp  |   2 +
 .../cpp/include/proton/connection_engine.hpp    |   2 +-
 proton-c/bindings/cpp/include/proton/data.hpp   |  51 +--
 .../bindings/cpp/include/proton/decimal.hpp     |   5 +-
 .../bindings/cpp/include/proton/decoder.hpp     |  49 ++-
 proton-c/bindings/cpp/include/proton/deque.hpp  |   2 +-
 .../bindings/cpp/include/proton/duration.hpp    |  17 +-
 .../bindings/cpp/include/proton/encoder.hpp     |  65 ++-
 .../bindings/cpp/include/proton/endpoint.hpp    |   5 +-
 proton-c/bindings/cpp/include/proton/error.hpp  |   6 +-
 .../cpp/include/proton/forward_list.hpp         |   2 +-
 proton-c/bindings/cpp/include/proton/io.hpp     |   3 +-
 proton-c/bindings/cpp/include/proton/link.hpp   |   5 +
 proton-c/bindings/cpp/include/proton/list.hpp   |   2 +-
 .../bindings/cpp/include/proton/message.hpp     |   6 +-
 .../bindings/cpp/include/proton/message_id.hpp  |  62 ++-
 proton-c/bindings/cpp/include/proton/scalar.hpp | 217 ++--------
 .../bindings/cpp/include/proton/scalar_base.hpp | 181 ++++++++
 .../bindings/cpp/include/proton/session.hpp     |   4 +-
 proton-c/bindings/cpp/include/proton/symbol.hpp |   4 +
 .../bindings/cpp/include/proton/timestamp.hpp   |  18 +-
 .../bindings/cpp/include/proton/type_id.hpp     |  23 +-
 .../bindings/cpp/include/proton/type_traits.hpp | 108 ++---
 proton-c/bindings/cpp/include/proton/types.hpp  |  88 +++-
 .../bindings/cpp/include/proton/types_fwd.hpp   |  11 +-
 proton-c/bindings/cpp/include/proton/url.hpp    |   2 +-
 proton-c/bindings/cpp/include/proton/value.hpp  | 106 ++---
 proton-c/bindings/cpp/include/proton/vector.hpp |   2 +-
 proton-c/bindings/cpp/src/decoder.cpp           | 127 +++---
 proton-c/bindings/cpp/src/encoder.cpp           |  21 +-
 proton-c/bindings/cpp/src/interop_test.cpp      |  21 -
 proton-c/bindings/cpp/src/message.cpp           |   4 +-
 proton-c/bindings/cpp/src/message_test.cpp      |  16 +-
 proton-c/bindings/cpp/src/scalar.cpp            | 263 ------------
 proton-c/bindings/cpp/src/scalar_base.cpp       | 158 +++++++
 proton-c/bindings/cpp/src/scalar_test.cpp       |  15 +-
 proton-c/bindings/cpp/src/ssl.cpp               |   2 +-
 proton-c/bindings/cpp/src/test_bits.hpp         |   7 +
 proton-c/bindings/cpp/src/types_internal.hpp    |  15 +-
 proton-c/bindings/cpp/src/value.cpp             |  27 +-
 proton-c/bindings/cpp/src/value_test.cpp        |  46 +-
 tests/tools/apps/cpp/reactor_send.cpp           |   2 +-
 58 files changed, 1688 insertions(+), 1555 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e15bcdd0/proton-c/bindings/cpp/include/proton/byte_array.hpp
----------------------------------------------------------------------
diff --cc proton-c/bindings/cpp/include/proton/byte_array.hpp
index 9ae123f,fe3f864..831283f
--- a/proton-c/bindings/cpp/include/proton/byte_array.hpp
+++ b/proton-c/bindings/cpp/include/proton/byte_array.hpp
@@@ -23,8 -23,7 +23,9 @@@
  #include <proton/comparable.hpp>
  
  #include <algorithm>
 +#include <iomanip>
 +#include <iostream>
+ #include <iterator>
  
  namespace proton {
  
@@@ -32,40 -31,51 +33,59 @@@
  /// as an array of bytes.
  template <size_t N> class byte_array : private comparable<byte_array<N> >
{
    public:
-     typedef char value_type;
+     ///@name Sequence container typedefs
+     ///@{
+     typedef uint8_t                                   value_type;
+     typedef value_type*			              pointer;
+     typedef const value_type*                         const_pointer;
+     typedef value_type&                   	      reference;
+     typedef const value_type&             	      const_reference;
+     typedef value_type*          		      iterator;
+     typedef const value_type*			      const_iterator;
+     typedef std::size_t                    	      size_type;
+     typedef std::ptrdiff_t                   	      difference_type;
+     typedef std::reverse_iterator<iterator>	      reverse_iterator;
+     typedef std::reverse_iterator<const_iterator>     const_reverse_iterator;
+     ///@}
  
-     /// Initially all 0.
+     /// 0-initialized byte array
      byte_array() { std::fill(bytes_, bytes_+N, '\0'); }
  
-     /// Returns N
+     /// Size of the array
      static size_t size() { return N; }
  
-     uint8_t* begin() { return bytes_; }
-     uint8_t* end() { return bytes_+N; }
-     uint8_t& operator[](size_t i) { return bytes_[i]; }
+     ///@name Array operators
+     ///@{
+     value_type* begin() { return bytes_; }
+     value_type* end() { return bytes_+N; }
+     value_type& operator[](size_t i) { return bytes_[i]; }
  
-     const uint8_t* begin() const { return bytes_; }
-     const uint8_t* end() const { return bytes_+N; }
-     const uint8_t& operator[](size_t i) const { return bytes_[i]; }
+     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]; }
+     ///@}
  
-     friend bool operator==(const byte_array& x, const byte_array& y) {
-         return std::equal(x.begin(), x.end(), y.begin());
-     }
+     ///@name Comparison operators
+     ///@{
+   friend bool operator==(const byte_array& x, const byte_array& y) {
+       return std::equal(x.begin(), x.end(), y.begin());
+   }
  
-     friend bool operator<(const byte_array& x, const byte_array& y) {
-         return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
-     }
+   friend bool operator<(const byte_array& x, const byte_array& y) {
+       return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
+   }
+     ///@}
  
 +    friend std::ostream& operator<<(std::ostream& o, const byte_array&
b) {
 +        o << "0x" << std::hex;
 +        for (int i=0; i<b.size(); ++i) {
 +            o << std::setfill('0') << std::setw(2) << ((int)b[i] &
0xff);
 +        }
 +        return o << std::dec;
 +    }
 +
    private:
-     uint8_t bytes_[N];
+     value_type bytes_[N];
  };
  
  }


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


Mime
View raw message