diff --git a/src/Luban.Job.Cfg/Source/Generate/CppCodeBinRender.cs b/src/Luban.Job.Cfg/Source/Generate/CppCodeBinRender.cs index dfcbaeb..e6d1909 100644 --- a/src/Luban.Job.Cfg/Source/Generate/CppCodeBinRender.cs +++ b/src/Luban.Job.Cfg/Source/Generate/CppCodeBinRender.cs @@ -76,7 +76,7 @@ class {{name}} : public {{if parent_def_type}} {{parent_def_type.cpp_full_name}} */ {{cpp_define_type field.ctype}} {{field.cpp_style_name}}; {{~if field.index_field~}} - std::unordered_map<{{cpp_define_type field.index_field.ctype}}, {{cpp_define_type field.ctype.element_type}}> {{field.cpp_style_name}}_Index; + ::bright::HashMap<{{cpp_define_type field.index_field.ctype}}, {{cpp_define_type field.ctype.element_type}}> {{field.cpp_style_name}}_Index; {{~end~}} {{~if field.gen_ref~}} {{field.cpp_ref_validator_define}} @@ -89,7 +89,7 @@ class {{name}} : public {{if parent_def_type}} {{parent_def_type.cpp_full_name}} int getTypeId() const { return ID; } {{~end~}} - virtual void resolve(std::unordered_map& _tables); + virtual void resolve(::bright::HashMap<::bright::String, void*>& _tables); }; {{x.cpp_namespace_end}} @@ -122,8 +122,8 @@ class {{name}} { {{~if x.is_map_table ~}} private: - std::unordered_map<{{cpp_define_type key_type}}, {{cpp_define_type value_type}}> _dataMap; - std::vector<{{cpp_define_type value_type}}> _dataList; + ::bright::HashMap<{{cpp_define_type key_type}}, {{cpp_define_type value_type}}> _dataMap; + ::bright::Vector<{{cpp_define_type value_type}}> _dataList; public: bool load(ByteBuf& _buf) @@ -140,8 +140,8 @@ class {{name}} return true; } - const std::unordered_map<{{cpp_define_type key_type}}, {{cpp_define_type value_type}}>& getDataMap() const { return _dataMap; } - const std::vector<{{cpp_define_type value_type}}>& getDataList() const { return _dataList; } + const ::bright::HashMap<{{cpp_define_type key_type}}, {{cpp_define_type value_type}}>& getDataMap() const { return _dataMap; } + const ::bright::Vector<{{cpp_define_type value_type}}>& getDataList() const { return _dataList; } {{value_type.bean.cpp_full_name}}* getRaw({{cpp_define_type key_type}} key) { @@ -155,7 +155,7 @@ class {{name}} return it != _dataMap.end() ? it->second : nullptr; } - void resolve(std::unordered_map& _tables) + void resolve(::bright::HashMap<::bright::String, void*>& _tables) { for(auto v : _dataList) { @@ -179,7 +179,7 @@ class {{name}} return true; } - void resolve(std::unordered_map& _tables) + void resolve(::bright::HashMap<::bright::String, void*>& _tables) { _data->resolve(_tables); } @@ -214,9 +214,9 @@ class {{name}} {{table.cpp_full_name}} {{table.name}}; {{~end~}} - bool load(std::function loader) + bool load(::bright::Function loader) { - std::unordered_map __tables__; + ::bright::HashMap<::bright::String, void*> __tables__; ByteBuf buf; {{~for table in tables~}} @@ -299,7 +299,7 @@ namespace {{x.top_module}} {{~end~}} } - void {{type.cpp_full_name}}::resolve(std::unordered_map& _tables) + void {{type.cpp_full_name}}::resolve(::bright::HashMap<::bright::String, void*>& _tables) { {{~if type.parent_def_type~}} {{type.parent_def_type.name}}::resolve(_tables); diff --git a/src/Luban.Job.Cfg/Source/JobController.cs b/src/Luban.Job.Cfg/Source/JobController.cs index ef191e2..36c7adc 100644 --- a/src/Luban.Job.Cfg/Source/JobController.cs +++ b/src/Luban.Job.Cfg/Source/JobController.cs @@ -626,16 +626,14 @@ namespace Luban.Job.Cfg @$" #pragma once #include -#include #include ""bright/serialization/ByteBuf.h"" #include ""bright/CfgBean.hpp"" -using ByteBuf = bright::serialization::ByteBuf; +using ByteBuf = ::bright::serialization::ByteBuf; namespace {ctx.TopModule} {{ - " }; diff --git a/src/Luban.Job.Common/Source/TypeVisitors/CppDefineTypeName.cs b/src/Luban.Job.Common/Source/TypeVisitors/CppDefineTypeName.cs index 006f131..fbf8155 100644 --- a/src/Luban.Job.Common/Source/TypeVisitors/CppDefineTypeName.cs +++ b/src/Luban.Job.Common/Source/TypeVisitors/CppDefineTypeName.cs @@ -8,7 +8,6 @@ namespace Luban.Job.Common.TypeVisitors public override string DoAccept(TType type) { - //return type.IsNullable ? $"std::optional<{type.Apply(CppUnderingDefineTypeName.Ins)}>" : type.Apply(CppUnderingDefineTypeName.Ins); return type.IsNullable ? $"::bright::SharedPtr<{type.Apply(CppSharedPtrUnderingDefineTypeName.Ins)}>" : type.Apply(CppSharedPtrUnderingDefineTypeName.Ins); } diff --git a/src/Luban.Job.Common/Source/TypeVisitors/CppRawUnderingDefineTypeName.cs b/src/Luban.Job.Common/Source/TypeVisitors/CppRawUnderingDefineTypeName.cs index fd143a7..94a7d18 100644 --- a/src/Luban.Job.Common/Source/TypeVisitors/CppRawUnderingDefineTypeName.cs +++ b/src/Luban.Job.Common/Source/TypeVisitors/CppRawUnderingDefineTypeName.cs @@ -118,7 +118,7 @@ namespace Luban.Job.Common.TypeVisitors public string Accept(TDateTime type) { - return "::bright::datetime_t"; + return "::bright::datetime"; } } }