mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-09-16 19:27:16 +02:00
Added msgpack prefix to support API versioning.
This commit is contained in:
parent
f6d0cd9a4b
commit
f399ec8c30
@ -43,18 +43,18 @@
|
||||
#define MSGPACK_ADD_ENUM(enum) \
|
||||
namespace msgpack { \
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) { \
|
||||
inline object const& operator>> (object const& o, enum& v) \
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, enum& v) \
|
||||
{ \
|
||||
int tmp; \
|
||||
o >> tmp; \
|
||||
v = static_cast<enum>(tmp); \
|
||||
return o; \
|
||||
} \
|
||||
inline void operator<< (object& o, const enum& v) \
|
||||
inline void operator<< (msgpack::object& o, const enum& v) \
|
||||
{ \
|
||||
o << static_cast<int>(v); \
|
||||
} \
|
||||
inline void operator<< (object::with_zone& o, const enum& v) \
|
||||
inline void operator<< (msgpack::object::with_zone& o, const enum& v) \
|
||||
{ \
|
||||
o << static_cast<int>(v); \
|
||||
} \
|
||||
@ -90,11 +90,11 @@ struct define<> {
|
||||
}
|
||||
void msgpack_unpack(msgpack::object const& o)
|
||||
{
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
||||
}
|
||||
void msgpack_object(msgpack::object* o, msgpack::zone&) const
|
||||
{
|
||||
o->type = type::ARRAY;
|
||||
o->type = msgpack::type::ARRAY;
|
||||
o->via.array.ptr = nullptr;
|
||||
o->via.array.size = 0;
|
||||
}
|
||||
@ -115,7 +115,7 @@ struct define<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> {
|
||||
}
|
||||
void msgpack_unpack(msgpack::object const& o)
|
||||
{
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
||||
const size_t size = o.via.array.size;
|
||||
if(size > 0) {
|
||||
msgpack::object *ptr = o.via.array.ptr;
|
||||
@ -127,11 +127,11 @@ struct define<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> {
|
||||
}
|
||||
void msgpack_object(msgpack::object* o, msgpack::zone& z) const
|
||||
{
|
||||
o->type = type::ARRAY;
|
||||
o->via.array.ptr = static_cast<object*>(z.allocate_align(sizeof(object)*<%=i+1%>));
|
||||
o->type = msgpack::type::ARRAY;
|
||||
o->via.array.ptr = static_cast<msgpack::object*>(z.allocate_align(sizeof(msgpack::object)*<%=i+1%>));
|
||||
o->via.array.size = <%=i+1%>;
|
||||
<%0.upto(i) {|j|%>
|
||||
o->via.array.ptr[<%=j%>] = object(a<%=j%>, z);<%}%>
|
||||
o->via.array.ptr[<%=j%>] = msgpack::object(a<%=j%>, z);<%}%>
|
||||
}
|
||||
<%0.upto(i) {|j|%>
|
||||
A<%=j%>& a<%=j%>;<%}%>
|
||||
|
@ -95,7 +95,7 @@ private:
|
||||
template <>
|
||||
struct tuple<> {
|
||||
tuple() {}
|
||||
tuple(object const& o) { o.convert(*this); }
|
||||
tuple(msgpack::object const& o) { o.convert(*this); }
|
||||
typedef tuple<> value_type;
|
||||
};
|
||||
<%0.upto(GENERATION_LIMIT) {|i|%>
|
||||
@ -105,7 +105,7 @@ struct tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> {
|
||||
tuple() {}
|
||||
tuple(typename tuple_type<A0>::transparent_reference _a0<%1.upto(i) {|j|%>, typename tuple_type<A<%=j%>>::transparent_reference _a<%=j%><%}%>) :
|
||||
a0(_a0)<%1.upto(i) {|j|%>, a<%=j%>(_a<%=j%>)<%}%> {}
|
||||
tuple(object const& o) { o.convert(*this); }
|
||||
tuple(msgpack::object const& o) { o.convert(*this); }
|
||||
template <int N> typename tuple_element<value_type, N>::reference get()
|
||||
{ return tuple_element<value_type, N>(*this).get(); }
|
||||
template <int N> typename const_tuple_element<value_type, N>::const_reference get() const
|
||||
@ -136,18 +136,18 @@ inline tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_tuple(typename tuple_type<
|
||||
|
||||
} // namespace type
|
||||
|
||||
inline object const& operator>> (
|
||||
object const& o,
|
||||
inline msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<>&) {
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
||||
return o;
|
||||
}
|
||||
<%0.upto(GENERATION_LIMIT) {|i|%>
|
||||
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
|
||||
inline object const& operator>> (
|
||||
object const& o,
|
||||
inline msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>& v) {
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
||||
if(o.via.array.size < <%=i+1%>) { throw type_error(); }
|
||||
<%0.upto(i) {|j|%>
|
||||
o.via.array.ptr[<%=j%>].convert<typename type::tuple_type<A<%=j%>>::type>(v.template get<<%=j%>>());<%}%>
|
||||
@ -175,22 +175,22 @@ inline const packer<Stream>& operator<< (
|
||||
<%}%>
|
||||
|
||||
inline void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<>&) {
|
||||
o.type = type::ARRAY;
|
||||
o.type = msgpack::type::ARRAY;
|
||||
o.via.array.ptr = nullptr;
|
||||
o.via.array.size = 0;
|
||||
}
|
||||
<%0.upto(GENERATION_LIMIT) {|i|%>
|
||||
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
|
||||
inline void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>& v) {
|
||||
o.type = type::ARRAY;
|
||||
o.via.array.ptr = static_cast<object*>(o.zone.allocate_align(sizeof(object)*<%=i+1%>));
|
||||
o.type = msgpack::type::ARRAY;
|
||||
o.via.array.ptr = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*<%=i+1%>));
|
||||
o.via.array.size = <%=i+1%>;
|
||||
<%0.upto(i) {|j|%>
|
||||
o.via.array.ptr[<%=j%>] = object(v.template get<<%=j%>>(), o.zone);<%}%>
|
||||
o.via.array.ptr[<%=j%>] = msgpack::object(v.template get<<%=j%>>(), o.zone);<%}%>
|
||||
}
|
||||
<%}%>
|
||||
|
||||
|
@ -77,14 +77,14 @@ tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_tuple(typename tuple_type<A0>::tr
|
||||
|
||||
} // namespace type
|
||||
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<>&);
|
||||
|
||||
<%0.upto(GENERATION_LIMIT) {|i|%>
|
||||
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>& v);
|
||||
<%}%>
|
||||
|
||||
@ -101,12 +101,12 @@ const packer<Stream>& operator<< (
|
||||
<%}%>
|
||||
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<>&);
|
||||
<%0.upto(GENERATION_LIMIT) {|i|%>
|
||||
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>& v);
|
||||
<%}%>
|
||||
|
||||
|
@ -26,9 +26,9 @@ namespace msgpack {
|
||||
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
inline object const& operator>> (object const& o, bool& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, bool& v)
|
||||
{
|
||||
if(o.type != type::BOOLEAN) { throw type_error(); }
|
||||
if(o.type != msgpack::type::BOOLEAN) { throw type_error(); }
|
||||
v = o.via.boolean;
|
||||
return o;
|
||||
}
|
||||
@ -41,14 +41,14 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const bool& v)
|
||||
return o;
|
||||
}
|
||||
|
||||
inline void operator<< (object& o, bool v)
|
||||
inline void operator<< (msgpack::object& o, bool v)
|
||||
{
|
||||
o.type = type::BOOLEAN;
|
||||
o.type = msgpack::type::BOOLEAN;
|
||||
o.via.boolean = v;
|
||||
}
|
||||
|
||||
inline void operator<< (object::with_zone& o, bool v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, bool v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
@ -25,11 +25,11 @@ namespace msgpack {
|
||||
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
object const& operator>> (object const& o, bool& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, bool& v);
|
||||
template <typename Stream>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const bool& v);
|
||||
void operator<< (object& o, bool v);
|
||||
void operator<< (object::with_zone& o, bool v);
|
||||
void operator<< (msgpack::object& o, bool v);
|
||||
void operator<< (msgpack::object::with_zone& o, bool v);
|
||||
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
@ -35,20 +35,20 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const char* v)
|
||||
return o;
|
||||
}
|
||||
|
||||
inline void operator<< (object::with_zone& o, const char* v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const char* v)
|
||||
{
|
||||
std::size_t size = std::strlen(v);
|
||||
o.type = type::STR;
|
||||
o.type = msgpack::type::STR;
|
||||
char* ptr = static_cast<char*>(o.zone.allocate_align(size));
|
||||
o.via.str.ptr = ptr;
|
||||
o.via.str.size = static_cast<uint32_t>(size);
|
||||
memcpy(ptr, v, size);
|
||||
}
|
||||
|
||||
inline void operator<< (object& o, const char* v)
|
||||
inline void operator<< (msgpack::object& o, const char* v)
|
||||
{
|
||||
std::size_t size = std::strlen(v);
|
||||
o.type = type::STR;
|
||||
o.type = msgpack::type::STR;
|
||||
o.via.str.ptr = v;
|
||||
o.via.str.size = static_cast<uint32_t>(size);
|
||||
}
|
||||
|
@ -28,8 +28,8 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename Stream>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const char* v);
|
||||
void operator<< (object::with_zone& o, const char* v);
|
||||
void operator<< (object& o, const char* v);
|
||||
void operator<< (msgpack::object::with_zone& o, const char* v);
|
||||
void operator<< (msgpack::object& o, const char* v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
@ -29,12 +29,12 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename T, std::size_t N>
|
||||
inline object const& operator>> (object const& o, std::array<T, N>& v) {
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, std::array<T, N>& v) {
|
||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
||||
if(o.via.array.size != N) { throw type_error(); }
|
||||
if(o.via.array.size > 0) {
|
||||
object* p = o.via.array.ptr;
|
||||
object* const pend = o.via.array.ptr + o.via.array.size;
|
||||
msgpack::object* p = o.via.array.ptr;
|
||||
msgpack::object* const pend = o.via.array.ptr + o.via.array.size;
|
||||
T* it = &v[0];
|
||||
do {
|
||||
p->convert(*it);
|
||||
@ -53,16 +53,16 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const std::array<T, N>& v)
|
||||
}
|
||||
|
||||
template <typename T, std::size_t N>
|
||||
inline void operator<< (object::with_zone& o, const std::array<T, N>& v) {
|
||||
o.type = type::ARRAY;
|
||||
inline void operator<< (msgpack::object::with_zone& o, const std::array<T, N>& v) {
|
||||
o.type = msgpack::type::ARRAY;
|
||||
if(v.empty()) {
|
||||
o.via.array.ptr = nullptr;
|
||||
o.via.array.size = 0;
|
||||
} else {
|
||||
object* p = static_cast<object*>(o.zone.allocate_align(sizeof(object)*v.size()));
|
||||
msgpack::object* p = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*v.size()));
|
||||
o.via.array.size = v.size();
|
||||
o.via.array.ptr = p;
|
||||
for (auto const& e : v) *p++ = object(e, o.zone);
|
||||
for (auto const& e : v) *p++ = msgpack::object(e, o.zone);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,14 +27,14 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <std::size_t N>
|
||||
inline object const& operator>> (object const& o, std::array<char, N>& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, std::array<char, N>& v)
|
||||
{
|
||||
switch (o.type) {
|
||||
case type::BIN:
|
||||
case msgpack::type::BIN:
|
||||
if(o.via.bin.size != N) { throw type_error(); }
|
||||
std::memcpy(v.data(), o.via.bin.ptr, o.via.bin.size);
|
||||
break;
|
||||
case type::STR:
|
||||
case msgpack::type::STR:
|
||||
if(o.via.str.size != N) { throw type_error(); }
|
||||
std::memcpy(v.data(), o.via.str.ptr, N);
|
||||
break;
|
||||
@ -55,17 +55,17 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const std::array<char, N>&
|
||||
}
|
||||
|
||||
template <std::size_t N>
|
||||
inline void operator<< (object& o, const std::array<char, N>& v)
|
||||
inline void operator<< (msgpack::object& o, const std::array<char, N>& v)
|
||||
{
|
||||
o.type = type::BIN;
|
||||
o.type = msgpack::type::BIN;
|
||||
o.via.bin.ptr = v.data();
|
||||
o.via.bin.size = static_cast<uint32_t>(v.size());
|
||||
}
|
||||
|
||||
template <std::size_t N>
|
||||
inline void operator<< (object::with_zone& o, const std::array<char, N>& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const std::array<char, N>& v)
|
||||
{
|
||||
o.type = type::BIN;
|
||||
o.type = msgpack::type::BIN;
|
||||
char* ptr = static_cast<char*>(o.zone.allocate_align(v.size()));
|
||||
o.via.bin.ptr = ptr;
|
||||
o.via.bin.size = static_cast<uint32_t>(v.size());
|
||||
|
@ -27,16 +27,16 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <std::size_t N>
|
||||
object const& operator>> (object const& o, std::array<char, N>& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, std::array<char, N>& v);
|
||||
|
||||
template <typename Stream, std::size_t N>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const std::array<char, N>& v);
|
||||
|
||||
template <std::size_t N>
|
||||
void operator<< (object& o, const std::array<char, N>& v);
|
||||
void operator<< (msgpack::object& o, const std::array<char, N>& v);
|
||||
|
||||
template <std::size_t N>
|
||||
void operator<< (object::with_zone& o, const std::array<char, N>& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const std::array<char, N>& v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
@ -29,13 +29,13 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename T, std::size_t N>
|
||||
object const& operator>> (object const& o, std::array<T, N>& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, std::array<T, N>& v);
|
||||
|
||||
template <typename Stream, typename T, std::size_t N>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const std::array<T, N>& v);
|
||||
|
||||
template <typename T, std::size_t N>
|
||||
void operator<< (object::with_zone& o, const std::array<T, N>& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const std::array<T, N>& v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
@ -29,11 +29,11 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename T>
|
||||
inline object const& operator>> (object const& o, std::forward_list<T>& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, std::forward_list<T>& v)
|
||||
{
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
||||
v.resize(o.via.array.size);
|
||||
object* p = o.via.array.ptr;
|
||||
msgpack::object* p = o.via.array.ptr;
|
||||
for (auto &e : v) {
|
||||
p->convert(e);
|
||||
++p;
|
||||
@ -50,19 +50,19 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const std::forward_list<T>
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void operator<< (object::with_zone& o, const std::forward_list<T>& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const std::forward_list<T>& v)
|
||||
{
|
||||
o.type = type::ARRAY;
|
||||
o.type = msgpack::type::ARRAY;
|
||||
if(v.empty()) {
|
||||
o.via.array.ptr = nullptr;
|
||||
o.via.array.size = 0;
|
||||
} else {
|
||||
std::size_t size = std::distance(v.begin(), v.end());
|
||||
o.via.array.size = size;
|
||||
object* p = static_cast<object*>(
|
||||
o.zone.allocate_align(sizeof(object)*size));
|
||||
msgpack::object* p = static_cast<msgpack::object*>(
|
||||
o.zone.allocate_align(sizeof(msgpack::object)*size));
|
||||
o.via.array.ptr = p;
|
||||
for(auto const& e : v) *p++ = object(e, o.zone);
|
||||
for(auto const& e : v) *p++ = msgpack::object(e, o.zone);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,13 +29,13 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename T>
|
||||
object const& operator>> (object const& o, std::forward_list<T>& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, std::forward_list<T>& v);
|
||||
|
||||
template <typename Stream, typename T>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const std::forward_list<T>& v);
|
||||
|
||||
template <typename T>
|
||||
void operator<< (object::with_zone& o, const std::forward_list<T>& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const std::forward_list<T>& v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
@ -70,7 +70,7 @@ inline const packer<Stream>& operator<< (
|
||||
template <typename Tuple, std::size_t N>
|
||||
struct StdTupleConverter {
|
||||
static void convert(
|
||||
object const& o,
|
||||
msgpack::object const& o,
|
||||
Tuple& v) {
|
||||
StdTupleConverter<Tuple, N-1>::convert(o, v);
|
||||
o.via.array.ptr[N-1].convert<typename std::remove_reference<decltype(std::get<N-1>(v))>::type>(std::get<N-1>(v));
|
||||
@ -80,7 +80,7 @@ struct StdTupleConverter {
|
||||
template <typename Tuple>
|
||||
struct StdTupleConverter<Tuple, 1> {
|
||||
static void convert (
|
||||
object const& o,
|
||||
msgpack::object const& o,
|
||||
Tuple& v) {
|
||||
o.via.array.ptr[0].convert<typename std::remove_reference<decltype(std::get<0>(v))>::type>(std::get<0>(v));
|
||||
}
|
||||
@ -89,16 +89,16 @@ struct StdTupleConverter<Tuple, 1> {
|
||||
template <typename Tuple>
|
||||
struct StdTupleConverter<Tuple, 0> {
|
||||
static void convert (
|
||||
object const&,
|
||||
msgpack::object const&,
|
||||
Tuple&) {
|
||||
}
|
||||
};
|
||||
|
||||
template <typename... Args>
|
||||
inline object const& operator>> (
|
||||
object const& o,
|
||||
inline msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
std::tuple<Args...>& v) {
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
||||
if(o.via.array.size < sizeof...(Args)) { throw type_error(); }
|
||||
StdTupleConverter<decltype(v), sizeof...(Args)>::convert(o, v);
|
||||
return o;
|
||||
@ -108,36 +108,36 @@ inline object const& operator>> (
|
||||
template <typename Tuple, std::size_t N>
|
||||
struct StdTupleToObjectWithZone {
|
||||
static void convert(
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const Tuple& v) {
|
||||
StdTupleToObjectWithZone<Tuple, N-1>::convert(o, v);
|
||||
o.via.array.ptr[N-1] = object(std::get<N-1>(v), o.zone);
|
||||
o.via.array.ptr[N-1] = msgpack::object(std::get<N-1>(v), o.zone);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Tuple>
|
||||
struct StdTupleToObjectWithZone<Tuple, 1> {
|
||||
static void convert (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const Tuple& v) {
|
||||
o.via.array.ptr[0] = object(std::get<0>(v), o.zone);
|
||||
o.via.array.ptr[0] = msgpack::object(std::get<0>(v), o.zone);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Tuple>
|
||||
struct StdTupleToObjectWithZone<Tuple, 0> {
|
||||
static void convert (
|
||||
object::with_zone&,
|
||||
msgpack::object::with_zone&,
|
||||
const Tuple&) {
|
||||
}
|
||||
};
|
||||
|
||||
template <typename... Args>
|
||||
inline void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
std::tuple<Args...> const& v) {
|
||||
o.type = type::ARRAY;
|
||||
o.via.array.ptr = static_cast<object*>(o.zone.allocate_align(sizeof(object)*sizeof...(Args)));
|
||||
o.type = msgpack::type::ARRAY;
|
||||
o.via.array.ptr = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*sizeof...(Args)));
|
||||
o.via.array.size = sizeof...(Args);
|
||||
StdTupleToObjectWithZone<decltype(v), sizeof...(Args)>::convert(o, v);
|
||||
}
|
||||
|
@ -42,8 +42,8 @@ template <typename Tuple, std::size_t N>
|
||||
struct StdTupleConverter;
|
||||
|
||||
template <typename... Args>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
std::tuple<Args...>& v);
|
||||
|
||||
// --- Convert from tuple to object with zone ---
|
||||
@ -52,7 +52,7 @@ struct StdTupleToObjectWithZone;
|
||||
|
||||
template <typename... Args>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
std::tuple<Args...> const& v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
@ -28,11 +28,11 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename K, typename V>
|
||||
inline object const& operator>> (object const& o, std::unordered_map<K, V>& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, std::unordered_map<K, V>& v)
|
||||
{
|
||||
if(o.type != type::MAP) { throw type_error(); }
|
||||
object_kv* p(o.via.map.ptr);
|
||||
object_kv* const pend(o.via.map.ptr + o.via.map.size);
|
||||
if(o.type != msgpack::type::MAP) { throw type_error(); }
|
||||
msgpack::object_kv* p(o.via.map.ptr);
|
||||
msgpack::object_kv* const pend(o.via.map.ptr + o.via.map.size);
|
||||
std::unordered_map<K, V> tmp;
|
||||
for(; p != pend; ++p) {
|
||||
K key;
|
||||
@ -56,21 +56,21 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const std::unordered_map<K
|
||||
}
|
||||
|
||||
template <typename K, typename V>
|
||||
inline void operator<< (object::with_zone& o, const std::unordered_map<K,V>& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const std::unordered_map<K,V>& v)
|
||||
{
|
||||
o.type = type::MAP;
|
||||
o.type = msgpack::type::MAP;
|
||||
if(v.empty()) {
|
||||
o.via.map.ptr = nullptr;
|
||||
o.via.map.size = 0;
|
||||
} else {
|
||||
object_kv* p = static_cast<object_kv*>(o.zone.allocate_align(sizeof(object_kv)*v.size()));
|
||||
object_kv* const pend = p + v.size();
|
||||
msgpack::object_kv* p = static_cast<msgpack::object_kv*>(o.zone.allocate_align(sizeof(msgpack::object_kv)*v.size()));
|
||||
msgpack::object_kv* const pend = p + v.size();
|
||||
o.via.map.ptr = p;
|
||||
o.via.map.size = v.size();
|
||||
typename std::unordered_map<K,V>::const_iterator it(v.begin());
|
||||
do {
|
||||
p->key = object(it->first, o.zone);
|
||||
p->val = object(it->second, o.zone);
|
||||
p->key = msgpack::object(it->first, o.zone);
|
||||
p->val = msgpack::object(it->second, o.zone);
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
@ -79,11 +79,11 @@ inline void operator<< (object::with_zone& o, const std::unordered_map<K,V>& v)
|
||||
|
||||
|
||||
template <typename K, typename V>
|
||||
inline object const& operator>> (object const& o, std::unordered_multimap<K, V>& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, std::unordered_multimap<K, V>& v)
|
||||
{
|
||||
if(o.type != type::MAP) { throw type_error(); }
|
||||
object_kv* p(o.via.map.ptr);
|
||||
object_kv* const pend(o.via.map.ptr + o.via.map.size);
|
||||
if(o.type != msgpack::type::MAP) { throw type_error(); }
|
||||
msgpack::object_kv* p(o.via.map.ptr);
|
||||
msgpack::object_kv* const pend(o.via.map.ptr + o.via.map.size);
|
||||
std::unordered_multimap<K, V> tmp;
|
||||
for(; p != pend; ++p) {
|
||||
std::pair<K, V> value;
|
||||
@ -108,21 +108,21 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const std::unordered_multi
|
||||
}
|
||||
|
||||
template <typename K, typename V>
|
||||
inline void operator<< (object::with_zone& o, const std::unordered_multimap<K,V>& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const std::unordered_multimap<K,V>& v)
|
||||
{
|
||||
o.type = type::MAP;
|
||||
o.type = msgpack::type::MAP;
|
||||
if(v.empty()) {
|
||||
o.via.map.ptr = nullptr;
|
||||
o.via.map.size = 0;
|
||||
} else {
|
||||
object_kv* p = static_cast<object_kv*>(o.zone.allocate_align(sizeof(object_kv)*v.size()));
|
||||
object_kv* const pend = p + v.size();
|
||||
msgpack::object_kv* p = static_cast<msgpack::object_kv*>(o.zone.allocate_align(sizeof(msgpack::object_kv)*v.size()));
|
||||
msgpack::object_kv* const pend = p + v.size();
|
||||
o.via.map.ptr = p;
|
||||
o.via.map.size = v.size();
|
||||
typename std::unordered_multimap<K,V>::const_iterator it(v.begin());
|
||||
do {
|
||||
p->key = object(it->first, o.zone);
|
||||
p->val = object(it->second, o.zone);
|
||||
p->key = msgpack::object(it->first, o.zone);
|
||||
p->val = msgpack::object(it->second, o.zone);
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
|
@ -28,22 +28,22 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename K, typename V>
|
||||
object const& operator>> (object const& o, std::unordered_map<K, V>& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, std::unordered_map<K, V>& v);
|
||||
|
||||
template <typename Stream, typename K, typename V>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const std::unordered_map<K,V>& v);
|
||||
|
||||
template <typename K, typename V>
|
||||
void operator<< (object::with_zone& o, const std::unordered_map<K,V>& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const std::unordered_map<K,V>& v);
|
||||
|
||||
template <typename K, typename V>
|
||||
object const& operator>> (object const& o, std::unordered_multimap<K, V>& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, std::unordered_multimap<K, V>& v);
|
||||
|
||||
template <typename Stream, typename K, typename V>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const std::unordered_multimap<K,V>& v);
|
||||
|
||||
template <typename K, typename V>
|
||||
void operator<< (object::with_zone& o, const std::unordered_multimap<K,V>& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const std::unordered_multimap<K,V>& v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
@ -28,11 +28,11 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename T>
|
||||
inline object const& operator>> (object const& o, std::unordered_set<T>& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, std::unordered_set<T>& v)
|
||||
{
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
object* p = o.via.array.ptr + o.via.array.size;
|
||||
object* const pbegin = o.via.array.ptr;
|
||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
||||
msgpack::object* p = o.via.array.ptr + o.via.array.size;
|
||||
msgpack::object* const pbegin = o.via.array.ptr;
|
||||
std::unordered_set<T> tmp;
|
||||
while(p > pbegin) {
|
||||
--p;
|
||||
@ -54,20 +54,20 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const std::unordered_set<T
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void operator<< (object::with_zone& o, const std::unordered_set<T>& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const std::unordered_set<T>& v)
|
||||
{
|
||||
o.type = type::ARRAY;
|
||||
o.type = msgpack::type::ARRAY;
|
||||
if(v.empty()) {
|
||||
o.via.array.ptr = nullptr;
|
||||
o.via.array.size = 0;
|
||||
} else {
|
||||
object* p = static_cast<object*>(o.zone.allocate_align(sizeof(object)*v.size()));
|
||||
object* const pend = p + v.size();
|
||||
msgpack::object* p = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*v.size()));
|
||||
msgpack::object* const pend = p + v.size();
|
||||
o.via.array.ptr = p;
|
||||
o.via.array.size = v.size();
|
||||
typename std::unordered_set<T>::const_iterator it(v.begin());
|
||||
do {
|
||||
*p = object(*it, o.zone);
|
||||
*p = msgpack::object(*it, o.zone);
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
@ -76,11 +76,11 @@ inline void operator<< (object::with_zone& o, const std::unordered_set<T>& v)
|
||||
|
||||
|
||||
template <typename T>
|
||||
inline object const& operator>> (object const& o, std::unordered_multiset<T>& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, std::unordered_multiset<T>& v)
|
||||
{
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
object* p = o.via.array.ptr + o.via.array.size;
|
||||
object* const pbegin = o.via.array.ptr;
|
||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
||||
msgpack::object* p = o.via.array.ptr + o.via.array.size;
|
||||
msgpack::object* const pbegin = o.via.array.ptr;
|
||||
std::unordered_multiset<T> tmp;
|
||||
while(p > pbegin) {
|
||||
--p;
|
||||
@ -102,20 +102,20 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const std::unordered_multi
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void operator<< (object::with_zone& o, const std::unordered_multiset<T>& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const std::unordered_multiset<T>& v)
|
||||
{
|
||||
o.type = type::ARRAY;
|
||||
o.type = msgpack::type::ARRAY;
|
||||
if(v.empty()) {
|
||||
o.via.array.ptr = nullptr;
|
||||
o.via.array.size = 0;
|
||||
} else {
|
||||
object* p = static_cast<object*>(o.zone.allocate_align(sizeof(object)*v.size()));
|
||||
object* const pend = p + v.size();
|
||||
msgpack::object* p = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*v.size()));
|
||||
msgpack::object* const pend = p + v.size();
|
||||
o.via.array.ptr = p;
|
||||
o.via.array.size = v.size();
|
||||
typename std::unordered_multiset<T>::const_iterator it(v.begin());
|
||||
do {
|
||||
*p = object(*it, o.zone);
|
||||
*p = msgpack::object(*it, o.zone);
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
|
@ -28,22 +28,22 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename T>
|
||||
object const& operator>> (object const& o, std::unordered_set<T>& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, std::unordered_set<T>& v);
|
||||
|
||||
template <typename Stream, typename T>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const std::unordered_set<T>& v);
|
||||
|
||||
template <typename T>
|
||||
void operator<< (object::with_zone& o, const std::unordered_set<T>& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const std::unordered_set<T>& v);
|
||||
|
||||
template <typename T>
|
||||
object const& operator>> (object const& o, std::unordered_multiset<T>& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, std::unordered_multiset<T>& v);
|
||||
|
||||
template <typename Stream, typename T>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const std::unordered_multiset<T>& v);
|
||||
|
||||
template <typename T>
|
||||
void operator<< (object::with_zone& o, const std::unordered_multiset<T>& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const std::unordered_multiset<T>& v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
@ -27,12 +27,12 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename T>
|
||||
inline object const& operator>> (object const& o, std::deque<T>& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, std::deque<T>& v)
|
||||
{
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
||||
v.resize(o.via.array.size);
|
||||
object* p = o.via.array.ptr;
|
||||
object* const pend = o.via.array.ptr + o.via.array.size;
|
||||
msgpack::object* p = o.via.array.ptr;
|
||||
msgpack::object* const pend = o.via.array.ptr + o.via.array.size;
|
||||
typename std::deque<T>::iterator it = v.begin();
|
||||
for(; p < pend; ++p, ++it) {
|
||||
p->convert(*it);
|
||||
@ -52,20 +52,20 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const std::deque<T>& v)
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void operator<< (object::with_zone& o, const std::deque<T>& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const std::deque<T>& v)
|
||||
{
|
||||
o.type = type::ARRAY;
|
||||
o.type = msgpack::type::ARRAY;
|
||||
if(v.empty()) {
|
||||
o.via.array.ptr = nullptr;
|
||||
o.via.array.size = 0;
|
||||
} else {
|
||||
object* p = static_cast<object*>(o.zone.allocate_align(sizeof(object)*v.size()));
|
||||
object* const pend = p + v.size();
|
||||
msgpack::object* p = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*v.size()));
|
||||
msgpack::object* const pend = p + v.size();
|
||||
o.via.array.ptr = p;
|
||||
o.via.array.size = v.size();
|
||||
typename std::deque<T>::const_iterator it(v.begin());
|
||||
do {
|
||||
*p = object(*it, o.zone);
|
||||
*p = msgpack::object(*it, o.zone);
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
|
@ -27,11 +27,11 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename T>
|
||||
object const& operator>> (object const& o, std::deque<T>& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, std::deque<T>& v);
|
||||
template <typename Stream, typename T>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const std::deque<T>& v);
|
||||
template <typename T>
|
||||
void operator<< (object::with_zone& o, const std::deque<T>& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const std::deque<T>& v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -3704,169 +3704,169 @@ tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16,
|
||||
|
||||
} // namespace type
|
||||
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<>&);
|
||||
|
||||
|
||||
template <typename A0>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0>& v);
|
||||
|
||||
template <typename A0, typename A1>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21, typename A22>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21, typename A22, typename A23>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21, typename A22, typename A23, typename A24>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21, typename A22, typename A23, typename A24, typename A25>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21, typename A22, typename A23, typename A24, typename A25, typename A26>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21, typename A22, typename A23, typename A24, typename A25, typename A26, typename A27>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21, typename A22, typename A23, typename A24, typename A25, typename A26, typename A27, typename A28>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21, typename A22, typename A23, typename A24, typename A25, typename A26, typename A27, typename A28, typename A29>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21, typename A22, typename A23, typename A24, typename A25, typename A26, typename A27, typename A28, typename A29, typename A30>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29, A30>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21, typename A22, typename A23, typename A24, typename A25, typename A26, typename A27, typename A28, typename A29, typename A30, typename A31>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29, A30, A31>& v);
|
||||
|
||||
|
||||
@ -4038,167 +4038,167 @@ const packer<Stream>& operator<< (
|
||||
|
||||
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<>&);
|
||||
|
||||
template <typename A0>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0>& v);
|
||||
|
||||
template <typename A0, typename A1>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21, typename A22>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21, typename A22, typename A23>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21, typename A22, typename A23, typename A24>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21, typename A22, typename A23, typename A24, typename A25>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21, typename A22, typename A23, typename A24, typename A25, typename A26>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21, typename A22, typename A23, typename A24, typename A25, typename A26, typename A27>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21, typename A22, typename A23, typename A24, typename A25, typename A26, typename A27, typename A28>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21, typename A22, typename A23, typename A24, typename A25, typename A26, typename A27, typename A28, typename A29>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21, typename A22, typename A23, typename A24, typename A25, typename A26, typename A27, typename A28, typename A29, typename A30>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29, A30>& v);
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10, typename A11, typename A12, typename A13, typename A14, typename A15, typename A16, typename A17, typename A18, typename A19, typename A20, typename A21, typename A22, typename A23, typename A24, typename A25, typename A26, typename A27, typename A28, typename A29, typename A30, typename A31>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29, A30, A31>& v);
|
||||
|
||||
|
||||
|
@ -47,19 +47,19 @@
|
||||
#define MSGPACK_ADD_ENUM(enum) \
|
||||
namespace msgpack { \
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) { \
|
||||
inline object const& operator>> (object const& o, enum& v) \
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, enum& v) \
|
||||
{ \
|
||||
std::underlying_type<enum>::type tmp; \
|
||||
o >> tmp; \
|
||||
v = static_cast<enum>(tmp); \
|
||||
return o; \
|
||||
} \
|
||||
inline void operator<< (object& o, const enum& v) \
|
||||
inline void operator<< (msgpack::object& o, const enum& v) \
|
||||
{ \
|
||||
auto tmp = static_cast<std::underlying_type<enum>::type>(v); \
|
||||
o << tmp; \
|
||||
} \
|
||||
inline void operator<< (object::with_zone& o, const enum& v) \
|
||||
inline void operator<< (msgpack::object::with_zone& o, const enum& v) \
|
||||
{ \
|
||||
auto tmp = static_cast<std::underlying_type<enum>::type>(v); \
|
||||
o << tmp; \
|
||||
@ -129,14 +129,14 @@ struct define {
|
||||
}
|
||||
void msgpack_unpack(msgpack::object const& o)
|
||||
{
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
||||
|
||||
define_imp<std::tuple<Args&...>, sizeof...(Args)>::unpack(o, a);
|
||||
}
|
||||
void msgpack_object(msgpack::object* o, msgpack::zone& z) const
|
||||
{
|
||||
o->type = type::ARRAY;
|
||||
o->via.array.ptr = static_cast<object*>(z.allocate_align(sizeof(object)*sizeof...(Args)));
|
||||
o->type = msgpack::type::ARRAY;
|
||||
o->via.array.ptr = static_cast<msgpack::object*>(z.allocate_align(sizeof(msgpack::object)*sizeof...(Args)));
|
||||
o->via.array.size = sizeof...(Args);
|
||||
|
||||
define_imp<std::tuple<Args&...>, sizeof...(Args)>::object(o, z, a);
|
||||
@ -156,11 +156,11 @@ struct define<> {
|
||||
}
|
||||
void msgpack_unpack(msgpack::object const& o)
|
||||
{
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
||||
}
|
||||
void msgpack_object(msgpack::object* o, msgpack::zone&) const
|
||||
{
|
||||
o->type = type::ARRAY;
|
||||
o->type = msgpack::type::ARRAY;
|
||||
o->via.array.ptr = NULL;
|
||||
o->via.array.size = 0;
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ const packer<Stream>& operator<< (
|
||||
template <typename Tuple, std::size_t N>
|
||||
struct MsgpackTupleConverter {
|
||||
static void convert(
|
||||
object const& o,
|
||||
msgpack::object const& o,
|
||||
Tuple& v) {
|
||||
MsgpackTupleConverter<Tuple, N-1>::convert(o, v);
|
||||
o.via.array.ptr[N-1].convert<typename std::remove_reference<decltype(type::get<N-1>(v))>::type>(type::get<N-1>(v));
|
||||
@ -143,7 +143,7 @@ struct MsgpackTupleConverter {
|
||||
template <typename Tuple>
|
||||
struct MsgpackTupleConverter<Tuple, 1> {
|
||||
static void convert (
|
||||
object const& o,
|
||||
msgpack::object const& o,
|
||||
Tuple& v) {
|
||||
o.via.array.ptr[0].convert<typename std::remove_reference<decltype(type::get<0>(v))>::type>(type::get<0>(v));
|
||||
}
|
||||
@ -152,16 +152,16 @@ struct MsgpackTupleConverter<Tuple, 1> {
|
||||
template <typename Tuple>
|
||||
struct MsgpackTupleConverter<Tuple, 0> {
|
||||
static void convert (
|
||||
object const&,
|
||||
msgpack::object const&,
|
||||
Tuple&) {
|
||||
}
|
||||
};
|
||||
|
||||
template <typename... Args>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<Args...>& v) {
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
||||
if(o.via.array.size < sizeof...(Args)) { throw type_error(); }
|
||||
MsgpackTupleConverter<decltype(v), sizeof...(Args)>::convert(o, v);
|
||||
return o;
|
||||
@ -171,36 +171,36 @@ object const& operator>> (
|
||||
template <typename Tuple, std::size_t N>
|
||||
struct MsgpackTupleToObjectWithZone {
|
||||
static void convert(
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const Tuple& v) {
|
||||
MsgpackTupleToObjectWithZone<Tuple, N-1>::convert(o, v);
|
||||
o.via.array.ptr[N-1] = object(type::get<N-1>(v), o.zone);
|
||||
o.via.array.ptr[N-1] = msgpack::object(type::get<N-1>(v), o.zone);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Tuple>
|
||||
struct MsgpackTupleToObjectWithZone<Tuple, 1> {
|
||||
static void convert (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
const Tuple& v) {
|
||||
o.via.array.ptr[0] = object(type::get<0>(v), o.zone);
|
||||
o.via.array.ptr[0] = msgpack::object(type::get<0>(v), o.zone);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Tuple>
|
||||
struct MsgpackTupleToObjectWithZone<Tuple, 0> {
|
||||
static void convert (
|
||||
object::with_zone&,
|
||||
msgpack::object::with_zone&,
|
||||
const Tuple&) {
|
||||
}
|
||||
};
|
||||
|
||||
template <typename... Args>
|
||||
inline void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
type::tuple<Args...> const& v) {
|
||||
o.type = type::ARRAY;
|
||||
o.via.array.ptr = static_cast<object*>(o.zone.allocate_align(sizeof(object)*sizeof...(Args)));
|
||||
o.type = msgpack::type::ARRAY;
|
||||
o.via.array.ptr = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*sizeof...(Args)));
|
||||
o.via.array.size = sizeof...(Args);
|
||||
MsgpackTupleToObjectWithZone<decltype(v), sizeof...(Args)>::convert(o, v);
|
||||
}
|
||||
|
@ -64,8 +64,8 @@ template <typename Tuple, std::size_t N>
|
||||
struct MsgpackTupleConverter;
|
||||
|
||||
template <typename... Args>
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
msgpack::object const& operator>> (
|
||||
msgpack::object const& o,
|
||||
type::tuple<Args...>& v);
|
||||
|
||||
// --- Convert from tuple to object with zone ---
|
||||
@ -74,7 +74,7 @@ struct MsgpackTupleToObjectWithZone;
|
||||
|
||||
template <typename... Args>
|
||||
void operator<< (
|
||||
object::with_zone& o,
|
||||
msgpack::object::with_zone& o,
|
||||
type::tuple<Args...> const& v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
@ -57,29 +57,29 @@ typedef fix_int<int64_t> fix_int64;
|
||||
} // namespace type
|
||||
|
||||
|
||||
inline object const& operator>> (object const& o, type::fix_int8& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, type::fix_int8& v)
|
||||
{ v = type::detail::convert_integer<int8_t>(o); return o; }
|
||||
|
||||
inline object const& operator>> (object const& o, type::fix_int16& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, type::fix_int16& v)
|
||||
{ v = type::detail::convert_integer<int16_t>(o); return o; }
|
||||
|
||||
inline object const& operator>> (object const& o, type::fix_int32& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, type::fix_int32& v)
|
||||
{ v = type::detail::convert_integer<int32_t>(o); return o; }
|
||||
|
||||
inline object const& operator>> (object const& o, type::fix_int64& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, type::fix_int64& v)
|
||||
{ v = type::detail::convert_integer<int64_t>(o); return o; }
|
||||
|
||||
|
||||
inline object const& operator>> (object const& o, type::fix_uint8& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, type::fix_uint8& v)
|
||||
{ v = type::detail::convert_integer<uint8_t>(o); return o; }
|
||||
|
||||
inline object const& operator>> (object const& o, type::fix_uint16& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, type::fix_uint16& v)
|
||||
{ v = type::detail::convert_integer<uint16_t>(o); return o; }
|
||||
|
||||
inline object const& operator>> (object const& o, type::fix_uint32& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, type::fix_uint32& v)
|
||||
{ v = type::detail::convert_integer<uint32_t>(o); return o; }
|
||||
|
||||
inline object const& operator>> (object const& o, type::fix_uint64& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, type::fix_uint64& v)
|
||||
{ v = type::detail::convert_integer<uint64_t>(o); return o; }
|
||||
|
||||
|
||||
@ -117,92 +117,92 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const type::fix_uint64& v)
|
||||
{ o.pack_fix_uint64(v); return o; }
|
||||
|
||||
|
||||
inline void operator<< (object& o, type::fix_int8 v)
|
||||
inline void operator<< (msgpack::object& o, type::fix_int8 v)
|
||||
{
|
||||
if (v.get() < 0) {
|
||||
o.type = type::NEGATIVE_INTEGER;
|
||||
o.type = msgpack::type::NEGATIVE_INTEGER;
|
||||
o.via.i64 = v.get();
|
||||
}
|
||||
else {
|
||||
o.type = type::POSITIVE_INTEGER;
|
||||
o.type = msgpack::type::POSITIVE_INTEGER;
|
||||
o.via.u64 = v.get();
|
||||
}
|
||||
}
|
||||
|
||||
inline void operator<< (object& o, type::fix_int16 v)
|
||||
inline void operator<< (msgpack::object& o, type::fix_int16 v)
|
||||
{
|
||||
if(v.get() < 0) {
|
||||
o.type = type::NEGATIVE_INTEGER;
|
||||
o.type = msgpack::type::NEGATIVE_INTEGER;
|
||||
o.via.i64 = v.get();
|
||||
}
|
||||
else {
|
||||
o.type = type::POSITIVE_INTEGER;
|
||||
o.type = msgpack::type::POSITIVE_INTEGER;
|
||||
o.via.u64 = v.get();
|
||||
}
|
||||
}
|
||||
|
||||
inline void operator<< (object& o, type::fix_int32 v)
|
||||
inline void operator<< (msgpack::object& o, type::fix_int32 v)
|
||||
{
|
||||
if (v.get() < 0) {
|
||||
o.type = type::NEGATIVE_INTEGER;
|
||||
o.type = msgpack::type::NEGATIVE_INTEGER;
|
||||
o.via.i64 = v.get();
|
||||
}
|
||||
else {
|
||||
o.type = type::POSITIVE_INTEGER;
|
||||
o.type = msgpack::type::POSITIVE_INTEGER;
|
||||
o.via.u64 = v.get();
|
||||
}
|
||||
}
|
||||
|
||||
inline void operator<< (object& o, type::fix_int64 v)
|
||||
inline void operator<< (msgpack::object& o, type::fix_int64 v)
|
||||
{
|
||||
if (v.get() < 0) {
|
||||
o.type = type::NEGATIVE_INTEGER;
|
||||
o.type = msgpack::type::NEGATIVE_INTEGER;
|
||||
o.via.i64 = v.get();
|
||||
}
|
||||
else {
|
||||
o.type = type::POSITIVE_INTEGER;
|
||||
o.type = msgpack::type::POSITIVE_INTEGER;
|
||||
o.via.u64 = v.get();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline void operator<< (object& o, type::fix_uint8 v)
|
||||
{ o.type = type::POSITIVE_INTEGER, o.via.u64 = v.get(); }
|
||||
inline void operator<< (msgpack::object& o, type::fix_uint8 v)
|
||||
{ o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v.get(); }
|
||||
|
||||
inline void operator<< (object& o, type::fix_uint16 v)
|
||||
{ o.type = type::POSITIVE_INTEGER, o.via.u64 = v.get(); }
|
||||
inline void operator<< (msgpack::object& o, type::fix_uint16 v)
|
||||
{ o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v.get(); }
|
||||
|
||||
inline void operator<< (object& o, type::fix_uint32 v)
|
||||
{ o.type = type::POSITIVE_INTEGER, o.via.u64 = v.get(); }
|
||||
inline void operator<< (msgpack::object& o, type::fix_uint32 v)
|
||||
{ o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v.get(); }
|
||||
|
||||
inline void operator<< (object& o, type::fix_uint64 v)
|
||||
{ o.type = type::POSITIVE_INTEGER, o.via.u64 = v.get(); }
|
||||
inline void operator<< (msgpack::object& o, type::fix_uint64 v)
|
||||
{ o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v.get(); }
|
||||
|
||||
|
||||
inline void operator<< (object::with_zone& o, type::fix_int8 v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, type::fix_int8 v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
inline void operator<< (object::with_zone& o, type::fix_int16 v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, type::fix_int16 v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
inline void operator<< (object::with_zone& o, type::fix_int32 v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, type::fix_int32 v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
inline void operator<< (object::with_zone& o, type::fix_int64 v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, type::fix_int64 v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
|
||||
inline void operator<< (object::with_zone& o, type::fix_uint8 v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, type::fix_uint8 v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
inline void operator<< (object::with_zone& o, type::fix_uint16 v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, type::fix_uint16 v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
inline void operator<< (object::with_zone& o, type::fix_uint32 v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, type::fix_uint32 v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
inline void operator<< (object::with_zone& o, type::fix_uint64 v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, type::fix_uint64 v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
@ -45,15 +45,15 @@ typedef fix_int<int64_t> fix_int64;
|
||||
} // namespace type
|
||||
|
||||
|
||||
object const& operator>> (object const& o, type::fix_int8& v);
|
||||
object const& operator>> (object const& o, type::fix_int16& v);
|
||||
object const& operator>> (object const& o, type::fix_int32& v);
|
||||
object const& operator>> (object const& o, type::fix_int64& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, type::fix_int8& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, type::fix_int16& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, type::fix_int32& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, type::fix_int64& v);
|
||||
|
||||
object const& operator>> (object const& o, type::fix_uint8& v);
|
||||
object const& operator>> (object const& o, type::fix_uint16& v);
|
||||
object const& operator>> (object const& o, type::fix_uint32& v);
|
||||
object const& operator>> (object const& o, type::fix_uint64& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, type::fix_uint8& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, type::fix_uint16& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, type::fix_uint32& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, type::fix_uint64& v);
|
||||
|
||||
template <typename Stream>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const type::fix_int8& v);
|
||||
@ -73,25 +73,25 @@ packer<Stream>& operator<< (packer<Stream>& o, const type::fix_uint32& v);
|
||||
template <typename Stream>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const type::fix_uint64& v);
|
||||
|
||||
void operator<< (object& o, type::fix_int8 v);
|
||||
void operator<< (object& o, type::fix_int16 v);
|
||||
void operator<< (object& o, type::fix_int32 v);
|
||||
void operator<< (object& o, type::fix_int64 v);
|
||||
void operator<< (msgpack::object& o, type::fix_int8 v);
|
||||
void operator<< (msgpack::object& o, type::fix_int16 v);
|
||||
void operator<< (msgpack::object& o, type::fix_int32 v);
|
||||
void operator<< (msgpack::object& o, type::fix_int64 v);
|
||||
|
||||
void operator<< (object& o, type::fix_uint8 v);
|
||||
void operator<< (object& o, type::fix_uint16 v);
|
||||
void operator<< (object& o, type::fix_uint32 v);
|
||||
void operator<< (object& o, type::fix_uint64 v);
|
||||
void operator<< (msgpack::object& o, type::fix_uint8 v);
|
||||
void operator<< (msgpack::object& o, type::fix_uint16 v);
|
||||
void operator<< (msgpack::object& o, type::fix_uint32 v);
|
||||
void operator<< (msgpack::object& o, type::fix_uint64 v);
|
||||
|
||||
void operator<< (object::with_zone& o, type::fix_int8 v);
|
||||
void operator<< (object::with_zone& o, type::fix_int16 v);
|
||||
void operator<< (object::with_zone& o, type::fix_int32 v);
|
||||
void operator<< (object::with_zone& o, type::fix_int64 v);
|
||||
void operator<< (msgpack::object::with_zone& o, type::fix_int8 v);
|
||||
void operator<< (msgpack::object::with_zone& o, type::fix_int16 v);
|
||||
void operator<< (msgpack::object::with_zone& o, type::fix_int32 v);
|
||||
void operator<< (msgpack::object::with_zone& o, type::fix_int64 v);
|
||||
|
||||
void operator<< (object::with_zone& o, type::fix_uint8 v);
|
||||
void operator<< (object::with_zone& o, type::fix_uint16 v);
|
||||
void operator<< (object::with_zone& o, type::fix_uint32 v);
|
||||
void operator<< (object::with_zone& o, type::fix_uint64 v);
|
||||
void operator<< (msgpack::object::with_zone& o, type::fix_uint8 v);
|
||||
void operator<< (msgpack::object::with_zone& o, type::fix_uint16 v);
|
||||
void operator<< (msgpack::object::with_zone& o, type::fix_uint32 v);
|
||||
void operator<< (msgpack::object::with_zone& o, type::fix_uint64 v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
@ -29,15 +29,15 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
// FIXME check overflow, underflow
|
||||
|
||||
|
||||
inline object const& operator>> (object const& o, float& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, float& v)
|
||||
{
|
||||
if(o.type == type::FLOAT) {
|
||||
if(o.type == msgpack::type::FLOAT) {
|
||||
v = static_cast<float>(o.via.f64);
|
||||
}
|
||||
else if (o.type == type::POSITIVE_INTEGER) {
|
||||
else if (o.type == msgpack::type::POSITIVE_INTEGER) {
|
||||
v = static_cast<float>(o.via.u64);
|
||||
}
|
||||
else if (o.type == type::NEGATIVE_INTEGER) {
|
||||
else if (o.type == msgpack::type::NEGATIVE_INTEGER) {
|
||||
v = static_cast<float>(o.via.i64);
|
||||
}
|
||||
else {
|
||||
@ -54,15 +54,15 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const float& v)
|
||||
}
|
||||
|
||||
|
||||
inline object const& operator>> (object const& o, double& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, double& v)
|
||||
{
|
||||
if(o.type == type::FLOAT) {
|
||||
if(o.type == msgpack::type::FLOAT) {
|
||||
v = o.via.f64;
|
||||
}
|
||||
else if (o.type == type::POSITIVE_INTEGER) {
|
||||
else if (o.type == msgpack::type::POSITIVE_INTEGER) {
|
||||
v = static_cast<double>(o.via.u64);
|
||||
}
|
||||
else if (o.type == type::NEGATIVE_INTEGER) {
|
||||
else if (o.type == msgpack::type::NEGATIVE_INTEGER) {
|
||||
v = static_cast<double>(o.via.i64);
|
||||
}
|
||||
else {
|
||||
@ -79,23 +79,23 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const double& v)
|
||||
}
|
||||
|
||||
|
||||
inline void operator<< (object& o, float v)
|
||||
inline void operator<< (msgpack::object& o, float v)
|
||||
{
|
||||
o.type = type::FLOAT;
|
||||
o.type = msgpack::type::FLOAT;
|
||||
o.via.f64 = static_cast<double>(v);
|
||||
}
|
||||
|
||||
inline void operator<< (object& o, double v)
|
||||
inline void operator<< (msgpack::object& o, double v)
|
||||
{
|
||||
o.type = type::FLOAT;
|
||||
o.type = msgpack::type::FLOAT;
|
||||
o.via.f64 = v;
|
||||
}
|
||||
|
||||
inline void operator<< (object::with_zone& o, float v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, float v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
inline void operator<< (object::with_zone& o, double v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, double v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
@ -26,16 +26,16 @@ namespace msgpack {
|
||||
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
object const& operator>> (object const& o, float& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, float& v);
|
||||
template <typename Stream>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const float& v);
|
||||
object const& operator>> (object const& o, double& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, double& v);
|
||||
template <typename Stream>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const double& v);
|
||||
void operator<< (object& o, float v);
|
||||
void operator<< (object& o, double v);
|
||||
void operator<< (object::with_zone& o, float v);
|
||||
void operator<< (object::with_zone& o, double v);
|
||||
void operator<< (msgpack::object& o, float v);
|
||||
void operator<< (msgpack::object& o, double v);
|
||||
void operator<< (msgpack::object::with_zone& o, float v);
|
||||
void operator<< (msgpack::object::with_zone& o, double v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
@ -33,12 +33,12 @@ namespace detail {
|
||||
|
||||
template <typename T>
|
||||
struct convert_integer_sign<T, true> {
|
||||
static inline T convert(object const& o) {
|
||||
if(o.type == type::POSITIVE_INTEGER) {
|
||||
static inline T convert(msgpack::object const& o) {
|
||||
if(o.type == msgpack::type::POSITIVE_INTEGER) {
|
||||
if(o.via.u64 > static_cast<uint64_t>(std::numeric_limits<T>::max()))
|
||||
{ throw type_error(); }
|
||||
return static_cast<T>(o.via.u64);
|
||||
} else if(o.type == type::NEGATIVE_INTEGER) {
|
||||
} else if(o.type == msgpack::type::NEGATIVE_INTEGER) {
|
||||
if(o.via.i64 < static_cast<int64_t>(std::numeric_limits<T>::min()))
|
||||
{ throw type_error(); }
|
||||
return static_cast<T>(o.via.i64);
|
||||
@ -49,8 +49,8 @@ namespace detail {
|
||||
|
||||
template <typename T>
|
||||
struct convert_integer_sign<T, false> {
|
||||
static inline T convert(object const& o) {
|
||||
if(o.type == type::POSITIVE_INTEGER) {
|
||||
static inline T convert(msgpack::object const& o) {
|
||||
if(o.type == msgpack::type::POSITIVE_INTEGER) {
|
||||
if(o.via.u64 > static_cast<uint64_t>(std::numeric_limits<T>::max()))
|
||||
{ throw type_error(); }
|
||||
return static_cast<T>(o.via.u64);
|
||||
@ -65,7 +65,7 @@ namespace detail {
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
static inline T convert_integer(object const& o)
|
||||
static inline T convert_integer(msgpack::object const& o)
|
||||
{
|
||||
return detail::convert_integer_sign<T, is_signed<T>::value>::convert(o);
|
||||
}
|
||||
@ -75,13 +75,13 @@ namespace detail {
|
||||
|
||||
template <>
|
||||
struct object_char_sign<true> {
|
||||
static inline void make(object& o, char v) {
|
||||
static inline void make(msgpack::object& o, char v) {
|
||||
if (v < 0) {
|
||||
o.type = type::NEGATIVE_INTEGER;
|
||||
o.type = msgpack::type::NEGATIVE_INTEGER;
|
||||
o.via.i64 = v;
|
||||
}
|
||||
else {
|
||||
o.type = type::POSITIVE_INTEGER;
|
||||
o.type = msgpack::type::POSITIVE_INTEGER;
|
||||
o.via.u64 = v;
|
||||
}
|
||||
}
|
||||
@ -89,51 +89,51 @@ namespace detail {
|
||||
|
||||
template <>
|
||||
struct object_char_sign<false> {
|
||||
static inline void make(object& o, char v) {
|
||||
o.type = type::POSITIVE_INTEGER, o.via.u64 = v;
|
||||
static inline void make(msgpack::object& o, char v) {
|
||||
o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v;
|
||||
}
|
||||
};
|
||||
|
||||
static inline void object_char(object& o, char v) {
|
||||
static inline void object_char(msgpack::object& o, char v) {
|
||||
return object_char_sign<is_signed<char>::value>::make(o, v);
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
} // namespace type
|
||||
|
||||
inline object const& operator>> (object const& o, char& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, char& v)
|
||||
{ v = type::detail::convert_integer<char>(o); return o; }
|
||||
|
||||
|
||||
inline object const& operator>> (object const& o, signed char& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, signed char& v)
|
||||
{ v = type::detail::convert_integer<signed char>(o); return o; }
|
||||
|
||||
inline object const& operator>> (object const& o, signed short& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, signed short& v)
|
||||
{ v = type::detail::convert_integer<signed short>(o); return o; }
|
||||
|
||||
inline object const& operator>> (object const& o, signed int& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, signed int& v)
|
||||
{ v = type::detail::convert_integer<signed int>(o); return o; }
|
||||
|
||||
inline object const& operator>> (object const& o, signed long& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, signed long& v)
|
||||
{ v = type::detail::convert_integer<signed long>(o); return o; }
|
||||
|
||||
inline object const& operator>> (object const& o, signed long long& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, signed long long& v)
|
||||
{ v = type::detail::convert_integer<signed long long>(o); return o; }
|
||||
|
||||
|
||||
inline object const& operator>> (object const& o, unsigned char& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, unsigned char& v)
|
||||
{ v = type::detail::convert_integer<unsigned char>(o); return o; }
|
||||
|
||||
inline object const& operator>> (object const& o, unsigned short& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, unsigned short& v)
|
||||
{ v = type::detail::convert_integer<unsigned short>(o); return o; }
|
||||
|
||||
inline object const& operator>> (object const& o, unsigned int& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, unsigned int& v)
|
||||
{ v = type::detail::convert_integer<unsigned int>(o); return o; }
|
||||
|
||||
inline object const& operator>> (object const& o, unsigned long& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, unsigned long& v)
|
||||
{ v = type::detail::convert_integer<unsigned long>(o); return o; }
|
||||
|
||||
inline object const& operator>> (object const& o, unsigned long long& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, unsigned long long& v)
|
||||
{ v = type::detail::convert_integer<unsigned long long>(o); return o; }
|
||||
|
||||
|
||||
@ -184,121 +184,121 @@ inline packer<Stream>& operator<< (packer<Stream>& o, unsigned long long v)
|
||||
{ o.pack_unsigned_long_long(v); return o; }
|
||||
|
||||
|
||||
inline void operator<< (object& o, char v)
|
||||
inline void operator<< (msgpack::object& o, char v)
|
||||
{ type::detail::object_char(o, v); }
|
||||
|
||||
|
||||
inline void operator<< (object& o, signed char v)
|
||||
inline void operator<< (msgpack::object& o, signed char v)
|
||||
{
|
||||
if (v < 0) {
|
||||
o.type = type::NEGATIVE_INTEGER;
|
||||
o.type = msgpack::type::NEGATIVE_INTEGER;
|
||||
o.via.i64 = v;
|
||||
}
|
||||
else {
|
||||
o.type = type::POSITIVE_INTEGER;
|
||||
o.type = msgpack::type::POSITIVE_INTEGER;
|
||||
o.via.u64 = v;
|
||||
}
|
||||
}
|
||||
|
||||
inline void operator<< (object& o, signed short v)
|
||||
inline void operator<< (msgpack::object& o, signed short v)
|
||||
{
|
||||
if (v < 0) {
|
||||
o.type = type::NEGATIVE_INTEGER;
|
||||
o.type = msgpack::type::NEGATIVE_INTEGER;
|
||||
o.via.i64 = v;
|
||||
}
|
||||
else {
|
||||
o.type = type::POSITIVE_INTEGER;
|
||||
o.type = msgpack::type::POSITIVE_INTEGER;
|
||||
o.via.u64 = v;
|
||||
}
|
||||
}
|
||||
|
||||
inline void operator<< (object& o, signed int v)
|
||||
inline void operator<< (msgpack::object& o, signed int v)
|
||||
{
|
||||
if (v < 0) {
|
||||
o.type = type::NEGATIVE_INTEGER;
|
||||
o.type = msgpack::type::NEGATIVE_INTEGER;
|
||||
o.via.i64 = v;
|
||||
}
|
||||
else {
|
||||
o.type = type::POSITIVE_INTEGER;
|
||||
o.type = msgpack::type::POSITIVE_INTEGER;
|
||||
o.via.u64 = v;
|
||||
}
|
||||
}
|
||||
|
||||
inline void operator<< (object& o, signed long v)
|
||||
inline void operator<< (msgpack::object& o, signed long v)
|
||||
{
|
||||
if (v < 0) {
|
||||
o.type = type::NEGATIVE_INTEGER;
|
||||
o.type = msgpack::type::NEGATIVE_INTEGER;
|
||||
o.via.i64 = v;
|
||||
}
|
||||
else {
|
||||
o.type = type::POSITIVE_INTEGER;
|
||||
o.type = msgpack::type::POSITIVE_INTEGER;
|
||||
o.via.u64 = v;
|
||||
}
|
||||
}
|
||||
|
||||
inline void operator<< (object& o, signed long long v)
|
||||
inline void operator<< (msgpack::object& o, signed long long v)
|
||||
{
|
||||
if (v < 0) {
|
||||
o.type = type::NEGATIVE_INTEGER;
|
||||
o.type = msgpack::type::NEGATIVE_INTEGER;
|
||||
o.via.i64 = v;
|
||||
}
|
||||
else{
|
||||
o.type = type::POSITIVE_INTEGER;
|
||||
o.type = msgpack::type::POSITIVE_INTEGER;
|
||||
o.via.u64 = v;
|
||||
}
|
||||
}
|
||||
|
||||
inline void operator<< (object& o, unsigned char v)
|
||||
{ o.type = type::POSITIVE_INTEGER, o.via.u64 = v; }
|
||||
inline void operator<< (msgpack::object& o, unsigned char v)
|
||||
{ o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v; }
|
||||
|
||||
inline void operator<< (object& o, unsigned short v)
|
||||
{ o.type = type::POSITIVE_INTEGER, o.via.u64 = v; }
|
||||
inline void operator<< (msgpack::object& o, unsigned short v)
|
||||
{ o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v; }
|
||||
|
||||
inline void operator<< (object& o, unsigned int v)
|
||||
{ o.type = type::POSITIVE_INTEGER, o.via.u64 = v; }
|
||||
inline void operator<< (msgpack::object& o, unsigned int v)
|
||||
{ o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v; }
|
||||
|
||||
inline void operator<< (object& o, unsigned long v)
|
||||
{ o.type = type::POSITIVE_INTEGER, o.via.u64 = v; }
|
||||
inline void operator<< (msgpack::object& o, unsigned long v)
|
||||
{ o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v; }
|
||||
|
||||
inline void operator<< (object& o, unsigned long long v)
|
||||
{ o.type = type::POSITIVE_INTEGER, o.via.u64 = v; }
|
||||
inline void operator<< (msgpack::object& o, unsigned long long v)
|
||||
{ o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v; }
|
||||
|
||||
|
||||
|
||||
inline void operator<< (object::with_zone& o, char v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, char v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
|
||||
inline void operator<< (object::with_zone& o, signed char v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, signed char v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
inline void operator<< (object::with_zone& o, signed short v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, signed short v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
inline void operator<< (object::with_zone& o, signed int v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, signed int v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
inline void operator<< (object::with_zone& o, signed long v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, signed long v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
inline void operator<< (object::with_zone& o, const signed long long& v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, const signed long long& v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
|
||||
inline void operator<< (object::with_zone& o, unsigned char v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, unsigned char v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
inline void operator<< (object::with_zone& o, unsigned short v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, unsigned short v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
inline void operator<< (object::with_zone& o, unsigned int v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, unsigned int v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
inline void operator<< (object::with_zone& o, unsigned long v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, unsigned long v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
inline void operator<< (object::with_zone& o, const unsigned long long& v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, const unsigned long long& v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
@ -25,19 +25,19 @@ namespace msgpack {
|
||||
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1){
|
||||
|
||||
object const& operator>> (object const& o, char& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, char& v);
|
||||
|
||||
object const& operator>> (object const& o, signed char& v);
|
||||
object const& operator>> (object const& o, signed short& v);
|
||||
object const& operator>> (object const& o, signed int& v);
|
||||
object const& operator>> (object const& o, signed long& v);
|
||||
object const& operator>> (object const& o, signed long long& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, signed char& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, signed short& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, signed int& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, signed long& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, signed long long& v);
|
||||
|
||||
object const& operator>> (object const& o, unsigned char& v);
|
||||
object const& operator>> (object const& o, unsigned short& v);
|
||||
object const& operator>> (object const& o, unsigned int& v);
|
||||
object const& operator>> (object const& o, unsigned long& v);
|
||||
object const& operator>> (object const& o, unsigned long long& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, unsigned char& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, unsigned short& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, unsigned int& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, unsigned long& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, unsigned long long& v);
|
||||
|
||||
template <typename Stream>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, char v);
|
||||
@ -65,33 +65,33 @@ template <typename Stream>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, unsigned long long v);
|
||||
|
||||
|
||||
void operator<< (object& o, char v);
|
||||
void operator<< (msgpack::object& o, char v);
|
||||
|
||||
void operator<< (object& o, signed char v);
|
||||
void operator<< (object& o, signed short v);
|
||||
void operator<< (object& o, signed int v);
|
||||
void operator<< (object& o, signed long v);
|
||||
void operator<< (object& o, signed long long v);
|
||||
void operator<< (msgpack::object& o, signed char v);
|
||||
void operator<< (msgpack::object& o, signed short v);
|
||||
void operator<< (msgpack::object& o, signed int v);
|
||||
void operator<< (msgpack::object& o, signed long v);
|
||||
void operator<< (msgpack::object& o, signed long long v);
|
||||
|
||||
void operator<< (object& o, unsigned char v);
|
||||
void operator<< (object& o, unsigned short v);
|
||||
void operator<< (object& o, unsigned int v);
|
||||
void operator<< (object& o, unsigned long v);
|
||||
void operator<< (object& o, unsigned long long v);
|
||||
void operator<< (msgpack::object& o, unsigned char v);
|
||||
void operator<< (msgpack::object& o, unsigned short v);
|
||||
void operator<< (msgpack::object& o, unsigned int v);
|
||||
void operator<< (msgpack::object& o, unsigned long v);
|
||||
void operator<< (msgpack::object& o, unsigned long long v);
|
||||
|
||||
void operator<< (object::with_zone& o, char v);
|
||||
void operator<< (msgpack::object::with_zone& o, char v);
|
||||
|
||||
void operator<< (object::with_zone& o, signed char v);
|
||||
void operator<< (object::with_zone& o, signed short v);
|
||||
void operator<< (object::with_zone& o, signed int v);
|
||||
void operator<< (object::with_zone& o, signed long v);
|
||||
void operator<< (object::with_zone& o, const signed long long& v);
|
||||
void operator<< (msgpack::object::with_zone& o, signed char v);
|
||||
void operator<< (msgpack::object::with_zone& o, signed short v);
|
||||
void operator<< (msgpack::object::with_zone& o, signed int v);
|
||||
void operator<< (msgpack::object::with_zone& o, signed long v);
|
||||
void operator<< (msgpack::object::with_zone& o, const signed long long& v);
|
||||
|
||||
void operator<< (object::with_zone& o, unsigned char v);
|
||||
void operator<< (object::with_zone& o, unsigned short v);
|
||||
void operator<< (object::with_zone& o, unsigned int v);
|
||||
void operator<< (object::with_zone& o, unsigned long v);
|
||||
void operator<< (object::with_zone& o, const unsigned long long& v);
|
||||
void operator<< (msgpack::object::with_zone& o, unsigned char v);
|
||||
void operator<< (msgpack::object::with_zone& o, unsigned short v);
|
||||
void operator<< (msgpack::object::with_zone& o, unsigned int v);
|
||||
void operator<< (msgpack::object::with_zone& o, unsigned long v);
|
||||
void operator<< (msgpack::object::with_zone& o, const unsigned long long& v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
@ -27,12 +27,12 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename T>
|
||||
inline object const& operator>> (object const& o, std::list<T>& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, std::list<T>& v)
|
||||
{
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
||||
v.resize(o.via.array.size);
|
||||
object* p = o.via.array.ptr;
|
||||
object* const pend = o.via.array.ptr + o.via.array.size;
|
||||
msgpack::object* p = o.via.array.ptr;
|
||||
msgpack::object* const pend = o.via.array.ptr + o.via.array.size;
|
||||
typename std::list<T>::iterator it = v.begin();
|
||||
for(; p < pend; ++p, ++it) {
|
||||
p->convert(*it);
|
||||
@ -52,20 +52,20 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const std::list<T>& v)
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void operator<< (object::with_zone& o, const std::list<T>& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const std::list<T>& v)
|
||||
{
|
||||
o.type = type::ARRAY;
|
||||
o.type = msgpack::type::ARRAY;
|
||||
if(v.empty()) {
|
||||
o.via.array.ptr = nullptr;
|
||||
o.via.array.size = 0;
|
||||
} else {
|
||||
object* p = static_cast<object*>(o.zone.allocate_align(sizeof(object)*v.size()));
|
||||
object* const pend = p + v.size();
|
||||
msgpack::object* p = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*v.size()));
|
||||
msgpack::object* const pend = p + v.size();
|
||||
o.via.array.ptr = p;
|
||||
o.via.array.size = v.size();
|
||||
typename std::list<T>::const_iterator it(v.begin());
|
||||
do {
|
||||
*p = object(*it, o.zone);
|
||||
*p = msgpack::object(*it, o.zone);
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
|
@ -27,11 +27,11 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename T>
|
||||
object const& operator>> (object const& o, std::list<T>& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, std::list<T>& v);
|
||||
template <typename Stream, typename T>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const std::list<T>& v);
|
||||
template <typename T>
|
||||
void operator<< (object::with_zone& o, const std::list<T>& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const std::list<T>& v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
@ -45,12 +45,12 @@ namespace detail {
|
||||
|
||||
|
||||
template <typename K, typename V>
|
||||
inline object const& operator>> (object const& o, type::assoc_vector<K,V>& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, type::assoc_vector<K,V>& v)
|
||||
{
|
||||
if(o.type != type::MAP) { throw type_error(); }
|
||||
if(o.type != msgpack::type::MAP) { throw type_error(); }
|
||||
v.resize(o.via.map.size);
|
||||
object_kv* p = o.via.map.ptr;
|
||||
object_kv* const pend = o.via.map.ptr + o.via.map.size;
|
||||
msgpack::object_kv* p = o.via.map.ptr;
|
||||
msgpack::object_kv* const pend = o.via.map.ptr + o.via.map.size;
|
||||
std::pair<K, V>* it(&v.front());
|
||||
for(; p < pend; ++p, ++it) {
|
||||
p->key.convert(it->first);
|
||||
@ -73,21 +73,21 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const type::assoc_vector<K
|
||||
}
|
||||
|
||||
template <typename K, typename V>
|
||||
inline void operator<< (object::with_zone& o, const type::assoc_vector<K,V>& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const type::assoc_vector<K,V>& v)
|
||||
{
|
||||
o.type = type::MAP;
|
||||
o.type = msgpack::type::MAP;
|
||||
if(v.empty()) {
|
||||
o.via.map.ptr = nullptr;
|
||||
o.via.map.size = 0;
|
||||
} else {
|
||||
object_kv* p = static_cast<object_kv*>(o.zone.allocate_align(sizeof(object_kv)*v.size()));
|
||||
object_kv* const pend = p + v.size();
|
||||
msgpack::object_kv* p = static_cast<msgpack::object_kv*>(o.zone.allocate_align(sizeof(msgpack::object_kv)*v.size()));
|
||||
msgpack::object_kv* const pend = p + v.size();
|
||||
o.via.map.ptr = p;
|
||||
o.via.map.size = v.size();
|
||||
typename type::assoc_vector<K,V>::const_iterator it(v.begin());
|
||||
do {
|
||||
p->key = object(it->first, o.zone);
|
||||
p->val = object(it->second, o.zone);
|
||||
p->key = msgpack::object(it->first, o.zone);
|
||||
p->val = msgpack::object(it->second, o.zone);
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
@ -96,11 +96,11 @@ inline void operator<< (object::with_zone& o, const type::assoc_vector<K,V>& v)
|
||||
|
||||
|
||||
template <typename K, typename V>
|
||||
inline object const& operator>> (object const& o, std::map<K, V>& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, std::map<K, V>& v)
|
||||
{
|
||||
if(o.type != type::MAP) { throw type_error(); }
|
||||
object_kv* p(o.via.map.ptr);
|
||||
object_kv* const pend(o.via.map.ptr + o.via.map.size);
|
||||
if(o.type != msgpack::type::MAP) { throw type_error(); }
|
||||
msgpack::object_kv* p(o.via.map.ptr);
|
||||
msgpack::object_kv* const pend(o.via.map.ptr + o.via.map.size);
|
||||
std::map<K, V> tmp;
|
||||
for(; p != pend; ++p) {
|
||||
K key;
|
||||
@ -131,21 +131,21 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const std::map<K,V>& v)
|
||||
}
|
||||
|
||||
template <typename K, typename V>
|
||||
inline void operator<< (object::with_zone& o, const std::map<K,V>& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const std::map<K,V>& v)
|
||||
{
|
||||
o.type = type::MAP;
|
||||
o.type = msgpack::type::MAP;
|
||||
if(v.empty()) {
|
||||
o.via.map.ptr = nullptr;
|
||||
o.via.map.size = 0;
|
||||
} else {
|
||||
object_kv* p = static_cast<object_kv*>(o.zone.allocate_align(sizeof(object_kv)*v.size()));
|
||||
object_kv* const pend = p + v.size();
|
||||
msgpack::object_kv* p = static_cast<msgpack::object_kv*>(o.zone.allocate_align(sizeof(msgpack::object_kv)*v.size()));
|
||||
msgpack::object_kv* const pend = p + v.size();
|
||||
o.via.map.ptr = p;
|
||||
o.via.map.size = v.size();
|
||||
typename std::map<K,V>::const_iterator it(v.begin());
|
||||
do {
|
||||
p->key = object(it->first, o.zone);
|
||||
p->val = object(it->second, o.zone);
|
||||
p->key = msgpack::object(it->first, o.zone);
|
||||
p->val = msgpack::object(it->second, o.zone);
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
@ -154,11 +154,11 @@ inline void operator<< (object::with_zone& o, const std::map<K,V>& v)
|
||||
|
||||
|
||||
template <typename K, typename V>
|
||||
inline object const& operator>> (object const& o, std::multimap<K, V>& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, std::multimap<K, V>& v)
|
||||
{
|
||||
if(o.type != type::MAP) { throw type_error(); }
|
||||
object_kv* p(o.via.map.ptr);
|
||||
object_kv* const pend(o.via.map.ptr + o.via.map.size);
|
||||
if(o.type != msgpack::type::MAP) { throw type_error(); }
|
||||
msgpack::object_kv* p(o.via.map.ptr);
|
||||
msgpack::object_kv* const pend(o.via.map.ptr + o.via.map.size);
|
||||
std::multimap<K, V> tmp;
|
||||
for(; p != pend; ++p) {
|
||||
std::pair<K, V> value;
|
||||
@ -183,21 +183,21 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const std::multimap<K,V>&
|
||||
}
|
||||
|
||||
template <typename K, typename V>
|
||||
inline void operator<< (object::with_zone& o, const std::multimap<K,V>& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const std::multimap<K,V>& v)
|
||||
{
|
||||
o.type = type::MAP;
|
||||
o.type = msgpack::type::MAP;
|
||||
if(v.empty()) {
|
||||
o.via.map.ptr = nullptr;
|
||||
o.via.map.size = 0;
|
||||
} else {
|
||||
object_kv* p = static_cast<object_kv*>(o.zone.allocate_align(sizeof(object_kv)*v.size()));
|
||||
object_kv* const pend = p + v.size();
|
||||
msgpack::object_kv* p = static_cast<msgpack::object_kv*>(o.zone.allocate_align(sizeof(msgpack::object_kv)*v.size()));
|
||||
msgpack::object_kv* const pend = p + v.size();
|
||||
o.via.map.ptr = p;
|
||||
o.via.map.size = v.size();
|
||||
typename std::multimap<K,V>::const_iterator it(v.begin());
|
||||
do {
|
||||
p->key = object(it->first, o.zone);
|
||||
p->val = object(it->second, o.zone);
|
||||
p->key = msgpack::object(it->first, o.zone);
|
||||
p->val = msgpack::object(it->second, o.zone);
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
|
@ -42,25 +42,25 @@ namespace detail {
|
||||
|
||||
|
||||
template <typename K, typename V>
|
||||
object const& operator>> (object const& o, type::assoc_vector<K,V>& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, type::assoc_vector<K,V>& v);
|
||||
template <typename Stream, typename K, typename V>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const type::assoc_vector<K,V>& v);
|
||||
template <typename K, typename V>
|
||||
void operator<< (object::with_zone& o, const type::assoc_vector<K,V>& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const type::assoc_vector<K,V>& v);
|
||||
|
||||
template <typename K, typename V>
|
||||
object const& operator>> (object const& o, std::map<K, V>& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, std::map<K, V>& v);
|
||||
template <typename Stream, typename K, typename V>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const std::map<K,V>& v);
|
||||
template <typename K, typename V>
|
||||
void operator<< (object::with_zone& o, const std::map<K,V>& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const std::map<K,V>& v);
|
||||
|
||||
template <typename K, typename V>
|
||||
object const& operator>> (object const& o, std::multimap<K, V>& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, std::multimap<K, V>& v);
|
||||
template <typename Stream, typename K, typename V>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const std::multimap<K,V>& v);
|
||||
template <typename K, typename V>
|
||||
void operator<< (object::with_zone& o, const std::multimap<K,V>& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const std::multimap<K,V>& v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
@ -32,9 +32,9 @@ struct nil { };
|
||||
} // namespace type
|
||||
|
||||
|
||||
inline object const& operator>> (object const& o, type::nil&)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, type::nil&)
|
||||
{
|
||||
if(o.type != type::NIL) { throw type_error(); }
|
||||
if(o.type != msgpack::type::NIL) { throw type_error(); }
|
||||
return o;
|
||||
}
|
||||
|
||||
@ -45,17 +45,17 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const type::nil&)
|
||||
return o;
|
||||
}
|
||||
|
||||
inline void operator<< (object& o, type::nil)
|
||||
inline void operator<< (msgpack::object& o, type::nil)
|
||||
{
|
||||
o.type = type::NIL;
|
||||
o.type = msgpack::type::NIL;
|
||||
}
|
||||
|
||||
inline void operator<< (object::with_zone& o, type::nil v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, type::nil v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
|
||||
template <>
|
||||
inline void object::as<void>() const
|
||||
inline void msgpack::object::as<void>() const
|
||||
{
|
||||
msgpack::type::nil v;
|
||||
convert(v);
|
||||
|
@ -32,17 +32,17 @@ struct nil;
|
||||
} // namespace type
|
||||
|
||||
|
||||
object const& operator>> (object const& o, type::nil&);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, type::nil&);
|
||||
|
||||
template <typename Stream>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const type::nil&);
|
||||
|
||||
void operator<< (object& o, type::nil);
|
||||
void operator<< (msgpack::object& o, type::nil);
|
||||
|
||||
void operator<< (object::with_zone& o, type::nil v);
|
||||
void operator<< (msgpack::object::with_zone& o, type::nil v);
|
||||
|
||||
template <>
|
||||
inline void object::as<void>() const;
|
||||
inline void msgpack::object::as<void>() const;
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
@ -27,9 +27,9 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename T1, typename T2>
|
||||
inline object const& operator>> (object const& o, std::pair<T1, T2>& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, std::pair<T1, T2>& v)
|
||||
{
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
||||
if(o.via.array.size != 2) { throw type_error(); }
|
||||
o.via.array.ptr[0].convert(v.first);
|
||||
o.via.array.ptr[1].convert(v.second);
|
||||
@ -46,14 +46,14 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const std::pair<T1, T2>& v
|
||||
}
|
||||
|
||||
template <typename T1, typename T2>
|
||||
inline void operator<< (object::with_zone& o, const std::pair<T1, T2>& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const std::pair<T1, T2>& v)
|
||||
{
|
||||
o.type = type::ARRAY;
|
||||
object* p = static_cast<object*>(o.zone.allocate_align(sizeof(object)*2));
|
||||
o.type = msgpack::type::ARRAY;
|
||||
msgpack::object* p = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*2));
|
||||
o.via.array.ptr = p;
|
||||
o.via.array.size = 2;
|
||||
p[0] = object(v.first, o.zone);
|
||||
p[1] = object(v.second, o.zone);
|
||||
p[0] = msgpack::object(v.first, o.zone);
|
||||
p[1] = msgpack::object(v.second, o.zone);
|
||||
}
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
@ -27,13 +27,13 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename T1, typename T2>
|
||||
object const& operator>> (object const& o, std::pair<T1, T2>& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, std::pair<T1, T2>& v);
|
||||
|
||||
template <typename Stream, typename T1, typename T2>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const std::pair<T1, T2>& v);
|
||||
|
||||
template <typename T1, typename T2>
|
||||
void operator<< (object::with_zone& o, const std::pair<T1, T2>& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const std::pair<T1, T2>& v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
@ -64,31 +64,31 @@ struct raw_ref {
|
||||
} // namespace type
|
||||
|
||||
|
||||
inline object const& operator>> (object const& o, type::raw_ref& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, msgpack::type::raw_ref& v)
|
||||
{
|
||||
if(o.type != type::BIN) { throw type_error(); }
|
||||
if(o.type != msgpack::type::BIN) { throw type_error(); }
|
||||
v.ptr = o.via.bin.ptr;
|
||||
v.size = o.via.bin.size;
|
||||
return o;
|
||||
}
|
||||
|
||||
template <typename Stream>
|
||||
inline packer<Stream>& operator<< (packer<Stream>& o, const type::raw_ref& v)
|
||||
inline packer<Stream>& operator<< (packer<Stream>& o, const msgpack::type::raw_ref& v)
|
||||
{
|
||||
o.pack_bin(v.size);
|
||||
o.pack_bin_body(v.ptr, v.size);
|
||||
return o;
|
||||
}
|
||||
|
||||
inline void operator<< (object& o, const type::raw_ref& v)
|
||||
inline void operator<< (msgpack::object& o, const msgpack::type::raw_ref& v)
|
||||
{
|
||||
o.type = type::BIN;
|
||||
o.type = msgpack::type::BIN;
|
||||
o.via.bin.ptr = v.ptr;
|
||||
o.via.bin.size = v.size;
|
||||
}
|
||||
|
||||
inline void operator<< (object::with_zone& o, const type::raw_ref& v)
|
||||
{ static_cast<object&>(o) << v; }
|
||||
inline void operator<< (msgpack::object::with_zone& o, const msgpack::type::raw_ref& v)
|
||||
{ static_cast<msgpack::object&>(o) << v; }
|
||||
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
@ -34,14 +34,14 @@ struct raw_ref;
|
||||
} // namespace type
|
||||
|
||||
|
||||
object const& operator>> (object const& o, type::raw_ref& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, type::raw_ref& v);
|
||||
|
||||
template <typename Stream>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const type::raw_ref& v);
|
||||
|
||||
void operator<< (object& o, const type::raw_ref& v);
|
||||
void operator<< (msgpack::object& o, const type::raw_ref& v);
|
||||
|
||||
void operator<< (object::with_zone& o, const type::raw_ref& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const type::raw_ref& v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
@ -28,11 +28,11 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename T>
|
||||
inline object const& operator>> (object const& o, std::set<T>& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, std::set<T>& v)
|
||||
{
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
object* p = o.via.array.ptr + o.via.array.size;
|
||||
object* const pbegin = o.via.array.ptr;
|
||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
||||
msgpack::object* p = o.via.array.ptr + o.via.array.size;
|
||||
msgpack::object* const pbegin = o.via.array.ptr;
|
||||
std::set<T> tmp;
|
||||
while(p > pbegin) {
|
||||
--p;
|
||||
@ -54,20 +54,20 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const std::set<T>& v)
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void operator<< (object::with_zone& o, const std::set<T>& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const std::set<T>& v)
|
||||
{
|
||||
o.type = type::ARRAY;
|
||||
o.type = msgpack::type::ARRAY;
|
||||
if(v.empty()) {
|
||||
o.via.array.ptr = nullptr;
|
||||
o.via.array.size = 0;
|
||||
} else {
|
||||
object* p = static_cast<object*>(o.zone.allocate_align(sizeof(object)*v.size()));
|
||||
object* const pend = p + v.size();
|
||||
msgpack::object* p = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*v.size()));
|
||||
msgpack::object* const pend = p + v.size();
|
||||
o.via.array.ptr = p;
|
||||
o.via.array.size = v.size();
|
||||
typename std::set<T>::const_iterator it(v.begin());
|
||||
do {
|
||||
*p = object(*it, o.zone);
|
||||
*p = msgpack::object(*it, o.zone);
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
@ -76,11 +76,11 @@ inline void operator<< (object::with_zone& o, const std::set<T>& v)
|
||||
|
||||
|
||||
template <typename T>
|
||||
inline object const& operator>> (object const& o, std::multiset<T>& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, std::multiset<T>& v)
|
||||
{
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
object* p = o.via.array.ptr + o.via.array.size;
|
||||
object* const pbegin = o.via.array.ptr;
|
||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
||||
msgpack::object* p = o.via.array.ptr + o.via.array.size;
|
||||
msgpack::object* const pbegin = o.via.array.ptr;
|
||||
std::multiset<T> tmp;
|
||||
while(p > pbegin) {
|
||||
--p;
|
||||
@ -102,20 +102,20 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const std::multiset<T>& v)
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void operator<< (object::with_zone& o, const std::multiset<T>& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const std::multiset<T>& v)
|
||||
{
|
||||
o.type = type::ARRAY;
|
||||
o.type = msgpack::type::ARRAY;
|
||||
if(v.empty()) {
|
||||
o.via.array.ptr = nullptr;
|
||||
o.via.array.size = 0;
|
||||
} else {
|
||||
object* p = static_cast<object*>(o.zone.allocate_align(sizeof(object)*v.size()));
|
||||
object* const pend = p + v.size();
|
||||
msgpack::object* p = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*v.size()));
|
||||
msgpack::object* const pend = p + v.size();
|
||||
o.via.array.ptr = p;
|
||||
o.via.array.size = v.size();
|
||||
typename std::multiset<T>::const_iterator it(v.begin());
|
||||
do {
|
||||
*p = object(*it, o.zone);
|
||||
*p = msgpack::object(*it, o.zone);
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
|
@ -28,22 +28,22 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename T>
|
||||
object const& operator>> (object const& o, std::set<T>& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, std::set<T>& v);
|
||||
|
||||
template <typename Stream, typename T>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const std::set<T>& v);
|
||||
|
||||
template <typename T>
|
||||
void operator<< (object::with_zone& o, const std::set<T>& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const std::set<T>& v);
|
||||
|
||||
template <typename T>
|
||||
object const& operator>> (object const& o, std::multiset<T>& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, std::multiset<T>& v);
|
||||
|
||||
template <typename Stream, typename T>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const std::multiset<T>& v);
|
||||
|
||||
template <typename T>
|
||||
void operator<< (object::with_zone& o, const std::multiset<T>& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const std::multiset<T>& v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
@ -26,13 +26,13 @@ namespace msgpack {
|
||||
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
inline object const& operator>> (object const& o, std::string& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, std::string& v)
|
||||
{
|
||||
switch (o.type) {
|
||||
case type::BIN:
|
||||
case msgpack::type::BIN:
|
||||
v.assign(o.via.bin.ptr, o.via.bin.size);
|
||||
break;
|
||||
case type::STR:
|
||||
case msgpack::type::STR:
|
||||
v.assign(o.via.str.ptr, o.via.str.size);
|
||||
break;
|
||||
default:
|
||||
@ -50,18 +50,18 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const std::string& v)
|
||||
return o;
|
||||
}
|
||||
|
||||
inline void operator<< (object::with_zone& o, const std::string& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const std::string& v)
|
||||
{
|
||||
o.type = type::STR;
|
||||
o.type = msgpack::type::STR;
|
||||
char* ptr = static_cast<char*>(o.zone.allocate_align(v.size()));
|
||||
o.via.str.ptr = ptr;
|
||||
o.via.str.size = static_cast<uint32_t>(v.size());
|
||||
memcpy(ptr, v.data(), v.size());
|
||||
}
|
||||
|
||||
inline void operator<< (object& o, const std::string& v)
|
||||
inline void operator<< (msgpack::object& o, const std::string& v)
|
||||
{
|
||||
o.type = type::STR;
|
||||
o.type = msgpack::type::STR;
|
||||
o.via.str.ptr = v.data();
|
||||
o.via.str.size = static_cast<uint32_t>(v.size());
|
||||
}
|
||||
|
@ -26,14 +26,14 @@ namespace msgpack {
|
||||
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
object const& operator>> (object const& o, std::string& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, std::string& v);
|
||||
|
||||
template <typename Stream>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const std::string& v);
|
||||
|
||||
void operator<< (object::with_zone& o, const std::string& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const std::string& v);
|
||||
|
||||
void operator<< (object& o, const std::string& v);
|
||||
void operator<< (msgpack::object& o, const std::string& v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
@ -47,11 +47,11 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename K, typename V>
|
||||
inline object const& operator>> (object const& o, MSGPACK_STD_TR1::unordered_map<K, V>& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, MSGPACK_STD_TR1::unordered_map<K, V>& v)
|
||||
{
|
||||
if(o.type != type::MAP) { throw type_error(); }
|
||||
object_kv* p(o.via.map.ptr);
|
||||
object_kv* const pend(o.via.map.ptr + o.via.map.size);
|
||||
if(o.type != msgpack::type::MAP) { throw type_error(); }
|
||||
msgpack::object_kv* p(o.via.map.ptr);
|
||||
msgpack::object_kv* const pend(o.via.map.ptr + o.via.map.size);
|
||||
MSGPACK_STD_TR1::unordered_map<K, V> tmp;
|
||||
for(; p != pend; ++p) {
|
||||
K key;
|
||||
@ -75,21 +75,21 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const MSGPACK_STD_TR1::uno
|
||||
}
|
||||
|
||||
template <typename K, typename V>
|
||||
inline void operator<< (object::with_zone& o, const MSGPACK_STD_TR1::unordered_map<K,V>& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const MSGPACK_STD_TR1::unordered_map<K,V>& v)
|
||||
{
|
||||
o.type = type::MAP;
|
||||
o.type = msgpack::type::MAP;
|
||||
if(v.empty()) {
|
||||
o.via.map.ptr = nullptr;
|
||||
o.via.map.size = 0;
|
||||
} else {
|
||||
object_kv* p = static_cast<object_kv*>(o.zone.allocate_align(sizeof(object_kv)*v.size()));
|
||||
object_kv* const pend = p + v.size();
|
||||
msgpack::object_kv* p = static_cast<msgpack::object_kv*>(o.zone.allocate_align(sizeof(msgpack::object_kv)*v.size()));
|
||||
msgpack::object_kv* const pend = p + v.size();
|
||||
o.via.map.ptr = p;
|
||||
o.via.map.size = v.size();
|
||||
typename MSGPACK_STD_TR1::unordered_map<K,V>::const_iterator it(v.begin());
|
||||
do {
|
||||
p->key = object(it->first, o.zone);
|
||||
p->val = object(it->second, o.zone);
|
||||
p->key = msgpack::object(it->first, o.zone);
|
||||
p->val = msgpack::object(it->second, o.zone);
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
@ -98,11 +98,11 @@ inline void operator<< (object::with_zone& o, const MSGPACK_STD_TR1::unordered_m
|
||||
|
||||
|
||||
template <typename K, typename V>
|
||||
inline object const& operator>> (object const& o, MSGPACK_STD_TR1::unordered_multimap<K, V>& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, MSGPACK_STD_TR1::unordered_multimap<K, V>& v)
|
||||
{
|
||||
if(o.type != type::MAP) { throw type_error(); }
|
||||
object_kv* p(o.via.map.ptr);
|
||||
object_kv* const pend(o.via.map.ptr + o.via.map.size);
|
||||
if(o.type != msgpack::type::MAP) { throw type_error(); }
|
||||
msgpack::object_kv* p(o.via.map.ptr);
|
||||
msgpack::object_kv* const pend(o.via.map.ptr + o.via.map.size);
|
||||
MSGPACK_STD_TR1::unordered_multimap<K, V> tmp;
|
||||
for(; p != pend; ++p) {
|
||||
std::pair<K, V> value;
|
||||
@ -127,21 +127,21 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const MSGPACK_STD_TR1::uno
|
||||
}
|
||||
|
||||
template <typename K, typename V>
|
||||
inline void operator<< (object::with_zone& o, const MSGPACK_STD_TR1::unordered_multimap<K,V>& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const MSGPACK_STD_TR1::unordered_multimap<K,V>& v)
|
||||
{
|
||||
o.type = type::MAP;
|
||||
o.type = msgpack::type::MAP;
|
||||
if(v.empty()) {
|
||||
o.via.map.ptr = nullptr;
|
||||
o.via.map.size = 0;
|
||||
} else {
|
||||
object_kv* p = static_cast<object_kv*>(o.zone.allocate_align(sizeof(object_kv)*v.size()));
|
||||
object_kv* const pend = p + v.size();
|
||||
msgpack::object_kv* p = static_cast<msgpack::object_kv*>(o.zone.allocate_align(sizeof(msgpack::object_kv)*v.size()));
|
||||
msgpack::object_kv* const pend = p + v.size();
|
||||
o.via.map.ptr = p;
|
||||
o.via.map.size = v.size();
|
||||
typename MSGPACK_STD_TR1::unordered_multimap<K,V>::const_iterator it(v.begin());
|
||||
do {
|
||||
p->key = object(it->first, o.zone);
|
||||
p->val = object(it->second, o.zone);
|
||||
p->key = msgpack::object(it->first, o.zone);
|
||||
p->val = msgpack::object(it->second, o.zone);
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
|
@ -47,22 +47,22 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename K, typename V>
|
||||
object const& operator>> (object const& o, MSGPACK_STD_TR1::unordered_map<K, V>& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, MSGPACK_STD_TR1::unordered_map<K, V>& v);
|
||||
|
||||
template <typename Stream, typename K, typename V>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const MSGPACK_STD_TR1::unordered_map<K,V>& v);
|
||||
|
||||
template <typename K, typename V>
|
||||
void operator<< (object::with_zone& o, const MSGPACK_STD_TR1::unordered_map<K,V>& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const MSGPACK_STD_TR1::unordered_map<K,V>& v);
|
||||
|
||||
template <typename K, typename V>
|
||||
object const& operator>> (object const& o, MSGPACK_STD_TR1::unordered_multimap<K, V>& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, MSGPACK_STD_TR1::unordered_multimap<K, V>& v);
|
||||
|
||||
template <typename Stream, typename K, typename V>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const MSGPACK_STD_TR1::unordered_multimap<K,V>& v);
|
||||
|
||||
template <typename K, typename V>
|
||||
void operator<< (object::with_zone& o, const MSGPACK_STD_TR1::unordered_multimap<K,V>& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const MSGPACK_STD_TR1::unordered_multimap<K,V>& v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
@ -47,11 +47,11 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename T>
|
||||
inline object const& operator>> (object const& o, MSGPACK_STD_TR1::unordered_set<T>& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, MSGPACK_STD_TR1::unordered_set<T>& v)
|
||||
{
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
object* p = o.via.array.ptr + o.via.array.size;
|
||||
object* const pbegin = o.via.array.ptr;
|
||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
||||
msgpack::object* p = o.via.array.ptr + o.via.array.size;
|
||||
msgpack::object* const pbegin = o.via.array.ptr;
|
||||
MSGPACK_STD_TR1::unordered_set<T> tmp;
|
||||
while(p > pbegin) {
|
||||
--p;
|
||||
@ -73,20 +73,20 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const MSGPACK_STD_TR1::uno
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void operator<< (object::with_zone& o, const MSGPACK_STD_TR1::unordered_set<T>& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const MSGPACK_STD_TR1::unordered_set<T>& v)
|
||||
{
|
||||
o.type = type::ARRAY;
|
||||
o.type = msgpack::type::ARRAY;
|
||||
if(v.empty()) {
|
||||
o.via.array.ptr = nullptr;
|
||||
o.via.array.size = 0;
|
||||
} else {
|
||||
object* p = static_cast<object*>(o.zone.allocate_align(sizeof(object)*v.size()));
|
||||
object* const pend = p + v.size();
|
||||
msgpack::object* p = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*v.size()));
|
||||
msgpack::object* const pend = p + v.size();
|
||||
o.via.array.ptr = p;
|
||||
o.via.array.size = v.size();
|
||||
typename MSGPACK_STD_TR1::unordered_set<T>::const_iterator it(v.begin());
|
||||
do {
|
||||
*p = object(*it, o.zone);
|
||||
*p = msgpack::object(*it, o.zone);
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
@ -95,11 +95,11 @@ inline void operator<< (object::with_zone& o, const MSGPACK_STD_TR1::unordered_s
|
||||
|
||||
|
||||
template <typename T>
|
||||
inline object const& operator>> (object const& o, MSGPACK_STD_TR1::unordered_multiset<T>& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, MSGPACK_STD_TR1::unordered_multiset<T>& v)
|
||||
{
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
object* p = o.via.array.ptr + o.via.array.size;
|
||||
object* const pbegin = o.via.array.ptr;
|
||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
||||
msgpack::object* p = o.via.array.ptr + o.via.array.size;
|
||||
msgpack::object* const pbegin = o.via.array.ptr;
|
||||
MSGPACK_STD_TR1::unordered_multiset<T> tmp;
|
||||
while(p > pbegin) {
|
||||
--p;
|
||||
@ -121,20 +121,20 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const MSGPACK_STD_TR1::uno
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void operator<< (object::with_zone& o, const MSGPACK_STD_TR1::unordered_multiset<T>& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const MSGPACK_STD_TR1::unordered_multiset<T>& v)
|
||||
{
|
||||
o.type = type::ARRAY;
|
||||
o.type = msgpack::type::ARRAY;
|
||||
if(v.empty()) {
|
||||
o.via.array.ptr = nullptr;
|
||||
o.via.array.size = 0;
|
||||
} else {
|
||||
object* p = static_cast<object*>(o.zone.allocate_align(sizeof(object)*v.size()));
|
||||
object* const pend = p + v.size();
|
||||
msgpack::object* p = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*v.size()));
|
||||
msgpack::object* const pend = p + v.size();
|
||||
o.via.array.ptr = p;
|
||||
o.via.array.size = v.size();
|
||||
typename MSGPACK_STD_TR1::unordered_multiset<T>::const_iterator it(v.begin());
|
||||
do {
|
||||
*p = object(*it, o.zone);
|
||||
*p = msgpack::object(*it, o.zone);
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
|
@ -47,22 +47,22 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename T>
|
||||
object const& operator>> (object const& o, MSGPACK_STD_TR1::unordered_set<T>& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, MSGPACK_STD_TR1::unordered_set<T>& v);
|
||||
|
||||
template <typename Stream, typename T>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const MSGPACK_STD_TR1::unordered_set<T>& v);
|
||||
|
||||
template <typename T>
|
||||
void operator<< (object::with_zone& o, const MSGPACK_STD_TR1::unordered_set<T>& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const MSGPACK_STD_TR1::unordered_set<T>& v);
|
||||
|
||||
template <typename T>
|
||||
object const& operator>> (object const& o, MSGPACK_STD_TR1::unordered_multiset<T>& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, MSGPACK_STD_TR1::unordered_multiset<T>& v);
|
||||
|
||||
template <typename Stream, typename T>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const MSGPACK_STD_TR1::unordered_multiset<T>& v);
|
||||
|
||||
template <typename T>
|
||||
void operator<< (object::with_zone& o, const MSGPACK_STD_TR1::unordered_multiset<T>& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const MSGPACK_STD_TR1::unordered_multiset<T>& v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
@ -27,13 +27,13 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename T>
|
||||
inline object const& operator>> (object const& o, std::vector<T>& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, std::vector<T>& v)
|
||||
{
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
||||
v.resize(o.via.array.size);
|
||||
if(o.via.array.size > 0) {
|
||||
object* p = o.via.array.ptr;
|
||||
object* const pend = o.via.array.ptr + o.via.array.size;
|
||||
msgpack::object* p = o.via.array.ptr;
|
||||
msgpack::object* const pend = o.via.array.ptr + o.via.array.size;
|
||||
T* it = &v[0];
|
||||
do {
|
||||
p->convert(*it);
|
||||
@ -56,20 +56,20 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const std::vector<T>& v)
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void operator<< (object::with_zone& o, const std::vector<T>& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const std::vector<T>& v)
|
||||
{
|
||||
o.type = type::ARRAY;
|
||||
o.type = msgpack::type::ARRAY;
|
||||
if(v.empty()) {
|
||||
o.via.array.ptr = nullptr;
|
||||
o.via.array.size = 0;
|
||||
} else {
|
||||
object* p = static_cast<object*>(o.zone.allocate_align(sizeof(object)*v.size()));
|
||||
object* const pend = p + v.size();
|
||||
msgpack::object* p = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*v.size()));
|
||||
msgpack::object* const pend = p + v.size();
|
||||
o.via.array.ptr = p;
|
||||
o.via.array.size = v.size();
|
||||
typename std::vector<T>::const_iterator it(v.begin());
|
||||
do {
|
||||
*p = object(*it, o.zone);
|
||||
*p = msgpack::object(*it, o.zone);
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
|
@ -26,14 +26,14 @@ namespace msgpack {
|
||||
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
inline object const& operator>> (object const& o, std::vector<char>& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, std::vector<char>& v)
|
||||
{
|
||||
switch (o.type) {
|
||||
case type::BIN:
|
||||
case msgpack::type::BIN:
|
||||
v.resize(o.via.bin.size);
|
||||
std::memcpy(&v.front(), o.via.bin.ptr, o.via.bin.size);
|
||||
break;
|
||||
case type::STR:
|
||||
case msgpack::type::STR:
|
||||
v.resize(o.via.str.size);
|
||||
std::memcpy(&v.front(), o.via.str.ptr, o.via.str.size);
|
||||
break;
|
||||
@ -53,16 +53,16 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const std::vector<char>& v
|
||||
return o;
|
||||
}
|
||||
|
||||
inline void operator<< (object& o, const std::vector<char>& v)
|
||||
inline void operator<< (msgpack::object& o, const std::vector<char>& v)
|
||||
{
|
||||
o.type = type::BIN;
|
||||
o.type = msgpack::type::BIN;
|
||||
o.via.bin.ptr = &v.front();
|
||||
o.via.bin.size = static_cast<uint32_t>(v.size());
|
||||
}
|
||||
|
||||
inline void operator<< (object::with_zone& o, const std::vector<char>& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const std::vector<char>& v)
|
||||
{
|
||||
o.type = type::BIN;
|
||||
o.type = msgpack::type::BIN;
|
||||
char* ptr = static_cast<char*>(o.zone.allocate_align(v.size()));
|
||||
o.via.bin.ptr = ptr;
|
||||
o.via.bin.size = static_cast<uint32_t>(v.size());
|
||||
|
@ -26,14 +26,14 @@ namespace msgpack {
|
||||
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
object const& operator>> (object const& o, std::vector<char>& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, std::vector<char>& v);
|
||||
|
||||
template <typename Stream>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const std::vector<char>& v);
|
||||
|
||||
void operator<< (object& o, const std::vector<char>& v);
|
||||
void operator<< (msgpack::object& o, const std::vector<char>& v);
|
||||
|
||||
void operator<< (object::with_zone& o, const std::vector<char>& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const std::vector<char>& v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
@ -27,13 +27,13 @@ namespace msgpack {
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
template <typename T>
|
||||
object const& operator>> (object const& o, std::vector<T>& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, std::vector<T>& v);
|
||||
|
||||
template <typename Stream, typename T>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const std::vector<T>& v);
|
||||
|
||||
template <typename T>
|
||||
void operator<< (object::with_zone& o, const std::vector<T>& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const std::vector<T>& v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
@ -81,17 +81,17 @@ struct object::implicit_type {
|
||||
operator T() { return obj.as<T>(); }
|
||||
|
||||
private:
|
||||
object const& obj;
|
||||
msgpack::object const& obj;
|
||||
};
|
||||
|
||||
inline object const& operator>> (object const& o, object& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, msgpack::object& v)
|
||||
{
|
||||
v = o;
|
||||
return o;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline object const& operator>> (object const& o, T& v)
|
||||
inline msgpack::object const& operator>> (msgpack::object const& o, T& v)
|
||||
{
|
||||
// If you get a error 'class your_class has no member named 'msgpack_unpack',
|
||||
// check the following:
|
||||
@ -197,25 +197,25 @@ struct packer_serializer {
|
||||
|
||||
// serialize operator
|
||||
template <typename Stream, typename T>
|
||||
inline packer<Stream>& operator<< (packer<Stream>& o, const T& v)
|
||||
inline msgpack::packer<Stream>& operator<< (packer<Stream>& o, const T& v)
|
||||
{
|
||||
return detail::packer_serializer<Stream, T>::pack(o, v);
|
||||
}
|
||||
|
||||
inline void operator<< (object::with_zone& o, const object& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const msgpack::object& v)
|
||||
{
|
||||
o.type = v.type;
|
||||
|
||||
switch(v.type) {
|
||||
case type::NIL:
|
||||
case type::BOOLEAN:
|
||||
case type::POSITIVE_INTEGER:
|
||||
case type::NEGATIVE_INTEGER:
|
||||
case type::FLOAT:
|
||||
case msgpack::type::NIL:
|
||||
case msgpack::type::BOOLEAN:
|
||||
case msgpack::type::POSITIVE_INTEGER:
|
||||
case msgpack::type::NEGATIVE_INTEGER:
|
||||
case msgpack::type::FLOAT:
|
||||
::memcpy(&o.via, &v.via, sizeof(v.via));
|
||||
return;
|
||||
|
||||
case type::STR: {
|
||||
case msgpack::type::STR: {
|
||||
char* ptr = static_cast<char*>(o.zone.allocate_align(v.via.str.size));
|
||||
o.via.str.ptr = ptr;
|
||||
o.via.str.size = v.via.str.size;
|
||||
@ -223,7 +223,7 @@ inline void operator<< (object::with_zone& o, const object& v)
|
||||
return;
|
||||
}
|
||||
|
||||
case type::BIN: {
|
||||
case msgpack::type::BIN: {
|
||||
char* ptr = static_cast<char*>(o.zone.allocate_align(v.via.bin.size));
|
||||
o.via.bin.ptr = ptr;
|
||||
o.via.bin.size = v.via.bin.size;
|
||||
@ -231,7 +231,7 @@ inline void operator<< (object::with_zone& o, const object& v)
|
||||
return;
|
||||
}
|
||||
|
||||
case type::EXT: {
|
||||
case msgpack::type::EXT: {
|
||||
char* ptr = static_cast<char*>(o.zone.allocate_align(v.via.ext.size + 1));
|
||||
o.via.ext.ptr = ptr;
|
||||
o.via.ext.size = v.via.ext.size;
|
||||
@ -239,47 +239,47 @@ inline void operator<< (object::with_zone& o, const object& v)
|
||||
return;
|
||||
}
|
||||
|
||||
case type::ARRAY:
|
||||
case msgpack::type::ARRAY:
|
||||
o.via.array.ptr = static_cast<object*>(o.zone.allocate_align(sizeof(object) * v.via.array.size));
|
||||
o.via.array.size = v.via.array.size;
|
||||
for (object
|
||||
for (msgpack::object
|
||||
* po(o.via.array.ptr),
|
||||
* pv(v.via.array.ptr),
|
||||
* const pvend(v.via.array.ptr + v.via.array.size);
|
||||
pv < pvend;
|
||||
++po, ++pv) {
|
||||
new (po) object(*pv, o.zone);
|
||||
new (po) msgpack::object(*pv, o.zone);
|
||||
}
|
||||
return;
|
||||
|
||||
case type::MAP:
|
||||
case msgpack::type::MAP:
|
||||
o.via.map.ptr = (object_kv*)o.zone.allocate_align(sizeof(object_kv) * v.via.map.size);
|
||||
o.via.map.size = v.via.map.size;
|
||||
for(object_kv
|
||||
for(msgpack::object_kv
|
||||
* po(o.via.map.ptr),
|
||||
* pv(v.via.map.ptr),
|
||||
* const pvend(v.via.map.ptr + v.via.map.size);
|
||||
pv < pvend;
|
||||
++po, ++pv) {
|
||||
object_kv* kv = new (po) object_kv;
|
||||
new (&kv->key) object(pv->key, o.zone);
|
||||
new (&kv->val) object(pv->val, o.zone);
|
||||
new (&kv->key) msgpack::object(pv->key, o.zone);
|
||||
new (&kv->val) msgpack::object(pv->val, o.zone);
|
||||
}
|
||||
return;
|
||||
|
||||
default:
|
||||
throw type_error();
|
||||
throw msgpack::type_error();
|
||||
}
|
||||
}
|
||||
|
||||
inline void operator<< (object::with_zone& o, const object::with_zone& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const msgpack::object::with_zone& v)
|
||||
{
|
||||
return o << static_cast<object const&>(v);
|
||||
return o << static_cast<msgpack::object const&>(v);
|
||||
}
|
||||
|
||||
// deconvert operator
|
||||
template <typename T>
|
||||
inline void operator<< (object::with_zone& o, const T& v)
|
||||
inline void operator<< (msgpack::object::with_zone& o, const T& v)
|
||||
{
|
||||
// If you get a error 'const class your_class has no member named 'msgpack_object',
|
||||
// check the following:
|
||||
@ -319,53 +319,53 @@ inline void operator<< (object::with_zone& o, const T& v)
|
||||
|
||||
template <typename Stream>
|
||||
template <typename T>
|
||||
inline packer<Stream>& packer<Stream>::pack(const T& v)
|
||||
inline msgpack::packer<Stream>& packer<Stream>::pack(const T& v)
|
||||
{
|
||||
msgpack::operator<<(*this, v);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline bool operator==(const object& x, const object& y)
|
||||
inline bool operator==(const msgpack::object& x, const msgpack::object& y)
|
||||
{
|
||||
if(x.type != y.type) { return false; }
|
||||
|
||||
switch(x.type) {
|
||||
case type::NIL:
|
||||
case msgpack::type::NIL:
|
||||
return true;
|
||||
|
||||
case type::BOOLEAN:
|
||||
case msgpack::type::BOOLEAN:
|
||||
return x.via.boolean == y.via.boolean;
|
||||
|
||||
case type::POSITIVE_INTEGER:
|
||||
case msgpack::type::POSITIVE_INTEGER:
|
||||
return x.via.u64 == y.via.u64;
|
||||
|
||||
case type::NEGATIVE_INTEGER:
|
||||
case msgpack::type::NEGATIVE_INTEGER:
|
||||
return x.via.i64 == y.via.i64;
|
||||
|
||||
case type::FLOAT:
|
||||
case msgpack::type::FLOAT:
|
||||
return x.via.f64 == y.via.f64;
|
||||
|
||||
case type::STR:
|
||||
case msgpack::type::STR:
|
||||
return x.via.str.size == y.via.str.size &&
|
||||
memcmp(x.via.str.ptr, y.via.str.ptr, x.via.str.size) == 0;
|
||||
|
||||
case type::BIN:
|
||||
case msgpack::type::BIN:
|
||||
return x.via.bin.size == y.via.bin.size &&
|
||||
memcmp(x.via.bin.ptr, y.via.bin.ptr, x.via.bin.size) == 0;
|
||||
|
||||
case type::EXT:
|
||||
case msgpack::type::EXT:
|
||||
return x.via.ext.size == y.via.ext.size &&
|
||||
memcmp(x.via.ext.ptr, y.via.ext.ptr, x.via.ext.size) == 0;
|
||||
|
||||
case type::ARRAY:
|
||||
case msgpack::type::ARRAY:
|
||||
if(x.via.array.size != y.via.array.size) {
|
||||
return false;
|
||||
} else if(x.via.array.size == 0) {
|
||||
return true;
|
||||
} else {
|
||||
object* px = x.via.array.ptr;
|
||||
object* const pxend = x.via.array.ptr + x.via.array.size;
|
||||
object* py = y.via.array.ptr;
|
||||
msgpack::object* px = x.via.array.ptr;
|
||||
msgpack::object* const pxend = x.via.array.ptr + x.via.array.size;
|
||||
msgpack::object* py = y.via.array.ptr;
|
||||
do {
|
||||
if(!(*px == *py)) {
|
||||
return false;
|
||||
@ -376,15 +376,15 @@ inline bool operator==(const object& x, const object& y)
|
||||
return true;
|
||||
}
|
||||
|
||||
case type::MAP:
|
||||
case msgpack::type::MAP:
|
||||
if(x.via.map.size != y.via.map.size) {
|
||||
return false;
|
||||
} else if(x.via.map.size == 0) {
|
||||
return true;
|
||||
} else {
|
||||
object_kv* px = x.via.map.ptr;
|
||||
object_kv* const pxend = x.via.map.ptr + x.via.map.size;
|
||||
object_kv* py = y.via.map.ptr;
|
||||
msgpack::object_kv* px = x.via.map.ptr;
|
||||
msgpack::object_kv* const pxend = x.via.map.ptr + x.via.map.size;
|
||||
msgpack::object_kv* py = y.via.map.ptr;
|
||||
do {
|
||||
if(!(px->key == py->key) || !(px->val == py->val)) {
|
||||
return false;
|
||||
@ -401,32 +401,32 @@ inline bool operator==(const object& x, const object& y)
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline bool operator==(const object& x, const T& y)
|
||||
inline bool operator==(const msgpack::object& x, const T& y)
|
||||
try {
|
||||
return x == object(y);
|
||||
return x == msgpack::object(y);
|
||||
} catch (msgpack::type_error&) {
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool operator!=(const object& x, const object& y)
|
||||
inline bool operator!=(const msgpack::object& x, const msgpack::object& y)
|
||||
{ return !(x == y); }
|
||||
|
||||
template <typename T>
|
||||
inline bool operator==(const T& y, const object x)
|
||||
inline bool operator==(const T& y, const msgpack::object x)
|
||||
{ return x == y; }
|
||||
|
||||
template <typename T>
|
||||
inline bool operator!=(const object& x, const T& y)
|
||||
inline bool operator!=(const msgpack::object& x, const T& y)
|
||||
{ return !(x == y); }
|
||||
|
||||
template <typename T>
|
||||
inline bool operator!=(const T& y, const object& x)
|
||||
inline bool operator!=(const T& y, const msgpack::object& x)
|
||||
{ return x != y; }
|
||||
|
||||
|
||||
inline object::implicit_type object::convert() const
|
||||
inline msgpack::object::implicit_type object::convert() const
|
||||
{
|
||||
return implicit_type(*this);
|
||||
return msgpack::object::implicit_type(*this);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@ -452,7 +452,7 @@ inline T object::as() const
|
||||
|
||||
inline object::object()
|
||||
{
|
||||
type = type::NIL;
|
||||
type = msgpack::type::NIL;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@ -505,7 +505,7 @@ inline object& object::operator=(const T& v)
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
object::object(const T& v, zone& z)
|
||||
object::object(const T& v, msgpack::zone& z)
|
||||
{
|
||||
with_zone oz(z);
|
||||
msgpack::operator<<(oz, v);
|
||||
@ -514,7 +514,7 @@ object::object(const T& v, zone& z)
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
object::object(const T& v, zone* z)
|
||||
object::object(const T& v, msgpack::zone* z)
|
||||
{
|
||||
with_zone oz(*z);
|
||||
msgpack::operator<<(oz, v);
|
||||
@ -529,7 +529,7 @@ inline object::object(msgpack_object o)
|
||||
::memcpy(this, &o, sizeof(o));
|
||||
}
|
||||
|
||||
inline void operator<< (object& o, msgpack_object v)
|
||||
inline void operator<< (msgpack::object& o, msgpack_object v)
|
||||
{
|
||||
// FIXME beter way?
|
||||
::memcpy(&o, &v, sizeof(v));
|
||||
@ -546,35 +546,35 @@ inline object::operator msgpack_object() const
|
||||
|
||||
// obsolete
|
||||
template <typename T>
|
||||
inline void convert(T& v, object const& o)
|
||||
inline void convert(T& v, msgpack::object const& o)
|
||||
{
|
||||
o.convert(v);
|
||||
}
|
||||
|
||||
// obsolete
|
||||
template <typename Stream, typename T>
|
||||
inline void pack(packer<Stream>& o, const T& v)
|
||||
inline void pack(msgpack::packer<Stream>& o, const T& v)
|
||||
{
|
||||
o.pack(v);
|
||||
}
|
||||
|
||||
// obsolete
|
||||
template <typename Stream, typename T>
|
||||
inline void pack_copy(packer<Stream>& o, T v)
|
||||
inline void pack_copy(msgpack::packer<Stream>& o, T v)
|
||||
{
|
||||
pack(o, v);
|
||||
}
|
||||
|
||||
|
||||
template <typename Stream>
|
||||
inline packer<Stream>& operator<< (packer<Stream>& o, const object& v)
|
||||
inline msgpack::packer<Stream>& operator<< (msgpack::packer<Stream>& o, const msgpack::object& v)
|
||||
{
|
||||
switch(v.type) {
|
||||
case type::NIL:
|
||||
case msgpack::type::NIL:
|
||||
o.pack_nil();
|
||||
return o;
|
||||
|
||||
case type::BOOLEAN:
|
||||
case msgpack::type::BOOLEAN:
|
||||
if(v.via.boolean) {
|
||||
o.pack_true();
|
||||
} else {
|
||||
@ -582,45 +582,45 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const object& v)
|
||||
}
|
||||
return o;
|
||||
|
||||
case type::POSITIVE_INTEGER:
|
||||
case msgpack::type::POSITIVE_INTEGER:
|
||||
o.pack_uint64(v.via.u64);
|
||||
return o;
|
||||
|
||||
case type::NEGATIVE_INTEGER:
|
||||
case msgpack::type::NEGATIVE_INTEGER:
|
||||
o.pack_int64(v.via.i64);
|
||||
return o;
|
||||
|
||||
case type::FLOAT:
|
||||
case msgpack::type::FLOAT:
|
||||
o.pack_double(v.via.f64);
|
||||
return o;
|
||||
|
||||
case type::STR:
|
||||
case msgpack::type::STR:
|
||||
o.pack_str(v.via.str.size);
|
||||
o.pack_str_body(v.via.str.ptr, v.via.str.size);
|
||||
return o;
|
||||
|
||||
case type::BIN:
|
||||
case msgpack::type::BIN:
|
||||
o.pack_bin(v.via.bin.size);
|
||||
o.pack_bin_body(v.via.bin.ptr, v.via.bin.size);
|
||||
return o;
|
||||
|
||||
case type::EXT:
|
||||
case msgpack::type::EXT:
|
||||
o.pack_ext(v.via.ext.size, v.via.ext.type());
|
||||
o.pack_ext_body(v.via.ext.data(), v.via.ext.size);
|
||||
return o;
|
||||
|
||||
case type::ARRAY:
|
||||
case msgpack::type::ARRAY:
|
||||
o.pack_array(v.via.array.size);
|
||||
for(object* p(v.via.array.ptr),
|
||||
for(msgpack::object* p(v.via.array.ptr),
|
||||
* const pend(v.via.array.ptr + v.via.array.size);
|
||||
p < pend; ++p) {
|
||||
msgpack::operator<<(o, *p);
|
||||
}
|
||||
return o;
|
||||
|
||||
case type::MAP:
|
||||
case msgpack::type::MAP:
|
||||
o.pack_map(v.via.map.size);
|
||||
for(object_kv* p(v.via.map.ptr),
|
||||
for(msgpack::object_kv* p(v.via.map.ptr),
|
||||
* const pend(v.via.map.ptr + v.via.map.size);
|
||||
p < pend; ++p) {
|
||||
msgpack::operator<<(o, p->key);
|
||||
@ -634,53 +634,53 @@ inline packer<Stream>& operator<< (packer<Stream>& o, const object& v)
|
||||
}
|
||||
|
||||
template <typename Stream>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const object::with_zone& v)
|
||||
msgpack::packer<Stream>& operator<< (msgpack::packer<Stream>& o, const msgpack::object::with_zone& v)
|
||||
{
|
||||
return o << static_cast<object>(v);
|
||||
return o << static_cast<msgpack::object>(v);
|
||||
}
|
||||
|
||||
inline std::ostream& operator<< (std::ostream& s, const object& o)
|
||||
inline std::ostream& operator<< (std::ostream& s, const msgpack::object& o)
|
||||
{
|
||||
switch(o.type) {
|
||||
case type::NIL:
|
||||
case msgpack::type::NIL:
|
||||
s << "nil";
|
||||
break;
|
||||
|
||||
case type::BOOLEAN:
|
||||
case msgpack::type::BOOLEAN:
|
||||
s << (o.via.boolean ? "true" : "false");
|
||||
break;
|
||||
|
||||
case type::POSITIVE_INTEGER:
|
||||
case msgpack::type::POSITIVE_INTEGER:
|
||||
s << o.via.u64;
|
||||
break;
|
||||
|
||||
case type::NEGATIVE_INTEGER:
|
||||
case msgpack::type::NEGATIVE_INTEGER:
|
||||
s << o.via.i64;
|
||||
break;
|
||||
|
||||
case type::FLOAT:
|
||||
case msgpack::type::FLOAT:
|
||||
s << o.via.f64;
|
||||
break;
|
||||
|
||||
case type::STR:
|
||||
case msgpack::type::STR:
|
||||
(s << '"').write(o.via.str.ptr, o.via.str.size) << '"';
|
||||
break;
|
||||
|
||||
case type::BIN:
|
||||
case msgpack::type::BIN:
|
||||
(s << '"').write(o.via.bin.ptr, o.via.bin.size) << '"';
|
||||
break;
|
||||
|
||||
case type::EXT:
|
||||
case msgpack::type::EXT:
|
||||
s << "EXT";
|
||||
break;
|
||||
|
||||
case type::ARRAY:
|
||||
case msgpack::type::ARRAY:
|
||||
s << "[";
|
||||
if(o.via.array.size != 0) {
|
||||
object* p(o.via.array.ptr);
|
||||
msgpack::object* p(o.via.array.ptr);
|
||||
s << *p;
|
||||
++p;
|
||||
for(object* const pend(o.via.array.ptr + o.via.array.size);
|
||||
for(msgpack::object* const pend(o.via.array.ptr + o.via.array.size);
|
||||
p < pend; ++p) {
|
||||
s << ", " << *p;
|
||||
}
|
||||
@ -688,13 +688,13 @@ inline std::ostream& operator<< (std::ostream& s, const object& o)
|
||||
s << "]";
|
||||
break;
|
||||
|
||||
case type::MAP:
|
||||
case msgpack::type::MAP:
|
||||
s << "{";
|
||||
if(o.via.map.size != 0) {
|
||||
object_kv* p(o.via.map.ptr);
|
||||
msgpack::object_kv* p(o.via.map.ptr);
|
||||
s << p->key << "=>" << p->val;
|
||||
++p;
|
||||
for(object_kv* const pend(o.via.map.ptr + o.via.map.size);
|
||||
for(msgpack::object_kv* const pend(o.via.map.ptr + o.via.map.size);
|
||||
p < pend; ++p) {
|
||||
s << ", " << p->key << "=>" << p->val;
|
||||
}
|
||||
|
@ -54,12 +54,12 @@ struct object_kv;
|
||||
|
||||
struct object_array {
|
||||
uint32_t size;
|
||||
object* ptr;
|
||||
msgpack::object* ptr;
|
||||
};
|
||||
|
||||
struct object_map {
|
||||
uint32_t size;
|
||||
object_kv* ptr;
|
||||
msgpack::object_kv* ptr;
|
||||
};
|
||||
|
||||
struct object_str {
|
||||
@ -88,17 +88,17 @@ struct object {
|
||||
double dec; // obsolete
|
||||
#endif // MSGPACK_USE_LEGACY_NAME_AS_FLOAT
|
||||
double f64;
|
||||
object_array array;
|
||||
object_map map;
|
||||
object_str str;
|
||||
object_bin bin;
|
||||
object_ext ext;
|
||||
msgpack::object_array array;
|
||||
msgpack::object_map map;
|
||||
msgpack::object_str str;
|
||||
msgpack::object_bin bin;
|
||||
msgpack::object_ext ext;
|
||||
};
|
||||
|
||||
type::object_type type;
|
||||
msgpack::type::object_type type;
|
||||
union_type via;
|
||||
|
||||
bool is_nil() const { return type == type::NIL; }
|
||||
bool is_nil() const { return type == msgpack::type::NIL; }
|
||||
|
||||
template <typename T>
|
||||
T as() const;
|
||||
@ -116,11 +116,11 @@ struct object {
|
||||
explicit object(const T& v);
|
||||
|
||||
template <typename T>
|
||||
object(const T& v, zone& z);
|
||||
object(const T& v, msgpack::zone& z);
|
||||
|
||||
// obsolete
|
||||
template <typename T>
|
||||
object(const T& v, zone* z);
|
||||
object(const T& v, msgpack::zone* z);
|
||||
|
||||
template <typename T>
|
||||
object& operator=(const T& v);
|
||||
@ -139,8 +139,8 @@ public:
|
||||
class type_error : public std::bad_cast { };
|
||||
|
||||
struct object_kv {
|
||||
object key;
|
||||
object val;
|
||||
msgpack::object key;
|
||||
msgpack::object val;
|
||||
};
|
||||
|
||||
namespace detail {
|
||||
@ -148,32 +148,32 @@ template <typename Stream, typename T>
|
||||
struct packer_serializer;
|
||||
} // namespace detail
|
||||
|
||||
object const& operator>> (object const& o, object& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, msgpack::object& v);
|
||||
|
||||
template <typename T>
|
||||
object const& operator>> (object const& o, T& v);
|
||||
msgpack::object const& operator>> (msgpack::object const& o, T& v);
|
||||
|
||||
template <typename T>
|
||||
void operator<< (object::with_zone& o, const T& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const T& v);
|
||||
|
||||
void operator<< (object::with_zone& o, const object& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const msgpack::object& v);
|
||||
|
||||
void operator<< (object::with_zone& o, const object::with_zone& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const msgpack::object::with_zone& v);
|
||||
|
||||
template <typename Stream>
|
||||
class packer;
|
||||
|
||||
template <typename Stream>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const object& v);
|
||||
msgpack::packer<Stream>& operator<< (msgpack::packer<Stream>& o, const msgpack::object& v);
|
||||
|
||||
template <typename Stream>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const object::with_zone& v);
|
||||
msgpack::packer<Stream>& operator<< (msgpack::packer<Stream>& o, const msgpack::object::with_zone& v);
|
||||
|
||||
template <typename Stream, typename T>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const T& v);
|
||||
msgpack::packer<Stream>& operator<< (msgpack::packer<Stream>& o, const T& v);
|
||||
|
||||
template <typename T>
|
||||
void operator<< (object::with_zone& o, const T& v);
|
||||
void operator<< (msgpack::object::with_zone& o, const T& v);
|
||||
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
|
||||
|
@ -61,7 +61,7 @@ namespace msgpack {
|
||||
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
typedef bool (*unpack_reference_func)(type::object_type, std::size_t, void*);
|
||||
typedef bool (*unpack_reference_func)(msgpack::type::object_type, std::size_t, void*);
|
||||
|
||||
struct unpack_error : public std::runtime_error {
|
||||
explicit unpack_error(const std::string& msg)
|
||||
@ -197,81 +197,81 @@ private:
|
||||
unpack_limit m_limit;
|
||||
};
|
||||
|
||||
inline void unpack_uint8(uint8_t d, object& o)
|
||||
{ o.type = type::POSITIVE_INTEGER; o.via.u64 = d; }
|
||||
inline void unpack_uint8(uint8_t d, msgpack::object& o)
|
||||
{ o.type = msgpack::type::POSITIVE_INTEGER; o.via.u64 = d; }
|
||||
|
||||
inline void unpack_uint16(uint16_t d, object& o)
|
||||
{ o.type = type::POSITIVE_INTEGER; o.via.u64 = d; }
|
||||
inline void unpack_uint16(uint16_t d, msgpack::object& o)
|
||||
{ o.type = msgpack::type::POSITIVE_INTEGER; o.via.u64 = d; }
|
||||
|
||||
inline void unpack_uint32(uint32_t d, object& o)
|
||||
{ o.type = type::POSITIVE_INTEGER; o.via.u64 = d; }
|
||||
inline void unpack_uint32(uint32_t d, msgpack::object& o)
|
||||
{ o.type = msgpack::type::POSITIVE_INTEGER; o.via.u64 = d; }
|
||||
|
||||
inline void unpack_uint64(uint64_t d, object& o)
|
||||
{ o.type = type::POSITIVE_INTEGER; o.via.u64 = d; }
|
||||
inline void unpack_uint64(uint64_t d, msgpack::object& o)
|
||||
{ o.type = msgpack::type::POSITIVE_INTEGER; o.via.u64 = d; }
|
||||
|
||||
inline void unpack_int8(int8_t d, object& o)
|
||||
{ if(d >= 0) { o.type = type::POSITIVE_INTEGER; o.via.u64 = d; }
|
||||
else { o.type = type::NEGATIVE_INTEGER; o.via.i64 = d; } }
|
||||
inline void unpack_int8(int8_t d, msgpack::object& o)
|
||||
{ if(d >= 0) { o.type = msgpack::type::POSITIVE_INTEGER; o.via.u64 = d; }
|
||||
else { o.type = msgpack::type::NEGATIVE_INTEGER; o.via.i64 = d; } }
|
||||
|
||||
inline void unpack_int16(int16_t d, object& o)
|
||||
{ if(d >= 0) { o.type = type::POSITIVE_INTEGER; o.via.u64 = d; }
|
||||
else { o.type = type::NEGATIVE_INTEGER; o.via.i64 = d; } }
|
||||
inline void unpack_int16(int16_t d, msgpack::object& o)
|
||||
{ if(d >= 0) { o.type = msgpack::type::POSITIVE_INTEGER; o.via.u64 = d; }
|
||||
else { o.type = msgpack::type::NEGATIVE_INTEGER; o.via.i64 = d; } }
|
||||
|
||||
inline void unpack_int32(int32_t d, object& o)
|
||||
{ if(d >= 0) { o.type = type::POSITIVE_INTEGER; o.via.u64 = d; }
|
||||
else { o.type = type::NEGATIVE_INTEGER; o.via.i64 = d; } }
|
||||
inline void unpack_int32(int32_t d, msgpack::object& o)
|
||||
{ if(d >= 0) { o.type = msgpack::type::POSITIVE_INTEGER; o.via.u64 = d; }
|
||||
else { o.type = msgpack::type::NEGATIVE_INTEGER; o.via.i64 = d; } }
|
||||
|
||||
inline void unpack_int64(int64_t d, object& o)
|
||||
{ if(d >= 0) { o.type = type::POSITIVE_INTEGER; o.via.u64 = d; }
|
||||
else { o.type = type::NEGATIVE_INTEGER; o.via.i64 = d; } }
|
||||
inline void unpack_int64(int64_t d, msgpack::object& o)
|
||||
{ if(d >= 0) { o.type = msgpack::type::POSITIVE_INTEGER; o.via.u64 = d; }
|
||||
else { o.type = msgpack::type::NEGATIVE_INTEGER; o.via.i64 = d; } }
|
||||
|
||||
inline void unpack_float(float d, object& o)
|
||||
{ o.type = type::FLOAT; o.via.f64 = d; }
|
||||
inline void unpack_float(float d, msgpack::object& o)
|
||||
{ o.type = msgpack::type::FLOAT; o.via.f64 = d; }
|
||||
|
||||
inline void unpack_double(double d, object& o)
|
||||
{ o.type = type::FLOAT; o.via.f64 = d; }
|
||||
inline void unpack_double(double d, msgpack::object& o)
|
||||
{ o.type = msgpack::type::FLOAT; o.via.f64 = d; }
|
||||
|
||||
inline void unpack_nil(object& o)
|
||||
{ o.type = type::NIL; }
|
||||
inline void unpack_nil(msgpack::object& o)
|
||||
{ o.type = msgpack::type::NIL; }
|
||||
|
||||
inline void unpack_true(object& o)
|
||||
{ o.type = type::BOOLEAN; o.via.boolean = true; }
|
||||
inline void unpack_true(msgpack::object& o)
|
||||
{ o.type = msgpack::type::BOOLEAN; o.via.boolean = true; }
|
||||
|
||||
inline void unpack_false(object& o)
|
||||
{ o.type = type::BOOLEAN; o.via.boolean = false; }
|
||||
inline void unpack_false(msgpack::object& o)
|
||||
{ o.type = msgpack::type::BOOLEAN; o.via.boolean = false; }
|
||||
|
||||
struct unpack_array {
|
||||
void operator()(unpack_user& u, uint32_t n, object& o) const {
|
||||
void operator()(unpack_user& u, uint32_t n, msgpack::object& o) const {
|
||||
if (n > u.limit().array()) throw array_size_overflow("array size overflow");
|
||||
o.type = type::ARRAY;
|
||||
o.type = msgpack::type::ARRAY;
|
||||
o.via.array.size = 0;
|
||||
o.via.array.ptr = static_cast<object*>(u.zone().allocate_align(n*sizeof(object)));
|
||||
o.via.array.ptr = static_cast<msgpack::object*>(u.zone().allocate_align(n*sizeof(msgpack::object)));
|
||||
}
|
||||
};
|
||||
|
||||
inline void unpack_array_item(object& c, object const& o)
|
||||
inline void unpack_array_item(msgpack::object& c, msgpack::object const& o)
|
||||
{
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
std::memcpy(&c.via.array.ptr[c.via.array.size++], &o, sizeof(object));
|
||||
std::memcpy(&c.via.array.ptr[c.via.array.size++], &o, sizeof(msgpack::object));
|
||||
#else /* __GNUC__ && !__clang__ */
|
||||
c.via.array.ptr[c.via.array.size++] = o;
|
||||
#endif /* __GNUC__ && !__clang__ */
|
||||
}
|
||||
|
||||
struct unpack_map {
|
||||
void operator()(unpack_user& u, uint32_t n, object& o) const {
|
||||
void operator()(unpack_user& u, uint32_t n, msgpack::object& o) const {
|
||||
if (n > u.limit().map()) throw map_size_overflow("map size overflow");
|
||||
o.type = type::MAP;
|
||||
o.type = msgpack::type::MAP;
|
||||
o.via.map.size = 0;
|
||||
o.via.map.ptr = static_cast<object_kv*>(u.zone().allocate_align(n*sizeof(object_kv)));
|
||||
o.via.map.ptr = static_cast<msgpack::object_kv*>(u.zone().allocate_align(n*sizeof(msgpack::object_kv)));
|
||||
}
|
||||
};
|
||||
|
||||
inline void unpack_map_item(object& c, object const& k, object const& v)
|
||||
inline void unpack_map_item(msgpack::object& c, msgpack::object const& k, msgpack::object const& v)
|
||||
{
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
std::memcpy(&c.via.map.ptr[c.via.map.size].key, &k, sizeof(object));
|
||||
std::memcpy(&c.via.map.ptr[c.via.map.size].val, &v, sizeof(object));
|
||||
std::memcpy(&c.via.map.ptr[c.via.map.size].key, &k, sizeof(msgpack::object));
|
||||
std::memcpy(&c.via.map.ptr[c.via.map.size].val, &v, sizeof(msgpack::object));
|
||||
#else /* __GNUC__ && !__clang__ */
|
||||
c.via.map.ptr[c.via.map.size].key = k;
|
||||
c.via.map.ptr[c.via.map.size].val = v;
|
||||
@ -279,9 +279,9 @@ inline void unpack_map_item(object& c, object const& k, object const& v)
|
||||
++c.via.map.size;
|
||||
}
|
||||
|
||||
inline void unpack_str(unpack_user& u, const char* p, uint32_t l, object& o)
|
||||
inline void unpack_str(unpack_user& u, const char* p, uint32_t l, msgpack::object& o)
|
||||
{
|
||||
o.type = type::STR;
|
||||
o.type = msgpack::type::STR;
|
||||
if (u.reference_func() && u.reference_func()(o.type, l, u.user_data())) {
|
||||
o.via.str.ptr = p;
|
||||
u.set_referenced(true);
|
||||
@ -295,9 +295,9 @@ inline void unpack_str(unpack_user& u, const char* p, uint32_t l, object& o)
|
||||
o.via.str.size = l;
|
||||
}
|
||||
|
||||
inline void unpack_bin(unpack_user& u, const char* p, uint32_t l, object& o)
|
||||
inline void unpack_bin(unpack_user& u, const char* p, uint32_t l, msgpack::object& o)
|
||||
{
|
||||
o.type = type::BIN;
|
||||
o.type = msgpack::type::BIN;
|
||||
if (u.reference_func() && u.reference_func()(o.type, l, u.user_data())) {
|
||||
o.via.bin.ptr = p;
|
||||
u.set_referenced(true);
|
||||
@ -311,9 +311,9 @@ inline void unpack_bin(unpack_user& u, const char* p, uint32_t l, object& o)
|
||||
o.via.bin.size = l;
|
||||
}
|
||||
|
||||
inline void unpack_ext(unpack_user& u, const char* p, std::size_t l, object& o)
|
||||
inline void unpack_ext(unpack_user& u, const char* p, std::size_t l, msgpack::object& o)
|
||||
{
|
||||
o.type = type::EXT;
|
||||
o.type = msgpack::type::EXT;
|
||||
if (u.reference_func() && u.reference_func()(o.type, l, u.user_data())) {
|
||||
o.via.ext.ptr = p;
|
||||
u.set_referenced(true);
|
||||
@ -330,21 +330,21 @@ inline void unpack_ext(unpack_user& u, const char* p, std::size_t l, object& o)
|
||||
|
||||
class unpack_stack {
|
||||
public:
|
||||
object const& obj() const { return m_obj; }
|
||||
object& obj() { return m_obj; }
|
||||
void set_obj(object const& obj) { m_obj = obj; }
|
||||
msgpack::object const& obj() const { return m_obj; }
|
||||
msgpack::object& obj() { return m_obj; }
|
||||
void set_obj(msgpack::object const& obj) { m_obj = obj; }
|
||||
std::size_t count() const { return m_count; }
|
||||
void set_count(std::size_t count) { m_count = count; }
|
||||
std::size_t decl_count() { return --m_count; }
|
||||
uint32_t container_type() const { return m_container_type; }
|
||||
void set_container_type(uint32_t container_type) { m_container_type = container_type; }
|
||||
object const& map_key() const { return m_map_key; }
|
||||
void set_map_key(object const& map_key) { m_map_key = map_key; }
|
||||
msgpack::object const& map_key() const { return m_map_key; }
|
||||
void set_map_key(msgpack::object const& map_key) { m_map_key = map_key; }
|
||||
private:
|
||||
object m_obj;
|
||||
msgpack::object m_obj;
|
||||
std::size_t m_count;
|
||||
uint32_t m_container_type;
|
||||
object m_map_key;
|
||||
msgpack::object m_map_key;
|
||||
};
|
||||
|
||||
inline void init_count(void* buffer)
|
||||
@ -412,7 +412,7 @@ public:
|
||||
context(unpack_reference_func f, void* user_data, unpack_limit const& limit)
|
||||
:m_trail(0), m_user(f, user_data, limit), m_cs(CS_HEADER), m_top(0)
|
||||
{
|
||||
m_stack[0].set_obj(object());
|
||||
m_stack[0].set_obj(msgpack::object());
|
||||
}
|
||||
|
||||
void init()
|
||||
@ -420,10 +420,10 @@ public:
|
||||
m_cs = CS_HEADER;
|
||||
m_trail = 0;
|
||||
m_top = 0;
|
||||
m_stack[0].set_obj(object());
|
||||
m_stack[0].set_obj(msgpack::object());
|
||||
}
|
||||
|
||||
object const& data() const
|
||||
msgpack::object const& data() const
|
||||
{
|
||||
return m_stack[0].obj();
|
||||
}
|
||||
@ -451,7 +451,7 @@ private:
|
||||
int push_aggregate(
|
||||
Func const& f,
|
||||
uint32_t container_type,
|
||||
object& obj,
|
||||
msgpack::object& obj,
|
||||
const char* load_pos,
|
||||
std::size_t& off) {
|
||||
if(m_top < MSGPACK_EMBED_STACK_SIZE /* FIXME */) {
|
||||
@ -478,7 +478,7 @@ private:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int push_item(object& obj) {
|
||||
int push_item(msgpack::object& obj) {
|
||||
bool finish = false;
|
||||
while (!finish) {
|
||||
if(m_top == 0) {
|
||||
@ -522,7 +522,7 @@ private:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int push_proc(object& obj, std::size_t& off) {
|
||||
int push_proc(msgpack::object& obj, std::size_t& off) {
|
||||
int ret = push_item(obj);
|
||||
if (ret > 0) {
|
||||
m_stack[0].set_obj(obj);
|
||||
@ -571,7 +571,7 @@ inline int context::execute(const char* data, std::size_t len, std::size_t& off)
|
||||
const char* const pe = data + len;
|
||||
const char* n = nullptr;
|
||||
|
||||
object obj;
|
||||
msgpack::object obj;
|
||||
|
||||
if(m_current == pe) {
|
||||
off = m_current - m_start;
|
||||
@ -958,13 +958,13 @@ class unpacked {
|
||||
public:
|
||||
unpacked() {}
|
||||
|
||||
unpacked(object const& obj, msgpack::unique_ptr<msgpack::zone> z) :
|
||||
unpacked(msgpack::object const& obj, msgpack::unique_ptr<msgpack::zone> z) :
|
||||
m_obj(obj), m_zone(msgpack::move(z)) { }
|
||||
|
||||
void set(object const& obj)
|
||||
void set(msgpack::object const& obj)
|
||||
{ m_obj = obj; }
|
||||
|
||||
const object& get() const
|
||||
const msgpack::object& get() const
|
||||
{ return m_obj; }
|
||||
|
||||
msgpack::unique_ptr<msgpack::zone>& zone()
|
||||
@ -974,7 +974,7 @@ public:
|
||||
{ return m_zone; }
|
||||
|
||||
private:
|
||||
object m_obj;
|
||||
msgpack::object m_obj;
|
||||
msgpack::unique_ptr<msgpack::zone> m_zone;
|
||||
};
|
||||
|
||||
@ -1052,10 +1052,10 @@ public:
|
||||
bool execute();
|
||||
|
||||
/*! for backward compatibility */
|
||||
object const& data();
|
||||
msgpack::object const& data();
|
||||
|
||||
/*! for backward compatibility */
|
||||
zone* release_zone();
|
||||
msgpack::zone* release_zone();
|
||||
|
||||
/*! for backward compatibility */
|
||||
void reset_zone();
|
||||
@ -1084,7 +1084,7 @@ private:
|
||||
void expand_buffer(std::size_t size);
|
||||
int execute_imp();
|
||||
bool flush_zone();
|
||||
static bool default_reference_func(type::object_type type, std::size_t len, void*);
|
||||
static bool default_reference_func(msgpack::type::object_type type, std::size_t len, void*);
|
||||
|
||||
private:
|
||||
char* m_buffer;
|
||||
@ -1092,7 +1092,7 @@ private:
|
||||
std::size_t m_free;
|
||||
std::size_t m_off;
|
||||
std::size_t m_parsed;
|
||||
msgpack::unique_ptr<zone> m_z;
|
||||
msgpack::unique_ptr<msgpack::zone> m_z;
|
||||
std::size_t m_initial_buffer_size;
|
||||
detail::context m_ctx;
|
||||
|
||||
@ -1146,23 +1146,23 @@ void unpack(unpacked& result,
|
||||
unpack_reference_func f = nullptr, void* user_data = nullptr,
|
||||
unpack_limit const& limit = unpack_limit());
|
||||
|
||||
object unpack(
|
||||
zone& z,
|
||||
msgpack::object unpack(
|
||||
msgpack::zone& z,
|
||||
const char* data, std::size_t len, std::size_t& off, bool& referenced,
|
||||
unpack_reference_func f = nullptr, void* user_data = nullptr,
|
||||
unpack_limit const& limit = unpack_limit());
|
||||
object unpack(
|
||||
zone& z,
|
||||
msgpack::object unpack(
|
||||
msgpack::zone& z,
|
||||
const char* data, std::size_t len, std::size_t& off,
|
||||
unpack_reference_func f = nullptr, void* user_data = nullptr,
|
||||
unpack_limit const& limit = unpack_limit());
|
||||
object unpack(
|
||||
zone& z,
|
||||
msgpack::object unpack(
|
||||
msgpack::zone& z,
|
||||
const char* data, std::size_t len, bool& referenced,
|
||||
unpack_reference_func f = nullptr, void* user_data = nullptr,
|
||||
unpack_limit const& limit = unpack_limit());
|
||||
object unpack(
|
||||
zone& z,
|
||||
msgpack::object unpack(
|
||||
msgpack::zone& z,
|
||||
const char* data, std::size_t len,
|
||||
unpack_reference_func f = nullptr, void* user_data = nullptr,
|
||||
unpack_limit const& limit = unpack_limit());
|
||||
@ -1187,7 +1187,7 @@ inline unpacker::unpacker(unpack_reference_func f,
|
||||
void* user_data,
|
||||
std::size_t initial_buffer_size,
|
||||
unpack_limit const& limit)
|
||||
:m_z(new zone), m_ctx(f, user_data, limit)
|
||||
:m_z(new msgpack::zone), m_ctx(f, user_data, limit)
|
||||
{
|
||||
if(initial_buffer_size < COUNTER_SIZE) {
|
||||
initial_buffer_size = COUNTER_SIZE;
|
||||
@ -1393,19 +1393,19 @@ inline int unpacker::execute_imp()
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline object const& unpacker::data()
|
||||
inline msgpack::object const& unpacker::data()
|
||||
{
|
||||
return m_ctx.data();
|
||||
}
|
||||
|
||||
inline zone* unpacker::release_zone()
|
||||
inline msgpack::zone* unpacker::release_zone()
|
||||
{
|
||||
if(!flush_zone()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
zone* r = new zone;
|
||||
zone* old = m_z.release();
|
||||
msgpack::zone* r = new msgpack::zone;
|
||||
msgpack::zone* old = m_z.release();
|
||||
m_z.reset(r);
|
||||
m_ctx.user().set_zone(*m_z);
|
||||
|
||||
@ -1474,7 +1474,7 @@ namespace detail {
|
||||
|
||||
inline unpack_return
|
||||
unpack_imp(const char* data, std::size_t len, std::size_t& off,
|
||||
zone& result_zone, object& result, bool& referenced,
|
||||
msgpack::zone& result_zone, msgpack::object& result, bool& referenced,
|
||||
unpack_reference_func f = nullptr, void* user_data = nullptr,
|
||||
unpack_limit const& limit = unpack_limit())
|
||||
{
|
||||
@ -1523,8 +1523,8 @@ inline unpacked 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)
|
||||
{
|
||||
object obj;
|
||||
msgpack::unique_ptr<zone> z(new zone);
|
||||
msgpack::object obj;
|
||||
msgpack::unique_ptr<msgpack::zone> z(new msgpack::zone);
|
||||
referenced = false;
|
||||
unpack_return ret = detail::unpack_imp(
|
||||
data, len, off, *z, obj, referenced, f, user_data, limit);
|
||||
@ -1574,8 +1574,8 @@ inline void unpack(unpacked& result,
|
||||
const char* data, std::size_t len, std::size_t& off, bool& referenced,
|
||||
unpack_reference_func f, void* user_data, unpack_limit const& limit)
|
||||
{
|
||||
object obj;
|
||||
msgpack::unique_ptr<zone> z(new zone);
|
||||
msgpack::object obj;
|
||||
msgpack::unique_ptr<msgpack::zone> z(new msgpack::zone);
|
||||
referenced = false;
|
||||
unpack_return ret = detail::unpack_imp(
|
||||
data, len, off, *z, obj, referenced, f, user_data, limit);
|
||||
@ -1623,12 +1623,12 @@ inline void unpack(unpacked& result,
|
||||
}
|
||||
|
||||
|
||||
inline object unpack(
|
||||
zone& z,
|
||||
inline msgpack::object unpack(
|
||||
msgpack::zone& z,
|
||||
const char* data, std::size_t len, std::size_t& off, bool& referenced,
|
||||
unpack_reference_func f, void* user_data, unpack_limit const& limit)
|
||||
{
|
||||
object obj;
|
||||
msgpack::object obj;
|
||||
referenced = false;
|
||||
unpack_return ret = detail::unpack_imp(
|
||||
data, len, off, z, obj, referenced, f, user_data, limit);
|
||||
@ -1647,8 +1647,8 @@ inline object unpack(
|
||||
return obj;
|
||||
}
|
||||
|
||||
inline object unpack(
|
||||
zone& z,
|
||||
inline msgpack::object unpack(
|
||||
msgpack::zone& z,
|
||||
const char* data, std::size_t len, std::size_t& off,
|
||||
unpack_reference_func f, void* user_data, unpack_limit const& limit)
|
||||
{
|
||||
@ -1656,8 +1656,8 @@ inline object unpack(
|
||||
return unpack(z, data, len, off, referenced, f, user_data, limit);
|
||||
}
|
||||
|
||||
inline object unpack(
|
||||
zone& z,
|
||||
inline msgpack::object unpack(
|
||||
msgpack::zone& z,
|
||||
const char* data, std::size_t len, bool& referenced,
|
||||
unpack_reference_func f, void* user_data, unpack_limit const& limit)
|
||||
{
|
||||
@ -1665,8 +1665,8 @@ inline object unpack(
|
||||
return unpack(z, data, len, off, referenced, f, user_data, limit);
|
||||
}
|
||||
|
||||
inline object unpack(
|
||||
zone& z,
|
||||
inline msgpack::object unpack(
|
||||
msgpack::zone& z,
|
||||
const char* data, std::size_t len,
|
||||
unpack_reference_func f, void* user_data, unpack_limit const& limit)
|
||||
{
|
||||
@ -1689,7 +1689,7 @@ inline void unpack(unpacked* result,
|
||||
else unpack(*result, data, len, f, user_data, limit);
|
||||
}
|
||||
|
||||
inline bool unpacker::default_reference_func(type::object_type /*type*/, std::size_t /*len*/, void*)
|
||||
inline bool unpacker::default_reference_func(msgpack::type::object_type /*type*/, std::size_t /*len*/, void*)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user