Added a referenced parameter to msgpack::unpack() and msgpack::unpacker::next().
msgpack::unpacked is a kind of handler that holds msgpack::object and msgpack::zone, so the size of msgpack::unpacked should be small. There is no reason to have referenced in msgpack::unpacked. msgpack user can get the same information using msgpack::unpack() and msgpack::unpacker::next().
Even if ref_size is given on vrefbuffer's constructor, the minimum size of vrefbuffer::ref_buffer is 10.
Because int64, uint64, and double's msgpack expression size equals 9, and those buffer is allocated on the stack internally.
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.
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.
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.
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