From 19cdaa8e9b8d894550dbdee677df203568fd182c Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Tue, 5 Mar 2024 11:48:41 +0800 Subject: [PATCH] feat update sled --- 3rdparty/sled | 2 +- runtime/test.gen.cc | 93 ++++++++++++++++++++++----------------------- 2 files changed, 47 insertions(+), 48 deletions(-) diff --git a/3rdparty/sled b/3rdparty/sled index 5900bdf..0ef5b92 160000 --- a/3rdparty/sled +++ b/3rdparty/sled @@ -1 +1 @@ -Subproject commit 5900bdf0f6adf9b01b7e6d3844d4ef1e4b3009c7 +Subproject commit 0ef5b929c2e222906b33791ec03a23c24a0e4a84 diff --git a/runtime/test.gen.cc b/runtime/test.gen.cc index ae90b0e..f55438d 100644 --- a/runtime/test.gen.cc +++ b/runtime/test.gen.cc @@ -4,11 +4,12 @@ /** * Class **/ -test::Test::Test_Class::Test_Class() : ::meta::reflection::Class("test::Test", nullptr) {} - -void -test::Test::Test_Class::Register() +test::Test::Test_Class::Test_Class() +: ::meta::reflection::Class("test::Test", nullptr) { +} + +void test::Test::Test_Class::Register() { auto self = new test::Test::Test_Class(); auto clz = std::shared_ptr<::meta::reflection::Class>(self); // self->AddBaseClassProxy(); @@ -21,71 +22,69 @@ test::Test::Test_Class::Register() ::meta::reflection::Registry::Instance()->RegisterClass(clz); } - -void -test::Test::Test_Class::AddBaseClassProxy(std::shared_ptr<::meta::reflection::Class> base) -{ +void test::Test::Test_Class::AddBaseClassProxy(std::shared_ptr<::meta::reflection::Class> base) { AddBaseClass(base); } - -void -test::Test::Test_Class::AddMethodProxy(std::shared_ptr<::meta::reflection::Method> method) -{ +void test::Test::Test_Class::AddMethodProxy(std::shared_ptr<::meta::reflection::Method> method) { AddMethod(method); } - -void -test::Test::Test_Class::AddFieldProxy(std::shared_ptr<::meta::reflection::Field> field) -{ +void test::Test::Test_Class::AddFieldProxy(std::shared_ptr<::meta::reflection::Field> field) { AddField(field); } + /** * Field **/ -test::Test::Test_Field::Test_Field(const std::string &name, - std::shared_ptr<::meta::reflection::Class> parent) - : ::meta::reflection::Field(name, parent) -{} +test::Test::Test_Field::Test_Field( + const std::string& name, + std::shared_ptr<::meta::reflection::Class> parent) +: ::meta::reflection::Field(name, parent) {} -::meta::reflection::any -test::Test::Test_Field::GetImpl(void *instance) const -{ - ::test::Test *obj = (::test::Test *) instance; +::meta::reflection::any test::Test::Test_Field::GetImpl(void* instance) const { + ::test::Test* obj = (::test::Test*)instance; - if (strcmp(Name().c_str(), "length_") == 0) { return obj->length_; } - if (strcmp(Name().c_str(), "size_") == 0) { return obj->size_; } + if (strcmp(Name().c_str(), "length_") == 0) { + return obj->length_; + } + if (strcmp(Name().c_str(), "size_") == 0) { + return obj->size_; + } return ::meta::reflection::any{}; } -void -test::Test::Test_Field::SetImpl(void *instance, const ::meta::reflection::any &value) const -{ - ::test::Test *obj = (::test::Test *) instance; - if (strcmp(Name().c_str(), "length_") == 0) { - obj->length_ = ::meta::reflection::any_cast(value); - } - if (strcmp(Name().c_str(), "size_") == 0) { - obj->size_ = ::meta::reflection::any_cast(value); - } +void test::Test::Test_Field::SetImpl(void* instance, const ::meta::reflection::any& value) const { + ::test::Test* obj = (::test::Test*)instance; + if(strcmp(Name().c_str(), "length_") == 0) { obj->length_ = ::meta::reflection::any_cast(value);} + if(strcmp(Name().c_str(), "size_") == 0) { obj->size_ = ::meta::reflection::any_cast(value);} } + + /** * Method **/ -test::Test::Test_Method::Test_Method(const std::string &name, - std::shared_ptr<::meta::reflection::Class> parent) - : ::meta::reflection::Method(name, parent) -{} +test::Test::Test_Method::Test_Method( + const std::string& name, + std::shared_ptr<::meta::reflection::Class> parent) +: ::meta::reflection::Method(name, parent) {} -::meta::reflection::any -test::Test::Test_Method::InvokeImpl(void *instance, - const std::vector<::meta::reflection::any> ¶ms) const -{ - ::test::Test *obj = (::test::Test *) instance; +::meta::reflection::any test::Test::Test_Method::InvokeImpl(void* instance, const std::vector<::meta::reflection::any> ¶ms) const { + ::test::Test* obj = (::test::Test*)instance; - if (strcmp(Name().c_str(), "size") == 0) { return obj->size(); } - if (strcmp(Name().c_str(), "length") == 0) { return obj->length(); } + if (strcmp(Name().c_str(), "size") == 0) { + return + obj-> +size( + ); + } + if (strcmp(Name().c_str(), "length") == 0) { + return + obj-> +length( + ); + } return ::meta::reflection::any{}; } +