stream << Tab(1) << "for (auto& i : c) ";
GenBrace(stream, TAB_SIZE, [&]() {
auto& mt = *type.GetMetaType();
- if (!mt.IsUserDefinedType() && mt.GetMetaType() == nullptr) {
- stream << Tab(2) << "rpc_port_parcel_write_"
- << parcel_type_map_[mt.ToString()]
- << "(h, i);" << NLine(1);
- } else {
- stream << Tab(2) << "h << i;" << NLine(1);
- }
+ stream << AddIndent(TAB_SIZE * 2, ConvertTypeToSerializer(mt, "i", "h"));
}, false);
stream << Tab(1) << "return h;" << NLine(1);
}, false);
stream << Tab(1) << "for (int i = 0; i < l; i++) ";
GenBrace(stream, TAB_SIZE, [&]() {
auto& mt = *type.GetMetaType();
- if (!mt.IsUserDefinedType() && mt.GetMetaType() == nullptr) {
- stream << Tab(2) << ConvertTypeToString(mt) << " v;" << NLine(1);
- stream << Tab(2) << "rpc_port_parcel_read_"
- << parcel_type_map_[mt.ToString()]
- << "(h, &v);" << NLine(1);
- } else {
- stream << Tab(2) << ConvertTypeToString(mt) << " v;" << NLine(1);
- stream << Tab(2) << "h >> v;" << NLine(1);
- }
+ stream << AddIndent(TAB_SIZE * 2,
+ ConvertTypeToDeserializer(mt, "v", "h", true));
stream << Tab(2) << "c.push_back(std::move(v));" << NLine(1);
}, false);
stream << Tab(1) << "return h;" << NLine(1);