Add a feature to register a function of c++ to lua