Pārlūkot izejas kodu

Helper 'call' is now called 'map'

Ole 10 gadi atpakaļ
vecāks
revīzija
990e10a0ec
3 mainītis faili ar 16 papildinājumiem un 16 dzēšanām
  1. 1 1
      lib/luwra/functions.hpp
  2. 4 4
      lib/luwra/methods.hpp
  3. 11 11
      lib/luwra/stack.hpp

+ 1 - 1
lib/luwra/functions.hpp

@@ -26,7 +26,7 @@ namespace internal {
 	struct FunctionWrapper<R (A...)> {
 		template <R (* fun)(A...)> static inline
 		int invoke(State* state) {
-			return call<R (A...)>(state, fun);
+			return map<R (A...)>(state, fun);
 		}
 	};
 

+ 4 - 4
lib/luwra/methods.hpp

@@ -38,7 +38,7 @@ namespace internal {
 
 		template <MethodPointerType meth> static inline
 		int invoke(State* state) {
-			return call<FunctionSignature>(state, hook<meth>);
+			return map<FunctionSignature>(state, hook<meth>);
 		}
 	};
 
@@ -55,7 +55,7 @@ namespace internal {
 
 		template <MethodPointerType meth> static inline
 		int invoke(State* state) {
-			return call<FunctionSignature>(state, hook<meth>);
+			return map<FunctionSignature>(state, hook<meth>);
 		}
 	};
 
@@ -72,7 +72,7 @@ namespace internal {
 
 		template <MethodPointerType meth> static inline
 		int invoke(State* state) {
-			return call<FunctionSignature>(state, hook<meth>);
+			return map<FunctionSignature>(state, hook<meth>);
 		}
 	};
 
@@ -89,7 +89,7 @@ namespace internal {
 
 		template <MethodPointerType meth> static inline
 		int invoke(State* state) {
-			return call<FunctionSignature>(state, hook<meth>);
+			return map<FunctionSignature>(state, hook<meth>);
 		}
 	};
 }

+ 11 - 11
lib/luwra/stack.hpp

@@ -143,17 +143,17 @@ R apply(State* state, const std::function<R(A...)>& fun) {
 
 namespace internal {
 	template <typename T>
-	struct LayoutCaller {
+	struct LayoutMapper {
 		static_assert(
 			sizeof(T) == -1,
-			"Parameter to LayoutCaller is not a valid signature"
+			"Parameter to LayoutMapper is not a valid signature"
 		);
 	};
 
 	template <typename... A>
-	struct LayoutCaller<void (A...)> {
+	struct LayoutMapper<void (A...)> {
 		template <typename F, typename... X> static inline
-		int call(State* state, int n, F&& hook, X&&... args) {
+		int map(State* state, int n, F&& hook, X&&... args) {
 			direct<void (A...)>(
 				state,
 				n,
@@ -165,9 +165,9 @@ namespace internal {
 	};
 
 	template <typename R, typename... A>
-	struct LayoutCaller<R (A...)> {
+	struct LayoutMapper<R (A...)> {
 		template <typename F, typename... X> static inline
-		int call(State* state, int n, F&& hook, X&&... args) {
+		int map(State* state, int n, F&& hook, X&&... args) {
 			return push(
 				state,
 				direct<R (A...)>(
@@ -186,8 +186,8 @@ namespace internal {
  * \returns Number of values pushed
  */
 template <typename S, typename F, typename... A> static inline
-int call(State* state, int pos, F&& hook, A&&... args) {
-	return internal::LayoutCaller<S>::call(
+int map(State* state, int pos, F&& hook, A&&... args) {
+	return internal::LayoutMapper<S>::map(
 		state,
 		pos,
 		std::forward<F>(hook),
@@ -196,11 +196,11 @@ int call(State* state, int pos, F&& hook, A&&... args) {
 }
 
 /**
- * Same as `call(state, 1, hook)`.
+ * Same as `map(state, 1, hook)`.
  */
 template <typename S, typename F, typename... A> static inline
-int call(State* state, F&& hook, A&&... args) {
-	return internal::LayoutCaller<S>::call(
+int map(State* state, F&& hook, A&&... args) {
+	return internal::LayoutMapper<S>::map(
 		state,
 		1,
 		std::forward<F>(hook),