mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-22 08:02:08 +02:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a5705183d6 | ||
![]() |
95a6316cc7 | ||
![]() |
be32e3b1fb | ||
![]() |
b4cb5e23c0 |
@@ -1,6 +1,6 @@
|
|||||||
AC_INIT(msgpack/unpack_template.h)
|
AC_INIT(msgpack/unpack_template.h)
|
||||||
AC_CONFIG_AUX_DIR(ac)
|
AC_CONFIG_AUX_DIR(ac)
|
||||||
AM_INIT_AUTOMAKE(msgpack, 0.3.4)
|
AM_INIT_AUTOMAKE(msgpack, 0.3.5)
|
||||||
AC_CONFIG_HEADER(config.h)
|
AC_CONFIG_HEADER(config.h)
|
||||||
|
|
||||||
AC_SUBST(CFLAGS)
|
AC_SUBST(CFLAGS)
|
||||||
|
@@ -39,10 +39,12 @@ msgpack/zone.hpp: msgpack/zone.hpp.erb
|
|||||||
|
|
||||||
MOSTLYCLEANFILES = \
|
MOSTLYCLEANFILES = \
|
||||||
msgpack/type/tuple.hpp \
|
msgpack/type/tuple.hpp \
|
||||||
|
msgpack/type/define.hpp \
|
||||||
msgpack/zone.hpp
|
msgpack/zone.hpp
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
msgpack/type/tuple.hpp.erb \
|
msgpack/type/tuple.hpp.erb \
|
||||||
|
msgpack/type/define.hpp.erb \
|
||||||
msgpack/zone.hpp.erb
|
msgpack/zone.hpp.erb
|
||||||
|
|
||||||
libmsgpack_la_LIBADD = -L../c -lmsgpackc
|
libmsgpack_la_LIBADD = -L../c -lmsgpackc
|
||||||
|
@@ -52,7 +52,6 @@ struct define<> {
|
|||||||
if(o.type != type::ARRAY) { throw type_error(); }
|
if(o.type != type::ARRAY) { throw type_error(); }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
<%0.upto(GENERATION_LIMIT) {|i|%>
|
<%0.upto(GENERATION_LIMIT) {|i|%>
|
||||||
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
|
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
|
||||||
struct define<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> {
|
struct define<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> {
|
||||||
@@ -79,11 +78,10 @@ struct define<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> {
|
|||||||
};
|
};
|
||||||
<%}%>
|
<%}%>
|
||||||
|
|
||||||
define<> make_define()
|
inline define<> make_define()
|
||||||
{
|
{
|
||||||
return define<>();
|
return define<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
<%0.upto(GENERATION_LIMIT) {|i|%>
|
<%0.upto(GENERATION_LIMIT) {|i|%>
|
||||||
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
|
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
|
||||||
define<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_define(A0& a0<%1.upto(i) {|j|%>, A<%=j%>& a<%=j%><%}%>)
|
define<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_define(A0& a0<%1.upto(i) {|j|%>, A<%=j%>& a<%=j%><%}%>)
|
||||||
@@ -92,7 +90,6 @@ define<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_define(A0& a0<%1.upto(i) {|j|%>,
|
|||||||
}
|
}
|
||||||
<%}%>
|
<%}%>
|
||||||
|
|
||||||
|
|
||||||
} // namespace type
|
} // namespace type
|
||||||
} // namespace msgpack
|
} // namespace msgpack
|
||||||
|
|
||||||
|
@@ -64,7 +64,6 @@ struct tuple_type<const T&> {
|
|||||||
typedef const T& transparent_reference;
|
typedef const T& transparent_reference;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
<%0.upto(GENERATION_LIMIT) {|i|%>
|
<%0.upto(GENERATION_LIMIT) {|i|%>
|
||||||
<%0.upto(i) {|j|%>
|
<%0.upto(i) {|j|%>
|
||||||
template <typename A0<%1.upto(i) {|k|%>, typename A<%=k%><%}%>>
|
template <typename A0<%1.upto(i) {|k|%>, typename A<%=k%><%}%>>
|
||||||
@@ -78,7 +77,6 @@ private:
|
|||||||
<%}%>
|
<%}%>
|
||||||
<%}%>
|
<%}%>
|
||||||
|
|
||||||
|
|
||||||
<%0.upto(GENERATION_LIMIT) {|i|%>
|
<%0.upto(GENERATION_LIMIT) {|i|%>
|
||||||
<%0.upto(i) {|j|%>
|
<%0.upto(i) {|j|%>
|
||||||
template <typename A0<%1.upto(i) {|k|%>, typename A<%=k%><%}%>>
|
template <typename A0<%1.upto(i) {|k|%>, typename A<%=k%><%}%>>
|
||||||
@@ -91,16 +89,6 @@ private:
|
|||||||
<%}%>
|
<%}%>
|
||||||
<%}%>
|
<%}%>
|
||||||
|
|
||||||
|
|
||||||
<%0.upto(GENERATION_LIMIT) {|i|%>
|
|
||||||
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
|
|
||||||
tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_tuple(typename tuple_type<A0>::transparent_reference a0<%1.upto(i) {|j|%>, typename tuple_type<A<%=j%>>::transparent_reference a<%=j%><%}%>)
|
|
||||||
{
|
|
||||||
return tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>(a0<%1.upto(i) {|j|%>, a<%=j%><%}%>);
|
|
||||||
}
|
|
||||||
<%}%>
|
|
||||||
|
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct tuple<> {
|
struct tuple<> {
|
||||||
typedef tuple<> value_type;
|
typedef tuple<> value_type;
|
||||||
@@ -122,6 +110,18 @@ struct tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> {
|
|||||||
};
|
};
|
||||||
<%}%>
|
<%}%>
|
||||||
|
|
||||||
|
inline tuple<> make_tuple()
|
||||||
|
{
|
||||||
|
return tuple<>();
|
||||||
|
}
|
||||||
|
<%0.upto(GENERATION_LIMIT) {|i|%>
|
||||||
|
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
|
||||||
|
tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_tuple(typename tuple_type<A0>::transparent_reference a0<%1.upto(i) {|j|%>, typename tuple_type<A<%=j%>>::transparent_reference a<%=j%><%}%>)
|
||||||
|
{
|
||||||
|
return tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>(a0<%1.upto(i) {|j|%>, a<%=j%><%}%>);
|
||||||
|
}
|
||||||
|
<%}%>
|
||||||
|
|
||||||
} // namespace type
|
} // namespace type
|
||||||
|
|
||||||
|
|
||||||
@@ -144,7 +144,6 @@ type::tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>& operator>> (
|
|||||||
}
|
}
|
||||||
<%}%>
|
<%}%>
|
||||||
|
|
||||||
|
|
||||||
template <typename Stream>
|
template <typename Stream>
|
||||||
const packer<Stream>& operator<< (
|
const packer<Stream>& operator<< (
|
||||||
packer<Stream>& o,
|
packer<Stream>& o,
|
||||||
@@ -164,7 +163,6 @@ const packer<Stream>& operator<< (
|
|||||||
}
|
}
|
||||||
<%}%>
|
<%}%>
|
||||||
|
|
||||||
|
|
||||||
} // namespace msgpack
|
} // namespace msgpack
|
||||||
|
|
||||||
#endif /* msgpack/type/tuple.hpp */
|
#endif /* msgpack/type/tuple.hpp */
|
||||||
|
@@ -22,14 +22,14 @@ public:
|
|||||||
ssize_t count =
|
ssize_t count =
|
||||||
read(m_sock, m_pac.buffer(), m_pac.buffer_capacity());
|
read(m_sock, m_pac.buffer(), m_pac.buffer_capacity());
|
||||||
|
|
||||||
if(count < 0) {
|
if(count <= 0) {
|
||||||
|
if(count == 0) {
|
||||||
|
throw std::runtime_error("connection closed");
|
||||||
|
}
|
||||||
if(errno == EAGAIN || errno == EINTR) {
|
if(errno == EAGAIN || errno == EINTR) {
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
throw std::runtime_error(strerror(errno));
|
|
||||||
}
|
}
|
||||||
} else if(count == 0) {
|
throw std::runtime_error(strerror(errno));
|
||||||
throw std::runtime_error("connection closed");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pac.buffer_consumed(count);
|
m_pac.buffer_consumed(count);
|
||||||
|
Reference in New Issue
Block a user