Replaced msgpack::unpacked with msgpack::object_handle.

msgpack::unpacked is a typedef of the msgpack::object_handle.
I recommend using msgpack::object_handle. It can be used not only
holding unpacked msgpack objects but also msgpack::objects that are
created by any types.

Replaced unpack() APIs in test codes and examples. They used to use old
APIs.
This commit is contained in:
Takatoshi Kondo
2016-03-21 15:22:50 +09:00
parent 85164687f3
commit 1bfcf55469
43 changed files with 2357 additions and 2359 deletions

View File

@@ -37,11 +37,11 @@ void test_map_pack_unpack() {
buffer.seekg(0);
std::string str(buffer.str());
msgpack::unpacked unpacked;
std::cout << "Start unpacking...by void unpack(unpacked& result, const char* data, size_t len)" << std::endl;
msgpack::object_handle oh;
std::cout << "Start unpacking...by void unpack(object_handle& oh, const char* data, size_t len)" << std::endl;
{
boost::timer::cpu_timer timer;
msgpack::unpack(unpacked, str.data(), str.size());
msgpack::unpack(oh, str.data(), str.size());
std::string result = timer.format();
std::cout << result << std::endl;
}
@@ -50,7 +50,7 @@ void test_map_pack_unpack() {
std::cout << "Start converting..." << std::endl;
{
boost::timer::cpu_timer timer;
unpacked.get().convert(m2);
oh.get().convert(m2);
std::string result = timer.format();
std::cout << result << std::endl;
}