9 #include <luabind/luabind.hpp> 10 #include <luabind/tag_function.hpp> 11 #include <boost/function.hpp> 14 #include <boost/shared_ptr.hpp> 112 #define REGISTER_LUA_LIST(X) \ 113 void register_lua_##X(lua_State*); register_lua_##X(ls) 116 #define REGISTER_LUA_CLASS(X) \ 117 namespace FullPhysics { \ 118 void register_lua_##X(lua_State *ls) { \ 119 LuabindObject::base_bridge.push_back(boost::shared_ptr<BridgeLuabindAndGenericBase>(new BridgeLuabindAndGeneric< X >)); \ 120 luabind::module(ls) [ luabind::class_< X,boost::shared_ptr< X > >(#X) \ 121 .def("__tostring", &X::print_to_string) 123 #define REGISTER_LUA_CLASS_NAME_WITH_GENERIC_OBJECT_BASE(X, Y) \ 124 namespace FullPhysics { \ 125 void register_lua_##Y(lua_State *ls) { \ 126 LuabindObject::base_bridge.push_back(boost::shared_ptr<BridgeLuabindAndGenericBase>(new BridgeLuabindAndGeneric< X >)); \ 127 luabind::module(ls) [ luabind::class_< X,boost::shared_ptr< X > >(#Y) 129 #define REGISTER_LUA_CLASS_NAME(X, Y) \ 130 namespace FullPhysics { \ 131 void register_lua_##Y(lua_State *ls) { \ 132 luabind::module(ls) [ luabind::class_< X,boost::shared_ptr< X > >(#Y) 134 #define REGISTER_LUA_END() ]; } } 136 #define REGISTER_LUA_DERIVED_CLASS(X, Y) \ 137 namespace FullPhysics { \ 138 void register_lua_##X(lua_State *ls) { \ 139 LuabindObject::base_bridge.push_back(boost::shared_ptr<BridgeLuabindAndGenericBase>(new BridgeLuabindAndGeneric< Y >)); \ 140 luabind::module(ls) [ luabind::class_<X,Y,boost::shared_ptr<Y> >(#X)
static void register_lua(lua_State *ls)
This class handles the registration of luabind class wrappers with Lua.
static int add_file_and_line(lua_State *ls)
Contains classes to abstract away details in various Spurr Radiative Transfer software.