diff options
author | Ted Yin <[email protected]> | 2015-05-31 22:20:19 +0800 |
---|---|---|
committer | Ted Yin <[email protected]> | 2015-05-31 22:20:19 +0800 |
commit | ae05d335f247ef2e83ad29ed9dca76260a9d7dff (patch) | |
tree | 51ce108a625ba1f72d28e589bac7b752e4eb2e05 /doc/nerv.md | |
parent | ab12a9583bdd39884fde9bc2444e6fd1bc5f518e (diff) | |
parent | 00c724864321be2b77891154d73fef18871182e1 (diff) |
Merge pull request #10 from cloudygoose/master
add more contents to doc
Diffstat (limited to 'doc/nerv.md')
-rw-r--r-- | doc/nerv.md | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/nerv.md b/doc/nerv.md index 85a86ca..22b4072 100644 --- a/doc/nerv.md +++ b/doc/nerv.md @@ -1,5 +1,15 @@ #The Nerv utility functions# Part of the [Nerv](../README.md) toolkit. ##Methods## +* __string = nerv.typename(obj a)__ +A registered function, the original function is `luaT_lua_typename`. In some cases if you call `type(a)` for object of some class in __Nerv__(like __Nerv.CuMatrix__) it will only return "userdata"(because it is created in C), in this case you can use this method to get its type. + +--- + +* __metatable = nerv.getmetatable(string tname)__ +A registered function, the original function is `luaT_lua_getmetatable`. `tname` should be a class name that has been registered in __luaT__. + +* __metatable = nerv.newmetatable(string tname, string parenttname, function constructor, function destructor, function factory)__ +A registered function, the original function is `luaT_newmetatable`, it returns the metatable of the created class by the name `tname`. * __string = nerv.setmetatable(table self, string tname)__ A registered function, the original function is `luaT_lua_setmetatable`. It assigns the metatable registered in __luaT__ by the name *tname* to the table *self*. And return *tname* to user. |