14 template <
typename TSignature>
17 template <
typename... TArgs>
33 : callbacks(other.callbacks.clone()) {}
37 callbacks.
push(Callback{ functor, owner });
43 for (
const Callback& callback : callbacks) {
44 if (
auto owner = callback.owner.lock()) {
45 callback.functor(args...);
51 return callbacks.
begin();
55 return callbacks.
end();
59 return callbacks.
size();
63 return callbacks.
empty();
68 template <
typename... TArgs>
Generic dynamically allocated resizable storage.
Generic wrappers of lambdas, functors and other callables.
uint32_t Size
Integral type used to index arrays (by default).
#define NAMESPACE_SPH_END
Helper class allowing to own a SharedPtr without knowing its type.
INLINE Iterator< StorageType > end() noexcept
INLINE void push(U &&u)
Adds new element to the end of the array, resizing the array if necessary.
INLINE TCounter size() const noexcept
INLINE bool empty() const noexcept
INLINE Iterator< StorageType > begin() noexcept
void insert(const SharedToken &owner, const Function< void(TArgs...)> &functor)
CallbackSet(const CallbackSet &other)
Iterator< const Callback > end() const
void operator()(TArgs... args) const
Calls all registered callbacks.
Iterator< const Callback > begin() const
Simple (forward) iterator over continuous array of objects of type T.
Function< void(TArgs...)> functor