diff options
Diffstat (limited to 'deep_test')
-rw-r--r-- | deep_test/deep_test.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/deep_test/deep_test.cpp b/deep_test/deep_test.cpp index 9ca88df..0a09921 100644 --- a/deep_test/deep_test.cpp +++ b/deep_test/deep_test.cpp | |||
@@ -13,12 +13,12 @@ class MyDeepFactory : public DeepFactory | |||
13 | 13 | ||
14 | private: | 14 | private: |
15 | 15 | ||
16 | [[nodiscard]] DeepPrelude* newDeepObjectInternal(lua_State* L) const override; | 16 | void createMetatable(lua_State* const L_) const override |
17 | void deleteDeepObjectInternal(lua_State* L, DeepPrelude* o_) const override; | ||
18 | void createMetatable(lua_State* L_) const override | ||
19 | { | 17 | { |
20 | luaL_getmetatable(L_, "deep"); | 18 | luaL_getmetatable(L_, "deep"); |
21 | } | 19 | } |
20 | void deleteDeepObjectInternal(lua_State* const L_, DeepPrelude* o_) const override; | ||
21 | [[nodiscard]] DeepPrelude* newDeepObjectInternal(lua_State* const L_) const override; | ||
22 | [[nodiscard]] std::string_view moduleName() const override { return std::string_view{ "deep_test" }; } | 22 | [[nodiscard]] std::string_view moduleName() const override { return std::string_view{ "deep_test" }; } |
23 | }; | 23 | }; |
24 | /*static*/ MyDeepFactory MyDeepFactory::Instance{}; | 24 | /*static*/ MyDeepFactory MyDeepFactory::Instance{}; |
@@ -33,27 +33,27 @@ struct MyDeepUserdata : public DeepPrelude // Deep userdata MUST start with a De | |||
33 | 33 | ||
34 | // ################################################################################################# | 34 | // ################################################################################################# |
35 | 35 | ||
36 | DeepPrelude* MyDeepFactory::newDeepObjectInternal(lua_State* L) const | 36 | DeepPrelude* MyDeepFactory::newDeepObjectInternal(lua_State* const L_) const |
37 | { | 37 | { |
38 | MyDeepUserdata* deep_test = new MyDeepUserdata{ MyDeepFactory::Instance }; | 38 | MyDeepUserdata* const _deep_test{ new MyDeepUserdata{ MyDeepFactory::Instance } }; |
39 | return deep_test; | 39 | return _deep_test; |
40 | } | 40 | } |
41 | 41 | ||
42 | // ################################################################################################# | 42 | // ################################################################################################# |
43 | 43 | ||
44 | void MyDeepFactory::deleteDeepObjectInternal(lua_State* L, DeepPrelude* o_) const | 44 | void MyDeepFactory::deleteDeepObjectInternal(lua_State* const L_, DeepPrelude* const o_) const |
45 | { | 45 | { |
46 | MyDeepUserdata* deep_test = static_cast<MyDeepUserdata*>(o_); | 46 | MyDeepUserdata* const _deep_test{ static_cast<MyDeepUserdata*>(o_) }; |
47 | delete deep_test; | 47 | delete _deep_test; |
48 | } | 48 | } |
49 | 49 | ||
50 | // ################################################################################################# | 50 | // ################################################################################################# |
51 | 51 | ||
52 | [[nodiscard]] static int deep_set(lua_State* L) | 52 | [[nodiscard]] static int deep_set(lua_State* const L_) |
53 | { | 53 | { |
54 | MyDeepUserdata* const self{ static_cast<MyDeepUserdata*>(MyDeepFactory::Instance.toDeep(L, 1)) }; | 54 | MyDeepUserdata* const _self{ static_cast<MyDeepUserdata*>(MyDeepFactory::Instance.toDeep(L_, 1)) }; |
55 | lua_Integer i = lua_tointeger( L, 2); | 55 | lua_Integer i = lua_tointeger(L_, 2); |
56 | self->val = i; | 56 | _self->val = i; |
57 | return 0; | 57 | return 0; |
58 | } | 58 | } |
59 | 59 | ||