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.
This commit is contained in:
Takatoshi Kondo
2014-08-06 16:18:37 +09:00
parent ce21ab0ebf
commit 1f5d6b9cac
12 changed files with 519 additions and 400 deletions

View File

@@ -46,12 +46,12 @@ int main(void)
{
std::string buffer(stream.str());
msgpack::zone mempool;
msgpack::object o =
msgpack::unpack(buffer.data(), buffer.size(), mempool);
msgpack::unpacked result;
msgpack::unpack(result, buffer.data(), buffer.size());
msgpack::object o = result.get();
myprotocol::Get req;
msgpack::convert(req, o);
o.convert(req);
std::cout << "received: " << o << std::endl;
}
@@ -74,12 +74,13 @@ int main(void)
{
std::string buffer(stream.str());
msgpack::zone mempool;
msgpack::object o =
msgpack::unpack(buffer.data(), buffer.size(), mempool);
msgpack::unpacked result;
msgpack::unpack(result, buffer.data(), buffer.size());
msgpack::object o = result.get();
myprotocol::MultiGet req;
msgpack::convert(req, o);
o.convert(req);
std::cout << "received: " << o << std::endl;
}
}