10#ifndef MSGPACK_TIMESTAMP_H
11#define MSGPACK_TIMESTAMP_H
27 if (
obj->via.ext.type != -1)
return false;
28 switch (
obj->via.ext.size) {
33 _msgpack_load32(uint32_t,
obj->via.ext.ptr, &v);
39 _msgpack_load64(uint64_t,
obj->via.ext.ptr, &value);
40 ts->
tv_nsec = (uint32_t)(value >> 34);
41 ts->
tv_sec = value & 0x00000003ffffffffLL;
45 _msgpack_load32(uint32_t,
obj->via.ext.ptr, &ts->
tv_nsec);
46 _msgpack_load64(int64_t,
obj->via.ext.ptr + 4, &ts->
tv_sec);
@ MSGPACK_OBJECT_EXT
Definition object.h:42
Definition timestamp.h:20
uint32_t tv_nsec
Definition timestamp.h:22
int64_t tv_sec
Definition timestamp.h:21
msgpack_unpack_object obj
Definition unpack_template.h:111