Explorar el Código

Add 'registerUserType' method to StateWrapper

Ole hace 10 años
padre
commit
d8c6b84db9
Se han modificado 1 ficheros con 12 adiciones y 0 borrados
  1. 12 0
      lib/luwra/state.hpp

+ 12 - 0
lib/luwra/state.hpp

@@ -118,6 +118,18 @@ struct StateWrapper {
 		return GlobalAccessor(state, key);
 	}
 
+	/**
+	 * \todo Document me
+	 */
+	template <typename T> inline
+	void registerUserType(
+		const std::string& ctor_name,
+		const std::map<const char*, CFunction>& methods = std::map<const char*, CFunction>(),
+		const std::map<const char*, CFunction>& meta_methods = std::map<const char*, CFunction>()
+	) {
+		registerUserType<T>(state, ctor_name, methods, meta_methods);
+	}
+
 	/**
 	 * Execute a piece of code.
 	 */