pw_function: Rename template parameter
Rename Callable to FunctionType, since the parameter should be a
function type, such as void(int, bool), rather than a callable type.
This matches fit::function's naming.
Change-Id: I7f39c5afe7f71f7e6a815b90413c98a5529b97ef
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/168334
Reviewed-by: Taylor Cramer <cramertj@google.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
diff --git a/pw_function/public/pw_function/function.h b/pw_function/public/pw_function/function.h
index 99842b3..1494559 100644
--- a/pw_function/public/pw_function/function.h
+++ b/pw_function/public/pw_function/function.h
@@ -46,13 +46,13 @@
/// }
///
/// @endcode
-template <typename Callable,
+template <typename FunctionType,
size_t inline_target_size =
function_internal::config::kInlineCallableSize>
using Function = fit::function_impl<
inline_target_size,
/*require_inline=*/!function_internal::config::kEnableDynamicAllocation,
- Callable>;
+ FunctionType>;
/// Version of `pw::Function` that exclusively uses inline storage.
///
@@ -62,10 +62,10 @@
///
// TODO(b/252852651): Remove warning above when conversion from
// `fit::inline_function` to `fit::function` doesn't allocate anymore.
-template <typename Callable,
+template <typename FunctionType,
size_t inline_target_size =
function_internal::config::kInlineCallableSize>
-using InlineFunction = fit::inline_function<Callable, inline_target_size>;
+using InlineFunction = fit::inline_function<FunctionType, inline_target_size>;
using Closure = Function<void()>;
@@ -79,18 +79,18 @@
///
/// A `pw::Callback` in the "already called" state has the same state as a
/// `pw::Callback` that has been assigned to `nullptr`.
-template <typename Callable,
+template <typename FunctionType,
size_t inline_target_size =
function_internal::config::kInlineCallableSize>
using Callback = fit::callback_impl<
inline_target_size,
/*require_inline=*/!function_internal::config::kEnableDynamicAllocation,
- Callable>;
+ FunctionType>;
/// Version of `pw::Callback` that exclusively uses inline storage.
-template <typename Callable,
+template <typename FunctionType,
size_t inline_target_size =
function_internal::config::kInlineCallableSize>
-using InlineCallback = fit::inline_callback<Callable, inline_target_size>;
+using InlineCallback = fit::inline_callback<FunctionType, inline_target_size>;
} // namespace pw