template <size_t inline_target_size, bool require_inline, typename Allocator, typename Result, typename... Args>
class callback_impl
Defined at line 359 of file ../../sdk/lib/fit/include/lib/fit/function.h
Public Methods
void callback_impl<inline_target_size, require_inline, Result (Args...), Allocator> ()
Initializes an empty (null) callback. Attempting to call an empty
callback will abort the program.
Defined at line 390 of file ../../sdk/lib/fit/include/lib/fit/function.h
void callback_impl<inline_target_size, require_inline, Result (Args...), Allocator> (decltype(nullptr) )
Creates a callback with an empty target (same outcome as the default
constructor).
Defined at line 394 of file ../../sdk/lib/fit/include/lib/fit/function.h
void callback_impl<inline_target_size, require_inline, Result (Args...), Allocator> (Result (*)(Args...) callback_target)
Creates a callback bound to the specified function pointer.
If target == nullptr, assigns an empty target.
Defined at line 398 of file ../../sdk/lib/fit/include/lib/fit/function.h
template <typename Callable, requires_conditions<
std::is_convertible<decltype(std::declval<Callable&>()(std::declval<Args>()...)),
result_type>,
not_self_type<Callable>> = true>
void callback_impl<inline_target_size, require_inline, Result (Args...), Allocator> (Callable && callback_target)
Creates a callback bound to the specified callable object.
If target == nullptr, assigns an empty target.
For functors, we need to capture the raw type but also restrict on the
existence of an appropriate operator () to resolve overloads and implicit
casts properly.
Defined at line 411 of file ../../sdk/lib/fit/include/lib/fit/function.h
void callback_impl<inline_target_size, require_inline, Result (Args...), Allocator> (callback_impl<inline_target_size, require_inline, Result (Args...), Allocator> && other)
Creates a callback with a target moved from another callback,
leaving the other callback with an empty target.
Defined at line 415 of file ../../sdk/lib/fit/include/lib/fit/function.h
void ~callback_impl<inline_target_size, require_inline, Result (Args...), Allocator> ()
Destroys the callback, releasing its target.
Defined at line 418 of file ../../sdk/lib/fit/include/lib/fit/function.h
callback_impl<inline_target_size, require_inline, Result (Args...), Allocator> & operator= (decltype(nullptr) )
Assigns the callback to an empty target. Attempting to invoke the
callback will abort the program.
Defined at line 422 of file ../../sdk/lib/fit/include/lib/fit/function.h
template <typename Callable>
assignment_requires_conditions<std::is_convertible<decltype(std::declval<Callable &>()(std::declval<Args>()...)), result_type>, not_self_type<Callable>> operator= (Callable && callback_target)
NOLINTNEXTLINE(misc-unconventional-assign-operator)
Defined at line 435 of file ../../sdk/lib/fit/include/lib/fit/function.h
callback_impl<inline_target_size, require_inline, Result (Args...), Allocator> & operator= (callback_impl<inline_target_size, require_inline, Result (Args...), Allocator> && other)
Move assignment
Defined at line 444 of file ../../sdk/lib/fit/include/lib/fit/function.h
void swap (callback_impl<inline_target_size, require_inline, Result (Args...), Allocator> & other)
Swaps the callbacks' targets.
Defined at line 452 of file ../../sdk/lib/fit/include/lib/fit/function.h
Result operator() (Args... args)
Invokes the callback's target.
Aborts if the callback's target is empty.
|fit::callback| must be non-const to invoke. Before the target function
is actually called, the fit::callback will be set to the default empty
state (== nullptr, and operator bool() will subsequently return |false|).
The target function will then be released after the function is called.
If the callback was shared, any remaining copies will also be cleared.
Defined at line 467 of file ../../sdk/lib/fit/include/lib/fit/function.h
callback_impl<inline_target_size, require_inline, Result (Args...), Allocator> share ()
Returns a new callback object that invokes the same target.
The target itself is not copied; it is moved to the heap and its
lifetime is extended until all references have been released.
For |fit::callback| (unlike fit::function), the first invocation of the
callback will release all references to the target. All callbacks
derived from the same original callback (via share()) will be cleared,
as if set to |nullptr|, and "operator bool()" will return false.
Note: This method is not supported on |fit::inline_function
<
>|
because it may incur a heap allocation which is contrary to
the stated purpose of |fit::inline_function
<
>|.
Defined at line 483 of file ../../sdk/lib/fit/include/lib/fit/function.h
Friends
template <size_t inline_target_sizebool require_inlinetypename Allocatortypename Resulttypename... Args>
const void * callback_impl<inline_target_sizerequire_inlineResult(Args...)Allocator> (const callback_impl<inline_target_size, require_inline, Result (Args...), Allocator> & )