10 #ifndef MSGPACK_V1_TYPE_CARRAY_HPP
11 #define MSGPACK_V1_TYPE_CARRAY_HPP
26 template <
typename T, std::
size_t N>
42 template <std::
size_t N>
63 template <std::
size_t N>
85 template <
typename T, std::
size_t N>
87 template <
typename Stream>
92 for (; ptr != &v[N]; ++ptr) o.
pack(*ptr);
97 template <std::
size_t N>
99 template <
typename Stream>
103 char const* p2 =
static_cast<char const*
>(std::memchr(p,
'\0',
size));
104 uint32_t adjusted_size = p2 ?
static_cast<uint32_t
>(p2 - p) :
size;
111 template <std::
size_t N>
113 template <
typename Stream>
117 char const* p2 =
static_cast<char const*
>(std::memchr(p,
'\0',
size));
118 uint32_t adjusted_size = p2 ?
static_cast<uint32_t
>(p2 - p) :
size;
125 template <std::
size_t N>
126 struct pack<unsigned char[N]> {
127 template <
typename Stream>
129 unsigned char const* p = v;
137 template <std::
size_t N>
138 struct pack<const unsigned char[N]> {
139 template <
typename Stream>
141 unsigned char const* p = v;
149 template <
typename T, std::
size_t N>
158 for (; pv != &v[
size]; ++pv) {
164 template <std::
size_t N>
169 char const* p2 =
static_cast<char const*
>(std::memchr(p,
'\0',
size));
170 uint32_t adjusted_size = p2 ?
static_cast<uint32_t
>(p2 - p) :
size;
175 std::memcpy(ptr, p, adjusted_size);
179 template <std::
size_t N>
184 char const* p2 =
static_cast<char const*
>(std::memchr(p,
'\0',
size));
185 uint32_t adjusted_size = p2 ?
static_cast<uint32_t
>(p2 - p) :
size;
190 std::memcpy(ptr, p, adjusted_size);
194 template <std::
size_t N>
202 std::memcpy(ptr, v,
size);
206 template <std::
size_t N>
214 std::memcpy(ptr, v,
size);
218 template <std::
size_t N>
223 char const* p2 =
static_cast<char const*
>(std::memchr(p,
'\0',
size));
224 uint32_t adjusted_size = p2 ?
static_cast<uint32_t
>(p2 - p) :
size;
231 template <std::
size_t N>
236 char const* p2 =
static_cast<char const*
>(std::memchr(p,
'\0',
size));
237 uint32_t adjusted_size = p2 ?
static_cast<uint32_t
>(p2 - p) :
size;
The class template that supports continuous packing.
Definition: pack.hpp:33
packer< Stream > & pack_bin(uint32_t l)
Packing bin header and length.
Definition: pack.hpp:1290
packer< Stream > & pack_str_body(const char *b, uint32_t l)
Packing str body.
Definition: pack.hpp:1255
packer< Stream > & pack_bin_body(const char *b, uint32_t l)
Packing bin body.
Definition: pack.hpp:1309
packer< Stream > & pack_str(uint32_t l)
Packing str header and length.
Definition: pack.hpp:1232
packer< Stream > & pack_array(uint32_t n)
Packing array header and size.
Definition: pack.hpp:1195
packer< Stream > & pack(const T &v)
Packing function template.
Definition: object_fwd.hpp:231
void * allocate_align(size_t size, size_t align=MSGPACK_ZONE_ALIGN)
Definition: cpp03_zone.hpp:256
std::size_t size(T const &t)
Definition: size_equal_only.hpp:24
@ STR
Definition: object_fwd_decl.hpp:38
@ ARRAY
Definition: object_fwd_decl.hpp:40
@ BIN
Definition: object_fwd_decl.hpp:39
Definition: adaptor_base.hpp:15
uint32_t checked_get_container_size(T size)
Definition: check_container_size.hpp:55
msgpack::object const & operator()(msgpack::object const &o, T *v) const
Definition: carray.hpp:28
msgpack::object const & operator()(msgpack::object const &o, char(&v)[N]) const
Definition: carray.hpp:44
msgpack::object const & operator()(msgpack::object const &o, unsigned char(&v)[N]) const
Definition: carray.hpp:65
Definition: adaptor_base.hpp:27
void operator()(msgpack::object &o, const char(&v)[N]) const
Definition: carray.hpp:220
void operator()(msgpack::object &o, const char(&v)[N]) const
Definition: carray.hpp:233
void operator()(msgpack::object::with_zone &o, const T(&v)[N]) const
Definition: carray.hpp:151
void operator()(msgpack::object::with_zone &o, const char(&v)[N]) const
Definition: carray.hpp:166
void operator()(msgpack::object::with_zone &o, const char(&v)[N]) const
Definition: carray.hpp:181
void operator()(msgpack::object::with_zone &o, const unsigned char(&v)[N]) const
Definition: carray.hpp:208
void operator()(msgpack::object::with_zone &o, const unsigned char(&v)[N]) const
Definition: carray.hpp:196
Definition: adaptor_base.hpp:43
Definition: adaptor_base.hpp:38
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, const T(&v)[N]) const
Definition: carray.hpp:88
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, const char(&v)[N]) const
Definition: carray.hpp:100
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, const char(&v)[N]) const
Definition: carray.hpp:114
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, const unsigned char(&v)[N]) const
Definition: carray.hpp:140
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, const unsigned char(&v)[N]) const
Definition: carray.hpp:128
Definition: adaptor_base.hpp:32
Definition: object.hpp:35
msgpack::zone & zone
Definition: object.hpp:37
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: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::enable_if< !msgpack::is_array< T >::value &&!msgpack::is_pointer< T >::value, T & >::type convert(T &v) const
Convert the object.
Definition: object.hpp:1071
msgpack::type::object_type type
Definition: object_fwd.hpp:92
msgpack::object_array array
Definition: object_fwd.hpp:85
msgpack::object_str str
Definition: object_fwd.hpp:87
msgpack::object_bin bin
Definition: object_fwd.hpp:88
#define MSGPACK_ZONE_ALIGNOF(type)
Definition: cpp03_zone_decl.hpp:30
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition: versioning.hpp:66