【调整】解决生成的cfg c++代码中依然有一部分直接使用了std::shared_ptr的问题
parent
901441e9c2
commit
114ebb2573
|
|
@ -47,7 +47,7 @@ class {{name}} : public {{if parent_def_type}} {{parent_def_type.cpp_full_name}}
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static bool deserialize{{name}}(ByteBuf& _buf, std::shared_ptr<{{name}}>& _out);
|
static bool deserialize{{name}}(ByteBuf& _buf, ::bright::SharedPtr<{{name}}>& _out);
|
||||||
|
|
||||||
{{name}}()
|
{{name}}()
|
||||||
{
|
{
|
||||||
|
|
@ -273,7 +273,7 @@ namespace {{x.top_module}}
|
||||||
return true;
|
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~}}
|
{{~if type.is_abstract_type~}}
|
||||||
int id;
|
int id;
|
||||||
|
|
|
||||||
|
|
@ -147,15 +147,24 @@ namespace Luban.Job.Common.Defs
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case "bool": return nullable ? TBool.NullableIns : TBool.Ins;
|
case "bool": return nullable ? TBool.NullableIns : TBool.Ins;
|
||||||
|
case "uint8":
|
||||||
case "byte": return nullable ? TByte.NullableIns : TByte.Ins;
|
case "byte": return nullable ? TByte.NullableIns : TByte.Ins;
|
||||||
|
case "int16":
|
||||||
case "short": return nullable ? TShort.NullableIns : TShort.Ins;
|
case "short": return nullable ? TShort.NullableIns : TShort.Ins;
|
||||||
|
case "fint16":
|
||||||
case "fshort": return nullable ? TFshort.NullableIns : TFshort.Ins;
|
case "fshort": return nullable ? TFshort.NullableIns : TFshort.Ins;
|
||||||
|
case "int32":
|
||||||
case "int": return nullable ? TInt.NullableIns : TInt.Ins;
|
case "int": return nullable ? TInt.NullableIns : TInt.Ins;
|
||||||
|
case "fint32":
|
||||||
case "fint": return nullable ? TFint.NullableIns : TFint.Ins;
|
case "fint": return nullable ? TFint.NullableIns : TFint.Ins;
|
||||||
|
case "int64":
|
||||||
case "long": return nullable ? TLong.NullableIns : TLong.Ins;
|
case "long": return nullable ? TLong.NullableIns : TLong.Ins;
|
||||||
case "bigint": return nullable ? TLong.NullableBigIns : TLong.BigIns;
|
case "bigint": return nullable ? TLong.NullableBigIns : TLong.BigIns;
|
||||||
|
case "fint64":
|
||||||
case "flong": return nullable ? TFlong.NullableIns : TFlong.Ins;
|
case "flong": return nullable ? TFlong.NullableIns : TFlong.Ins;
|
||||||
|
case "float32":
|
||||||
case "float": return nullable ? TFloat.NullableIns : TFloat.Ins;
|
case "float": return nullable ? TFloat.NullableIns : TFloat.Ins;
|
||||||
|
case "float64":
|
||||||
case "double": return nullable ? TDouble.NullableIns : TDouble.Ins;
|
case "double": return nullable ? TDouble.NullableIns : TDouble.Ins;
|
||||||
case "bytes": return TBytes.Ins;
|
case "bytes": return TBytes.Ins;
|
||||||
case "string": return nullable ? TString.NullableIns : TString.Ins;
|
case "string": return nullable ? TString.NullableIns : TString.Ins;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue