Commit Graph

1714 Commits

Author SHA1 Message Date
Takatoshi Kondo 0a99b9f933 Fixed the problem that reference function doesn't pass correctly.
Fixed referenced flag writing timing on next(). It should place before flush.
Added msgpack_tuple test for CMakeLists.txt
Untabified CMakeLists.txt
Added reference function test.
2014-08-07 23:26:09 +09:00
Takatoshi Kondo 17e696fc0d Removed redundant memory allocation from zone.
Removed zone::create and zone::destroy.
We can use zone as follows:
   zone z; // on stack
   zone* z = new zone; // on heap

Fixed a resource leak when zone::push_finalizer(msgpack::unique_ptr<T>) is called.
2014-08-07 15:23:34 +09:00
Takatoshi Kondo b5b459cfca Reordered unpack selector sequence. 2014-08-07 10:40:21 +09:00
Takatoshi Kondo 7822bc787d Replaced switch-case and bit calculation with a table. 2014-08-07 10:28:18 +09:00
Takatoshi Kondo 1f5d6b9cac Added EXT support.
Removed obsolete unpack functions.
Updated examples that no longer use obsolete functions.
Added reference checking function to unpacked. ( unpacked::referenced() )
Added std:: namespace.
Added reference or copy choice function and default behavior:
  When you use unpacker, default behavior is:
    STR, BIN, EXT types are always held by reference.
  When you don't use unpacker, default behavior is:
    STR, BIN, EXT types are always held by copy.
    The memory is allocated from zone.
  You can customize the behavior passing your custom judging function to unpack() or unpacker's constructor.
2014-08-06 16:18:37 +09:00
Takatoshi Kondo ce21ab0ebf Fixed zone allocating functions always throw std::bad_alloc() if allocation is failed. 2014-08-06 12:16:28 +09:00
Takatoshi Kondo 5af6d36341 Added a link to wiki. 2014-08-04 16:39:17 +09:00
Takatoshi Kondo 15a0d61a64 Added the new mapping:
std::vector<char> is mapped to BIN.

So, currently BIN, STR, and ARRAY mappings are as follows:
  std::vector<char> is mapped to BIN
  std::string       is mapped to STR
  std::vector<T>    is mapped to ARRAY // T is not char
2014-08-04 15:14:39 +09:00
Takatoshi Kondo 66014eebc0 Updated test codes using recommended interface.
They used to use obsolete interfaces.
2014-08-04 01:08:05 +09:00
Takatoshi Kondo fd566afeb4 Added reference version of unpacker::next(). 2014-08-04 00:52:04 +09:00
Takatoshi Kondo e4d32b176e Use const char* version of msgpack::unpack_error to avoid std::string memory allocation when usr C++11 compiler.
See http://www.cplusplus.com/reference/stdexcept/runtime_error/?kw=runtime_error
2014-08-03 17:04:46 +09:00
Takatoshi Kondo b27c87c9ed Replaced C-Style cast with static_cast. 2014-08-03 16:38:58 +09:00
Takatoshi Kondo 3729f334a1 Replaced size_t with std::size_t. 2014-08-03 16:34:47 +09:00
Takatoshi Kondo 55bf279a7c Removed obsolete unpack interface from test codes. 2014-08-03 08:08:08 +09:00
Takatoshi Kondo 78e8cbdfb5 Cleaned up pointer and reference versions of unpack(). 2014-08-03 07:09:03 +09:00
Nobuyuki Kubota dd083ca933 Merge pull request #95 from ueno/int-float-test
Fix test failure regarding int->float conversion
2014-07-30 21:25:42 -07:00
Takatoshi Kondo 23d670f3bd Merge pull request #97 from splinterofchaos/ostream
Add inline for ODR compliance.
2014-07-25 09:19:55 +09:00
Scott Prager 6fab3594a2 Add inline for ODR compliance. 2014-07-24 15:04:33 -04:00
Takatoshi Kondo 421aeb5021 Fixed missing copy operation for zone.hpp 2014-07-24 23:49:35 +09:00
Takatoshi Kondo 47f4ffe9f3 Added cpp11 include files to install files.
Sorted C++ install files to avoid overlooking.
2014-07-24 10:54:54 +09:00
Takatoshi Kondo 09325ed846 Re-implemented msgpack::unpacker's move operations.
I refered to the following article and comments.
http://scottmeyers.blogspot.jp/2014/06/the-drawbacks-of-implementing-move.html

msgpack::detail::context back to copiable.
msgpack::detail::context doen't have any resource ownership, so there is
no strong reason to avoid copy.
2014-07-24 10:38:24 +09:00
Takatoshi Kondo bfa428ab13 Added cpp_config.hpp to install files. 2014-07-24 07:52:20 +09:00
Takatoshi Kondo ecdeec9948 Fixed the move assign operator implementation. 2014-07-24 07:41:23 +09:00
Takatoshi Kondo f11a811114 Added a move constructor and a move assign operator for unpacker and context.
https://github.com/msgpack/msgpack-c/issues/96
2014-07-23 21:32:45 +09:00
Daiki Ueno c203928fae Fix test failure regarding int->float conversion
Supply only small integers (< 1^23) to int->float conversion tests,
so they can roundtrip without error.
2014-07-17 18:51:59 +09:00
Takatoshi Kondo 59b111e026 Removed the contents in 'install from package' section. It is not supported for this branch.
Updated the description of the cmake.
2014-07-16 08:49:27 +09:00
Takatoshi Kondo 2a694f8c20 Fixed markdown format. 2014-07-16 08:26:36 +09:00
Takatoshi Kondo 0380215982 Fixed https://github.com/msgpack/msgpack-c/issues/88
Added examples for the following updated functions:

msgpack_unpack_return msgpack_unpacker_next(msgpack_unpacker* mpac, msgpack_unpacked* result);

msgpack_unpack_return
msgpack_unpack_next(msgpack_unpacked* result,
        const char* data, size_t len, size_t* off);
2014-07-13 09:35:58 +09:00
Takatoshi Kondo 0e48f65a4b Fixed https://github.com/msgpack/msgpack-c/issues/94
Added a private copy assign operator to unpacker.
2014-07-12 00:41:33 +09:00
Takatoshi Kondo aa79fc2ff4 Updated versions. 2014-07-12 00:33:06 +09:00
Takatoshi Kondo cc571b8bb1 Replaced std::auto_ptr with msgpack::unique_ptr. 2014-07-12 00:21:35 +09:00
Takatoshi Kondo b0df21295c Untabified.
Adjust line break positions.
2014-07-12 00:17:31 +09:00
Takatoshi Kondo 0889e6117e Renamed member variables name. 2014-07-11 23:37:43 +09:00
Takatoshi Kondo 212f025f00 Supported the C++11's enum class. 2014-07-08 19:31:02 +09:00
Takatoshi Kondo f6a5402194 Supported the C++11 tuple. 2014-07-08 19:18:43 +09:00
Takatoshi Kondo 6a349d0b28 Fixed zero size string in the array problem. 2014-07-07 16:31:29 +09:00
Takatoshi Kondo dac5c60608 Replaced bit shift with memcpy on load. 2014-07-07 16:31:29 +09:00
Takatoshi Kondo bc33317b7e Reorganized tree. 2014-07-07 16:31:29 +09:00
Takatoshi Kondo 754b1682a5 Replaced C-style casts with C++ style casts. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo cb9eed8ccc Renamed from ct to container_type. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo 862905742f Renamed z with zone. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo ba98315f65 The same fix as follows on C++ code.
https://github.com/msgpack/msgpack-c/pull/38
2014-07-07 16:19:31 +09:00
Takatoshi Kondo 124a871923 Removed redundant parameter. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo 378f6afccd Mapped std::stirng to STR instead of BIN for benchmark. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo 1320863cb3 Replaced function arguments with data members. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo a951ea90b8 Fixed delete free mismatch problem in C++11 version. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo 3b7a2f8f32 Updated test codes using reference version of unpack functions. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo 038c3e3518 Replaced unsigned int to size_t. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo c08439ff41 Added STR to std::string conversion. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo 59d994ea5f Define nullptr macro only if it is not previously defined. 2014-07-07 16:19:31 +09:00