|
Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
|
Type-erased callback wrapper. More...
#include <slot.hpp>
Public Types | |
| using | Invoker = void (*)(void* state, void* args) noexcept |
| using | Destroyer = void (*)(void* state) noexcept |
Public Member Functions | |
| SlotErased () noexcept=default | |
| SlotErased (Invoker inv, Destroyer dtor, void *state) noexcept | |
| ~SlotErased () noexcept | |
| SlotErased (SlotErased &&o) noexcept | |
| SlotErased & | operator= (SlotErased &&o) noexcept |
| SlotErased (const SlotErased &)=delete | |
| SlotErased & | operator= (const SlotErased &)=delete |
| void | invoke (void *args) const noexcept |
| bool | empty () const noexcept |
Type-erased callback wrapper.
Stores a callable that takes a single void* "args" pointer (the caller is responsible for casting).
Why void* instead of std::function?
NOTE: SlotErased is move-only. state_ is an opaque owning pointer; moves transfer ownership by copying the pointer, so no "move" function pointer is required (unlike some small-buffer-optimized designs).
The dtor / move ops are defined out-of-line in slot.cpp so the (trivial) destruction of state_ is not inlined into every TU, which keeps code size small and improves compile times.
| using aria::abi::SlotErased::Invoker = void (*)(void* state, void* args) noexcept |
| using aria::abi::SlotErased::Destroyer = void (*)(void* state) noexcept |
|
defaultnoexcept |
|
noexcept |
|
noexcept |
|
delete |
|
noexcept |
|
delete |
|
inlinenoexcept |
|
inlinenodiscardnoexcept |