Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/luatb.h @ 11663

Last change on this file since 11663 was 11549, checked in by kohlia, 7 years ago

Not working yet

File size: 728 bytes
Line 
1#ifndef LUATB_H
2#define LUATB_H
3
4#include <string>
5
6struct lua_State;
7
8// Makes certain functions visible to lua while staying type-safe on the
9// C++ side.
10template<typename ThisType, typename FunctionType>
11class LuaTB
12{
13public:
14    // Make a function visible to lua. If you want to make a function 'foo'
15    // visible, you should call it like this:
16    //
17    // LuaTB<decltype(foo)>::registerFunction<foo>( ... );
18    template<FunctionType func>
19    static void registerFunction(ThisType *_this, lua_State *lua, std::string name);
20};
21
22// We need to include all type-dependant template implementations, because the
23// compiler needs to know for which types it has to instantiate those
24#include "luatb.ipp"
25
26#endif // LUATB_H
Note: See TracBrowser for help on using the repository browser.