Skip to content

Commit

Permalink
Merge pull request #239 from redboltz/add_msgpack_prefix_to_erb
Browse files Browse the repository at this point in the history
Added msgpack prefix to erb template files.
  • Loading branch information
nobu-k committed Mar 11, 2015
2 parents 62be3f1 + ad5da7f commit 156a440
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions erb/cpp03_define.hpp.erb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ struct define<> {
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
}
void msgpack_object(msgpack::object* o, msgpack::zone&) const
{
Expand All @@ -115,7 +115,7 @@ struct define<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> {
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
Expand Down
6 changes: 3 additions & 3 deletions erb/cpp03_msgpack_tuple.hpp.erb
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,16 @@ inline tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_tuple(typename tuple_type<
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<>&) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
return o;
}
<%0.upto(GENERATION_LIMIT) {|i|%>
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < <%=i+1%>) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < <%=i+1%>) { throw msgpack::type_error(); }
<%0.upto(i) {|j|%>
o.via.array.ptr[<%=j%>].convert<typename type::tuple_type<A<%=j%>>::type>(v.template get<<%=j%>>());<%}%>
return o;
Expand Down

0 comments on commit 156a440

Please sign in to comment.