| 22 | example_peripheral(lua_State *L, const char * side) {} |
| 23 | ~example_peripheral(){} |
| 24 | int call(lua_State *L, const char * method) { |
| 25 | std::string m(method); |
| 26 | if (m == "add") return add(L); |
| 27 | else if (m == "subtract") return subtract(L); |
| 28 | else if (m == "ping") return ping(L); |
| 29 | else return luaL_error(L, "No such method"); |
| 30 | } |
| 31 | static peripheral * init(lua_State *L, const char * side) {return new example_peripheral(L, side);} |
| 32 | static void deinit(peripheral * p) {delete (example_peripheral*)p;} |
| 33 | virtual destructor getDestructor() const {return deinit;} |
nothing calls this directly
no outgoing calls
no test coverage detected