Преглед на файлове

Add 'registerUserType' method to StateWrapper

Ole преди 10 години
родител
ревизия
d8c6b84db9
променени са 1 файла, в които са добавени 12 реда и са изтрити 0 реда
  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.
 	 */