10 #ifndef MSGPACK_V1_UNPACK_HPP
11 #define MSGPACK_V1_UNPACK_HPP
25 #if !defined(MSGPACK_USE_CPP03)
29 #include <boost/assert.hpp>
119 #if SIZE_MAX == UINT_MAX
131 #if defined(__GNUC__) && !defined(__clang__)
145 #if SIZE_MAX == UINT_MAX
157 #if defined(__GNUC__) && !defined(__clang__)
177 std::memcpy(tmp, p, l);
196 std::memcpy(tmp, p, l);
215 std::memcpy(tmp, p, l);
218 o.
via.
ext.
size =
static_cast<uint32_t
>(l - 1);
227 std::size_t
count()
const {
return m_count; }
237 uint32_t m_container_type;
243 #if defined(MSGPACK_USE_CPP03)
246 new (buffer) std::atomic<unsigned int>(1);
252 #if defined(MSGPACK_USE_CPP03)
257 if (--*
reinterpret_cast<std::atomic<unsigned int>*
>(buffer) == 0) {
265 #if defined(MSGPACK_USE_CPP03)
268 ++*
reinterpret_cast<std::atomic<unsigned int>*
>(buffer);
272 #if defined(MSGPACK_USE_CPP03)
278 inline std::atomic<unsigned int>
const&
get_count(
void* buffer)
280 return *
reinterpret_cast<std::atomic<unsigned int>*
>(buffer);
284 template <
typename T>
293 template <
typename T>
294 inline typename msgpack::enable_if<
sizeof(T) ==
sizeof(
fix_tag)>::type
load(uint32_t& dst,
const char* n) {
295 dst =
static_cast<uint32_t
>(*
reinterpret_cast<const uint8_t*
>(n)) & 0x0f;
298 template <
typename T>
299 inline typename msgpack::enable_if<
sizeof(T) == 1>::type
load(T& dst,
const char* n) {
300 dst =
static_cast<T
>(*
reinterpret_cast<const uint8_t*
>(n));
303 template <
typename T>
304 inline typename msgpack::enable_if<
sizeof(T) == 2>::type
load(T& dst,
const char* n) {
308 template <
typename T>
309 inline typename msgpack::enable_if<
sizeof(T) == 4>::type
load(T& dst,
const char* n) {
313 template <
typename T>
314 inline typename msgpack::enable_if<
sizeof(T) == 8>::type
load(T& dst,
const char* n) {
337 return m_stack[0].obj();
350 int execute(
const char*
data, std::size_t len, std::size_t& off);
353 template <
typename T>
354 static uint32_t next_cs(T p)
356 return static_cast<uint32_t
>(*p) & 0x1f;
359 template <
typename T,
typename Func>
362 uint32_t container_type,
364 const char* load_pos,
367 load<T>(tmp, load_pos);
368 f(m_user, tmp, m_stack.back().obj());
370 obj = m_stack.back().obj();
371 int ret = push_proc(obj, off);
372 if (ret != 0)
return ret;
375 m_stack.back().set_container_type(container_type);
376 m_stack.back().set_count(tmp);
377 if (m_stack.size() <= m_user.
limit().
depth()) {
378 m_stack.push_back(unpack_stack());
392 if(m_stack.size() == 1) {
395 unpack_stack& sp = *(m_stack.end() - 2);
396 switch(sp.container_type()) {
399 if(sp.decr_count() == 0) {
414 if(sp.decr_count() == 0) {
431 int ret = push_item(obj);
433 m_stack[0].set_obj(obj);
436 off =
static_cast<std::size_t
>(m_current - m_start);
439 off =
static_cast<std::size_t
>(m_current - m_start);
448 template <std::
size_t N>
449 static void check_ext_size(std::size_t ) {
454 char const* m_current;
459 std::vector<unpack_stack> m_stack;
463 inline void context::check_ext_size<4>(std::size_t
size) {
469 BOOST_ASSERT(len >= off);
472 m_current =
data + off;
473 const char*
const pe =
data + len;
478 if(m_current == pe) {
479 off =
static_cast<std::size_t
>(m_current - m_start);
482 bool fixed_trail_again =
false;
485 fixed_trail_again =
false;
486 int selector = *
reinterpret_cast<const unsigned char*
>(m_current);
487 if (0x00 <= selector && selector <= 0x7f) {
488 unpack_uint8(*
reinterpret_cast<const uint8_t*
>(m_current), obj);
489 int ret = push_proc(obj, off);
490 if (ret != 0)
return ret;
491 }
else if(0xe0 <= selector && selector <= 0xff) {
492 unpack_int8(*
reinterpret_cast<const int8_t*
>(m_current), obj);
493 int ret = push_proc(obj, off);
494 if (ret != 0)
return ret;
495 }
else if (0xc4 <= selector && selector <= 0xdf) {
496 const uint32_t trail[] = {
526 m_trail = trail[selector - 0xc4];
527 m_cs = next_cs(m_current);
528 fixed_trail_again =
true;
529 }
else if(0xa0 <= selector && selector <= 0xbf) {
530 m_trail =
static_cast<uint32_t
>(*m_current) & 0x1f;
532 unpack_str(m_user, n,
static_cast<uint32_t
>(m_trail), obj);
533 int ret = push_proc(obj, off);
534 if (ret != 0)
return ret;
538 fixed_trail_again =
true;
541 }
else if(0x90 <= selector && selector <= 0x9f) {
542 int ret = push_aggregate<fix_tag>(
544 if (ret != 0)
return ret;
545 }
else if(0x80 <= selector && selector <= 0x8f) {
546 int ret = push_aggregate<fix_tag>(
548 if (ret != 0)
return ret;
549 }
else if(selector == 0xc2) {
551 int ret = push_proc(obj, off);
552 if (ret != 0)
return ret;
553 }
else if(selector == 0xc3) {
555 int ret = push_proc(obj, off);
556 if (ret != 0)
return ret;
557 }
else if(selector == 0xc0) {
559 int ret = push_proc(obj, off);
560 if (ret != 0)
return ret;
562 off =
static_cast<std::size_t
>(m_current - m_start);
568 if (fixed_trail_again) {
570 fixed_trail_again =
false;
572 if(
static_cast<std::size_t
>(pe - m_current) < m_trail) {
573 off =
static_cast<std::size_t
>(m_current - m_start);
577 m_current += m_trail - 1;
582 union { uint32_t i;
float f; } mem;
583 load<uint32_t>(mem.i, n);
585 int ret = push_proc(obj, off);
586 if (ret != 0)
return ret;
589 union { uint64_t i;
double f; } mem;
590 load<uint64_t>(mem.i, n);
591 #if defined(TARGET_OS_IPHONE)
593 #elif defined(__arm__) && !(__ARM_EABI__)
595 mem.i = (mem.i & 0xFFFFFFFFUL) << 32UL | (mem.i >> 32UL);
598 int ret = push_proc(obj, off);
599 if (ret != 0)
return ret;
603 load<uint8_t>(tmp, n);
605 int ret = push_proc(obj, off);
606 if (ret != 0)
return ret;
610 load<uint16_t>(tmp, n);
612 int ret = push_proc(obj, off);
613 if (ret != 0)
return ret;
617 load<uint32_t>(tmp, n);
619 int ret = push_proc(obj, off);
620 if (ret != 0)
return ret;
624 load<uint64_t>(tmp, n);
626 int ret = push_proc(obj, off);
627 if (ret != 0)
return ret;
631 load<int8_t>(tmp, n);
633 int ret = push_proc(obj, off);
634 if (ret != 0)
return ret;
638 load<int16_t>(tmp, n);
640 int ret = push_proc(obj, off);
641 if (ret != 0)
return ret;
645 load<int32_t>(tmp, n);
647 int ret = push_proc(obj, off);
648 if (ret != 0)
return ret;
652 load<int64_t>(tmp, n);
654 int ret = push_proc(obj, off);
655 if (ret != 0)
return ret;
659 int ret = push_proc(obj, off);
660 if (ret != 0)
return ret;
664 int ret = push_proc(obj, off);
665 if (ret != 0)
return ret;
669 int ret = push_proc(obj, off);
670 if (ret != 0)
return ret;
674 int ret = push_proc(obj, off);
675 if (ret != 0)
return ret;
679 int ret = push_proc(obj, off);
680 if (ret != 0)
return ret;
684 load<uint8_t>(tmp, n);
687 unpack_str(m_user, n,
static_cast<uint32_t
>(m_trail), obj);
688 int ret = push_proc(obj, off);
689 if (ret != 0)
return ret;
693 fixed_trail_again =
true;
698 load<uint8_t>(tmp, n);
701 unpack_bin(m_user, n,
static_cast<uint32_t
>(m_trail), obj);
702 int ret = push_proc(obj, off);
703 if (ret != 0)
return ret;
707 fixed_trail_again =
true;
712 load<uint8_t>(tmp, n);
716 int ret = push_proc(obj, off);
717 if (ret != 0)
return ret;
721 fixed_trail_again =
true;
726 load<uint16_t>(tmp, n);
729 unpack_str(m_user, n,
static_cast<uint32_t
>(m_trail), obj);
730 int ret = push_proc(obj, off);
731 if (ret != 0)
return ret;
735 fixed_trail_again =
true;
740 load<uint16_t>(tmp, n);
743 unpack_bin(m_user, n,
static_cast<uint32_t
>(m_trail), obj);
744 int ret = push_proc(obj, off);
745 if (ret != 0)
return ret;
749 fixed_trail_again =
true;
754 load<uint16_t>(tmp, n);
758 int ret = push_proc(obj, off);
759 if (ret != 0)
return ret;
763 fixed_trail_again =
true;
768 load<uint32_t>(tmp, n);
771 unpack_str(m_user, n,
static_cast<uint32_t
>(m_trail), obj);
772 int ret = push_proc(obj, off);
773 if (ret != 0)
return ret;
777 fixed_trail_again =
true;
782 load<uint32_t>(tmp, n);
785 unpack_bin(m_user, n,
static_cast<uint32_t
>(m_trail), obj);
786 int ret = push_proc(obj, off);
787 if (ret != 0)
return ret;
791 fixed_trail_again =
true;
796 load<uint32_t>(tmp, n);
797 check_ext_size<sizeof(std::size_t)>(tmp);
802 int ret = push_proc(obj, off);
803 if (ret != 0)
return ret;
807 fixed_trail_again =
true;
811 unpack_str(m_user, n,
static_cast<uint32_t
>(m_trail), obj);
812 int ret = push_proc(obj, off);
813 if (ret != 0)
return ret;
816 unpack_bin(m_user, n,
static_cast<uint32_t
>(m_trail), obj);
817 int ret = push_proc(obj, off);
818 if (ret != 0)
return ret;
822 int ret = push_proc(obj, off);
823 if (ret != 0)
return ret;
826 int ret = push_aggregate<uint16_t>(
828 if (ret != 0)
return ret;
832 int ret = push_aggregate<uint32_t>(
834 if (ret != 0)
return ret;
837 int ret = push_aggregate<uint16_t>(
839 if (ret != 0)
return ret;
843 int ret = push_aggregate<uint32_t>(
845 if (ret != 0)
return ret;
848 off =
static_cast<std::size_t
>(m_current - m_start);
852 }
while(m_current != pe);
854 off =
static_cast<std::size_t
>(m_current - m_start);
877 #if !defined(MSGPACK_USE_CPP03)
1038 void expand_buffer(std::size_t
size);
1048 std::size_t m_parsed;
1049 msgpack::unique_ptr<msgpack::zone> m_z;
1050 std::size_t m_initial_buffer_size;
1053 #if defined(MSGPACK_USE_CPP03)
1065 std::size_t initial_buffer_size,
1067 :m_z(new
msgpack::
zone), m_ctx(f, user_data, limit)
1073 char*
buffer =
static_cast<char*
>(::malloc(initial_buffer_size));
1075 throw std::bad_alloc();
1080 m_free = initial_buffer_size - m_used;
1083 m_initial_buffer_size = initial_buffer_size;
1092 #if !defined(MSGPACK_USE_CPP03)
1096 :m_buffer(other.m_buffer),
1097 m_used(other.m_used),
1098 m_free(other.m_free),
1100 m_parsed(other.m_parsed),
1101 m_z(std::move(other.m_z)),
1102 m_initial_buffer_size(other.m_initial_buffer_size),
1103 m_ctx(other.m_ctx) {
1109 new (
this)
unpacker(std::move(other));
1125 if(m_free >=
size)
return;
1126 expand_buffer(
size);
1129 inline void unpacker::expand_buffer(std::size_t
size)
1138 if(m_free >=
size)
return;
1142 std::size_t next_size = (m_used + m_free) * 2;
1143 while(next_size <
size + m_used) {
1144 std::size_t tmp_next_size = next_size * 2;
1145 if (tmp_next_size <= next_size) {
1146 next_size =
size + m_used;
1149 next_size = tmp_next_size;
1152 char* tmp =
static_cast<char*
>(::realloc(m_buffer, next_size));
1154 throw std::bad_alloc();
1158 m_free = next_size - m_used;
1161 std::size_t next_size = m_initial_buffer_size;
1162 std::size_t not_parsed = m_used - m_off;
1164 std::size_t tmp_next_size = next_size * 2;
1165 if (tmp_next_size <= next_size) {
1169 next_size = tmp_next_size;
1172 char* tmp =
static_cast<char*
>(::malloc(next_size));
1174 throw std::bad_alloc();
1179 std::memcpy(tmp+
COUNTER_SIZE, m_buffer + m_off, not_parsed);
1196 m_free = next_size - m_used;
1203 return m_buffer + m_used;
1220 int ret = execute_imp();
1226 result.
zone().reset();
1242 return next(result, referenced);
1247 return next(*result);
1253 int ret = execute_imp();
1256 }
else if(ret == 0) {
1263 inline int unpacker::execute_imp()
1265 std::size_t off = m_off;
1266 int ret = m_ctx.
execute(m_buffer, m_used, m_off);
1268 m_parsed += m_off - off;
1275 return m_ctx.
data();
1297 inline bool unpacker::flush_zone()
1322 return m_parsed - m_off + m_used;
1332 return m_buffer + m_off;
1337 return m_used - m_off;
1358 std::size_t noff = off;
1372 int e = ctx.
execute(data, len, noff);
1384 result = ctx.
data();
1398 const char* data, std::size_t len, std::size_t& off,
bool& referenced,
1406 std::size_t noff = off;
1408 data, len, noff, *z, obj, referenced, f, user_data, limit);
1427 const char* data, std::size_t len, std::size_t& off,
1432 return unpack(data, len, off, referenced, f, user_data, limit);
1436 const char* data, std::size_t len,
bool& referenced,
1440 std::size_t off = 0;
1441 return unpack(data, len, off, referenced, f, user_data, limit);
1445 const char* data, std::size_t len,
1450 std::size_t off = 0;
1451 return unpack(data, len, off, referenced, f, user_data, limit);
1456 const char* data, std::size_t len, std::size_t& off,
bool& referenced,
1463 std::size_t noff = off;
1465 data, len, noff, *z, obj, referenced, f, user_data, limit);
1471 result.
zone() = msgpack::move(z);
1476 result.
zone() = msgpack::move(z);
1488 const char* data, std::size_t len, std::size_t& off,
1493 unpack(result, data, len, off, referenced, f, user_data, limit);
1498 const char* data, std::size_t len,
bool& referenced,
1502 std::size_t off = 0;
1503 unpack(result, data, len, off, referenced, f, user_data, limit);
1508 const char* data, std::size_t len,
1513 std::size_t off = 0;
1514 unpack(result, data, len, off, referenced, f, user_data, limit);
1520 const char* data, std::size_t len, std::size_t& off,
bool& referenced,
1525 std::size_t noff = off;
1528 data, len, noff, z, obj, referenced, f, user_data, limit);
1548 const char* data, std::size_t len, std::size_t& off,
1553 return unpack(z, data, len, off, referenced, f, user_data, limit);
1558 const char* data, std::size_t len,
bool& referenced,
1562 std::size_t off = 0;
1563 return unpack(z, data, len, off, referenced, f, user_data, limit);
1568 const char* data, std::size_t len,
1573 std::size_t off = 0;
1574 return unpack(z, data, len, off, referenced, f, user_data, limit);
1582 const
char* data, std::
size_t len, std::
size_t* off,
bool* referenced,
1587 if (referenced)
unpack(*result, data, len, *off, *referenced, f, user_data, limit);
1588 else unpack(*result, data, len, *off, f, user_data, limit);
1590 if (referenced)
unpack(*result, data, len, *referenced, f, user_data, limit);
1591 else unpack(*result, data, len, f, user_data, limit);
Definition: unpack.hpp:318
int execute(const char *data, std::size_t len, std::size_t &off)
Definition: unpack.hpp:467
msgpack::object const & data() const
Definition: unpack.hpp:335
context(unpack_reference_func f, void *user_data, unpack_limit const &limit)
Definition: unpack.hpp:320
unpack_user & user()
Definition: unpack.hpp:340
unpack_user const & user() const
Definition: unpack.hpp:345
void init()
Definition: unpack.hpp:327
Definition: unpack.hpp:222
std::size_t decr_count()
Definition: unpack.hpp:229
std::size_t count() const
Definition: unpack.hpp:227
void set_map_key(msgpack::object const &map_key)
Definition: unpack.hpp:233
uint32_t container_type() const
Definition: unpack.hpp:230
msgpack::object const & obj() const
Definition: unpack.hpp:224
msgpack::object const & map_key() const
Definition: unpack.hpp:232
void set_obj(msgpack::object const &obj)
Definition: unpack.hpp:226
void set_container_type(uint32_t container_type)
Definition: unpack.hpp:231
void set_count(std::size_t count)
Definition: unpack.hpp:228
msgpack::object & obj()
Definition: unpack.hpp:225
Definition: unpack.hpp:46
unpack_limit const & limit() const
Definition: unpack.hpp:59
unpack_reference_func reference_func() const
Definition: unpack.hpp:57
unpack_limit & limit()
Definition: unpack.hpp:60
msgpack::zone const & zone() const
Definition: unpack.hpp:52
unpack_user(unpack_reference_func f=MSGPACK_NULLPTR, void *user_data=MSGPACK_NULLPTR, unpack_limit const &limit=unpack_limit())
Definition: unpack.hpp:48
void set_zone(msgpack::zone &zone)
Definition: unpack.hpp:54
void * user_data() const
Definition: unpack.hpp:58
bool referenced() const
Definition: unpack.hpp:55
void set_referenced(bool referenced)
Definition: unpack.hpp:56
msgpack::zone & zone()
Definition: unpack.hpp:53
The class holds object and zone.
Definition: object.hpp:44
msgpack::unique_ptr< msgpack::zone > & zone()
Get unique_ptr reference of zone.
Definition: object.hpp:90
void set(msgpack::object const &obj)
Definition: object.hpp:64
Definition: unpack_decl.hpp:87
std::size_t bin() const
Definition: unpack_decl.hpp:105
std::size_t str() const
Definition: unpack_decl.hpp:104
std::size_t map() const
Definition: unpack_decl.hpp:103
std::size_t depth() const
Definition: unpack_decl.hpp:107
std::size_t array() const
Definition: unpack_decl.hpp:102
std::size_t ext() const
Definition: unpack_decl.hpp:106
Unpacking class for a stream deserialization.
Definition: unpack.hpp:862
msgpack::zone * release_zone()
Definition: unpack.hpp:1278
void reserve_buffer(std::size_t size=MSGPACK_UNPACKER_RESERVE_SIZE)
Reserve a buffer memory.
Definition: unpack.hpp:1123
void reset_zone()
Definition: unpack.hpp:1292
void remove_nonparsed_buffer()
Remove nonparsed buffer and reset the current position as a new start point.
Definition: unpack.hpp:1345
~unpacker()
Definition: unpack.hpp:1116
msgpack::object const & data()
Definition: unpack.hpp:1273
std::size_t nonparsed_size() const
Get the size of the buffer that is not parsed.
Definition: unpack.hpp:1335
void buffer_consumed(std::size_t size)
Notify a buffer consumed information to msgpack::unpacker.
Definition: unpack.hpp:1211
unpacker(unpack_reference_func f=&unpacker::default_reference_func, void *user_data=MSGPACK_NULLPTR, std::size_t initial_buffer_size=MSGPACK_UNPACKER_INIT_BUFFER_SIZE, unpack_limit const &limit=unpack_limit())
Constructor.
Definition: unpack.hpp:1063
std::size_t parsed_size() const
Get parsed message size.
Definition: unpack.hpp:1325
std::size_t message_size() const
Get message size.
Definition: unpack.hpp:1320
char * buffer()
Get buffer pointer.
Definition: unpack.hpp:1201
char * nonparsed_buffer()
Get the address that is not parsed in the buffer.
Definition: unpack.hpp:1330
bool execute()
Definition: unpack.hpp:1251
void reset()
Definition: unpack.hpp:1313
std::size_t buffer_capacity() const
Get buffer capacity.
Definition: unpack.hpp:1206
void skip_nonparsed_buffer(std::size_t size)
Skip the specified size of non-parsed buffer.
Definition: unpack.hpp:1340
unpacker & operator=(unpacker &&other)
Definition: unpack.hpp:1107
bool next(msgpack::object_handle *result)
Unpack one msgpack::object. [obsolete].
Definition: unpack.hpp:1245
Definition: cpp03_zone.hpp:31
void * allocate_align(size_t size, size_t align=MSGPACK_ZONE_ALIGN)
Definition: cpp03_zone.hpp:256
void unpack_int32(int32_t d, msgpack::object &o)
Definition: unpack.hpp:90
void unpack_ext(unpack_user &u, const char *p, std::size_t l, msgpack::object &o)
Definition: unpack.hpp:205
void unpack_float(float d, msgpack::object &o)
Definition: unpack.hpp:98
void unpack_false(msgpack::object &o)
Definition: unpack.hpp:110
void unpack_int16(int16_t d, msgpack::object &o)
Definition: unpack.hpp:86
void unpack_str(unpack_user &u, const char *p, uint32_t l, msgpack::object &o)
Definition: unpack.hpp:167
void unpack_nil(msgpack::object &o)
Definition: unpack.hpp:104
void init_count(void *buffer)
Definition: unpack.hpp:241
parse_return unpack_imp(const char *data, std::size_t len, std::size_t &off, msgpack::zone &result_zone, msgpack::object &result, bool &referenced, unpack_reference_func f=MSGPACK_NULLPTR, void *user_data=MSGPACK_NULLPTR, unpack_limit const &limit=unpack_limit())
Definition: unpack.hpp:1353
void unpack_uint64(uint64_t d, msgpack::object &o)
Definition: unpack.hpp:79
std::atomic< unsigned int > const & get_count(void *buffer)
Definition: unpack.hpp:278
void unpack_array_item(msgpack::object &c, msgpack::object const &o)
Definition: unpack.hpp:129
void decr_count(void *buffer)
Definition: unpack.hpp:250
void unpack_int64(int64_t d, msgpack::object &o)
Definition: unpack.hpp:94
void unpack_uint8(uint8_t d, msgpack::object &o)
Definition: unpack.hpp:70
void unpack_bin(unpack_user &u, const char *p, uint32_t l, msgpack::object &o)
Definition: unpack.hpp:186
void unpack_int8(int8_t d, msgpack::object &o)
Definition: unpack.hpp:82
void incr_count(void *buffer)
Definition: unpack.hpp:263
void unpack_true(msgpack::object &o)
Definition: unpack.hpp:107
void unpack_map_item(msgpack::object &c, msgpack::object const &k, msgpack::object const &v)
Definition: unpack.hpp:155
void unpack_uint16(uint16_t d, msgpack::object &o)
Definition: unpack.hpp:73
void unpack_double(double d, msgpack::object &o)
Definition: unpack.hpp:101
void unpack_uint32(uint32_t d, msgpack::object &o)
Definition: unpack.hpp:76
msgpack::enable_if< sizeof(T)==sizeof(fix_tag)>::type load(uint32_t &dst, const char *n)
Definition: unpack.hpp:294
std::size_t size(T const &t)
Definition: size_equal_only.hpp:24
object_type
Definition: object_fwd_decl.hpp:27
@ EXT
Definition: object_fwd_decl.hpp:42
@ FLOAT64
Definition: object_fwd_decl.hpp:33
@ BOOLEAN
Definition: object_fwd_decl.hpp:29
@ MAP
Definition: object_fwd_decl.hpp:41
@ NIL
Definition: object_fwd_decl.hpp:28
@ STR
Definition: object_fwd_decl.hpp:38
@ ARRAY
Definition: object_fwd_decl.hpp:40
@ BIN
Definition: object_fwd_decl.hpp:39
@ POSITIVE_INTEGER
Definition: object_fwd_decl.hpp:30
@ NEGATIVE_INTEGER
Definition: object_fwd_decl.hpp:31
@ FLOAT32
Definition: object_fwd_decl.hpp:32
Definition: adaptor_base.hpp:15
bool(* unpack_reference_func)(msgpack::type::object_type type, std::size_t size, void *user_data)
The type of reference or copy judging function.
Definition: unpack_decl.hpp:74
parse_return
Definition: parse_return.hpp:23
@ PARSE_CONTINUE
Definition: parse_return.hpp:26
@ PARSE_EXTRA_BYTES
Definition: parse_return.hpp:25
@ PARSE_SUCCESS
Definition: parse_return.hpp:24
@ PARSE_PARSE_ERROR
Definition: parse_return.hpp:27
msgpack::object_handle unpack(const char *data, std::size_t len, std::size_t &off, bool &referenced, unpack_reference_func f, void *user_data, unpack_limit const &limit)
Unpack msgpack::object from a buffer.
Definition: unpack.hpp:1397
Definition: unpack_exception.hpp:61
Definition: unpack_exception.hpp:88
Definition: unpack_exception.hpp:106
Definition: unpack_decl.hpp:180
Definition: unpack.hpp:113
void operator()(unpack_user &u, uint32_t n, msgpack::object &o) const
Definition: unpack.hpp:114
Definition: unpack.hpp:139
void operator()(unpack_user &u, uint32_t n, msgpack::object &o) const
Definition: unpack.hpp:140
uint32_t type
Definition: unpack.hpp:290
Definition: unpack.hpp:285
T type
Definition: unpack.hpp:286
Definition: unpack_exception.hpp:97
Definition: unpack_exception.hpp:43
Definition: unpack_exception.hpp:70
uint32_t size
Definition: object_fwd.hpp:23
msgpack::object * ptr
Definition: object_fwd.hpp:24
uint32_t size
Definition: object_fwd.hpp:38
const char * ptr
Definition: object_fwd.hpp:39
const char * ptr
Definition: object_fwd.hpp:46
uint32_t size
Definition: object_fwd.hpp:45
Definition: object.hpp:30
msgpack::object val
Definition: object.hpp:32
msgpack::object key
Definition: object.hpp:31
uint32_t size
Definition: object_fwd.hpp:28
msgpack::object_kv * ptr
Definition: object_fwd.hpp:29
const char * ptr
Definition: object_fwd.hpp:34
uint32_t size
Definition: object_fwd.hpp:33
Object class that corresponding to MessagePack format object.
Definition: object_fwd.hpp:75
union_type via
Definition: object_fwd.hpp:93
msgpack::type::object_type type
Definition: object_fwd.hpp:92
Definition: unpack_exception.hpp:34
Definition: unpack_exception.hpp:79
unsigned int _msgpack_atomic_counter_t
Definition: sysdep.hpp:73
#define _msgpack_load64(cast, from, to)
Definition: sysdep.hpp:172
#define _msgpack_sync_incr_and_fetch(ptr)
Definition: sysdep.hpp:75
#define _msgpack_load16(cast, from, to)
Definition: sysdep.hpp:163
#define _msgpack_sync_decr_and_fetch(ptr)
Definition: sysdep.hpp:74
#define _msgpack_load32(cast, from, to)
Definition: sysdep.hpp:168
bool boolean
Definition: object_fwd.hpp:77
msgpack::object_array array
Definition: object_fwd.hpp:85
msgpack::object_ext ext
Definition: object_fwd.hpp:89
msgpack::object_str str
Definition: object_fwd.hpp:87
uint64_t u64
Definition: object_fwd.hpp:78
int64_t i64
Definition: object_fwd.hpp:79
msgpack::object_bin bin
Definition: object_fwd.hpp:88
double f64
Definition: object_fwd.hpp:84
msgpack::object_map map
Definition: object_fwd.hpp:86
@ MSGPACK_CT_ARRAY_ITEM
Definition: unpack_define.hpp:69
@ MSGPACK_CT_MAP_VALUE
Definition: unpack_define.hpp:71
@ MSGPACK_CT_MAP_KEY
Definition: unpack_define.hpp:70
#define MSGPACK_EMBED_STACK_SIZE
Definition: unpack_define.hpp:16
@ MSGPACK_CS_EXT_32
Definition: unpack_define.hpp:33
@ MSGPACK_CS_EXT_16
Definition: unpack_define.hpp:32
@ MSGPACK_CS_STR_8
Definition: unpack_define.hpp:52
@ MSGPACK_CS_STR_32
Definition: unpack_define.hpp:54
@ MSGPACK_CS_DOUBLE
Definition: unpack_define.hpp:36
@ MSGPACK_CS_FIXEXT_4
Definition: unpack_define.hpp:48
@ MSGPACK_CS_UINT_32
Definition: unpack_define.hpp:39
@ MSGPACK_CS_MAP_16
Definition: unpack_define.hpp:57
@ MSGPACK_CS_BIN_32
Definition: unpack_define.hpp:29
@ MSGPACK_CS_BIN_16
Definition: unpack_define.hpp:28
@ MSGPACK_CS_UINT_64
Definition: unpack_define.hpp:40
@ MSGPACK_CS_FLOAT
Definition: unpack_define.hpp:35
@ MSGPACK_CS_ARRAY_32
Definition: unpack_define.hpp:56
@ MSGPACK_CS_FIXEXT_1
Definition: unpack_define.hpp:46
@ MSGPACK_CS_INT_8
Definition: unpack_define.hpp:41
@ MSGPACK_CS_INT_32
Definition: unpack_define.hpp:43
@ MSGPACK_ACS_BIN_VALUE
Definition: unpack_define.hpp:63
@ MSGPACK_CS_ARRAY_16
Definition: unpack_define.hpp:55
@ MSGPACK_CS_FIXEXT_16
Definition: unpack_define.hpp:50
@ MSGPACK_CS_STR_16
Definition: unpack_define.hpp:53
@ MSGPACK_ACS_STR_VALUE
Definition: unpack_define.hpp:62
@ MSGPACK_CS_BIN_8
Definition: unpack_define.hpp:27
@ MSGPACK_CS_INT_64
Definition: unpack_define.hpp:44
@ MSGPACK_CS_FIXEXT_2
Definition: unpack_define.hpp:47
@ MSGPACK_CS_HEADER
Definition: unpack_define.hpp:21
@ MSGPACK_CS_FIXEXT_8
Definition: unpack_define.hpp:49
@ MSGPACK_CS_MAP_32
Definition: unpack_define.hpp:58
@ MSGPACK_ACS_EXT_VALUE
Definition: unpack_define.hpp:64
@ MSGPACK_CS_EXT_8
Definition: unpack_define.hpp:31
@ MSGPACK_CS_INT_16
Definition: unpack_define.hpp:42
@ MSGPACK_CS_UINT_16
Definition: unpack_define.hpp:38
@ MSGPACK_CS_UINT_8
Definition: unpack_define.hpp:37
#define MSGPACK_DEPRECATED(msg)
Definition: cpp_config.hpp:138
#define MSGPACK_NULLPTR
Definition: cpp_config_decl.hpp:85
#define MSGPACK_ZONE_ALIGNOF(type)
Definition: cpp03_zone_decl.hpp:30
#define MSGPACK_UNPACKER_INIT_BUFFER_SIZE
Definition: unpack_decl.hpp:43
#define MSGPACK_UNPACKER_RESERVE_SIZE
Definition: unpack_decl.hpp:47
const size_t COUNTER_SIZE
Definition: unpack_decl.hpp:40
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition: versioning.hpp:66