From de250768bca6bff20ff70cc39490333d1bcba280 Mon Sep 17 00:00:00 2001 From: walon Date: Fri, 13 Aug 2021 12:53:55 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E5=A4=8Dcfg=20c++=E4=BB=A3=E7=A0=81=E6=B2=A1=E6=9C=89=E5=A1=AB?= =?UTF-8?q?=E5=85=85Index=E7=B4=A2=E5=BC=95Map=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Luban.Job.Cfg/Source/Generate/CppCodeBinRender.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Luban.Job.Cfg/Source/Generate/CppCodeBinRender.cs b/src/Luban.Job.Cfg/Source/Generate/CppCodeBinRender.cs index 454d6e2..e1fc6bb 100644 --- a/src/Luban.Job.Cfg/Source/Generate/CppCodeBinRender.cs +++ b/src/Luban.Job.Cfg/Source/Generate/CppCodeBinRender.cs @@ -278,6 +278,12 @@ namespace {{x.top_module}} {{~ for field in type.export_fields ~}} {{cpp_deserialize '_buf' field.cpp_style_name field.ctype}} + {{~if field.index_field ~}} + for(auto& _v : this->{{field.cpp_style_name}}) + { + {{field.cpp_style_name}}_Index.insert({_v->{{field.index_field.cpp_style_name}}, _v}); + } + {{~end~}} {{~end~}} return true;