Re: [luabind] calling luabind class methods from a C++ func
Brought to you by:
arvidn,
daniel_wallin
From: Daniel W. <dal...@st...> - 2003-09-26 19:32:01
|
At 11:12 2003-09-23, orange ted wrote: >Hi, > >I'd like to be able to do something like the following but I can't figure >out how. > >//pass a luabind class created in a lua script into a c++ function and >//call a method of that class >void func(const luabind::object& luabind_class) >{ > //call a method of the luabind class > luabind_class.DoMethod(); >} > > > >Is this possible? Yes, it's possible directly with object or by extracting a functor. I'll show the object way: void func(const luabind::object& luabind_class) { //call a method of the luabind class luabind_class["DoMethod"](luabind_class); } --- Daniel Wallin |