From 114ebb2573c07f4f5a776d0dacdc684552607cca Mon Sep 17 00:00:00 2001 From: walon Date: Thu, 12 Aug 2021 10:52:50 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E8=B0=83=E6=95=B4=E3=80=91=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E7=94=9F=E6=88=90=E7=9A=84cfg=20c++=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=B8=AD=E4=BE=9D=E7=84=B6=E6=9C=89=E4=B8=80=E9=83=A8=E5=88=86?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E4=BD=BF=E7=94=A8=E4=BA=86std::shared=5Fptr?= =?UTF-8?q?=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 | 4 ++-- src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Luban.Job.Cfg/Source/Generate/CppCodeBinRender.cs b/src/Luban.Job.Cfg/Source/Generate/CppCodeBinRender.cs index d1e72da..dfcbaeb 100644 --- a/src/Luban.Job.Cfg/Source/Generate/CppCodeBinRender.cs +++ b/src/Luban.Job.Cfg/Source/Generate/CppCodeBinRender.cs @@ -47,7 +47,7 @@ class {{name}} : public {{if parent_def_type}} {{parent_def_type.cpp_full_name}} { public: - static bool deserialize{{name}}(ByteBuf& _buf, std::shared_ptr<{{name}}>& _out); + static bool deserialize{{name}}(ByteBuf& _buf, ::bright::SharedPtr<{{name}}>& _out); {{name}}() { @@ -273,7 +273,7 @@ namespace {{x.top_module}} return true; } - bool {{type.cpp_full_name}}::deserialize{{type.name}}(ByteBuf& _buf, std::shared_ptr<{{type.cpp_full_name}}>& _out) + bool {{type.cpp_full_name}}::deserialize{{type.name}}(ByteBuf& _buf, ::bright::SharedPtr<{{type.cpp_full_name}}>& _out) { {{~if type.is_abstract_type~}} int id; diff --git a/src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs b/src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs index 989bb11..c81e40d 100644 --- a/src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs +++ b/src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs @@ -147,15 +147,24 @@ namespace Luban.Job.Common.Defs switch (type) { case "bool": return nullable ? TBool.NullableIns : TBool.Ins; + case "uint8": case "byte": return nullable ? TByte.NullableIns : TByte.Ins; + case "int16": case "short": return nullable ? TShort.NullableIns : TShort.Ins; + case "fint16": case "fshort": return nullable ? TFshort.NullableIns : TFshort.Ins; + case "int32": case "int": return nullable ? TInt.NullableIns : TInt.Ins; + case "fint32": case "fint": return nullable ? TFint.NullableIns : TFint.Ins; + case "int64": case "long": return nullable ? TLong.NullableIns : TLong.Ins; case "bigint": return nullable ? TLong.NullableBigIns : TLong.BigIns; + case "fint64": case "flong": return nullable ? TFlong.NullableIns : TFlong.Ins; + case "float32": case "float": return nullable ? TFloat.NullableIns : TFloat.Ins; + case "float64": case "double": return nullable ? TDouble.NullableIns : TDouble.Ins; case "bytes": return TBytes.Ins; case "string": return nullable ? TString.NullableIns : TString.Ins;