summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2014-09-24 11:51:11 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2014-09-24 11:51:27 +0100
commit0061d5a43747af20755b806a4f150dee68a9a0d3 (patch)
treefdcaef14a6683a79bfc41dd56561659cfcfce149
parent222b49ba7c09a5c732754d8f1ae7c35f44716eb0 (diff)
elua: Eo metatype with method table redirection
-rw-r--r--src/bindings/luajit/eo.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/bindings/luajit/eo.lua b/src/bindings/luajit/eo.lua
index c80a568078..e72db2a64e 100644
--- a/src/bindings/luajit/eo.lua
+++ b/src/bindings/luajit/eo.lua
@@ -181,6 +181,23 @@ M.__do_end = function()
181 -- only for cleanup (dtor) 181 -- only for cleanup (dtor)
182end 182end
183 183
184local eo_methods = {
185}
186
187ffi.metatype("Eo", {
188 __index = function(self, key)
189 local v = rawget(eo_methods, key)
190 if v ~= nil then return v end
191 local cl = eo.eo_class_get(self)
192 if cl == nil then return nil end
193 local nm = eo.eo_class_name_get(cl)
194 if nm == nil then return nil end
195 local mt == classes[nm]
196 if mt == nil then return nil end
197 return mt[key]
198 end
199})
200
184M.Eo_Base = util.Object:clone { 201M.Eo_Base = util.Object:clone {
185} 202}
186 203