18 template<
class Signal,
class F>
21 return *
new Listener(*
new priv::Slot<Signal,F>(
id, forward<F>(f)),
obj,
id);
const void * obj() const
Get object instance for listener identification.
Definition: Listener.h:29
Combined intrusive/non-intrusive smart pointer. Can reference and share any object automatically...
Definition: SharedPtr.h:175
static Listener & create(F &&f, const void *obj=nullptr, const Id &id=idnull)
Construct with slot to receive Signal using function F. The object instance and id are used together ...
Definition: Listener.h:19
Reference-counted object for intrusive shared pointers.
Definition: SharedPtr.h:93
SharedPtr< Listener > Ptr
Definition: Listener.h:14
Holds a slot that can receive signals.
Definition: Listener.h:11
Objects that inherit from this class will use Alloc for new/delete ops.
Definition: Allocator.h:129
#define assert(...)
Forwards to assert_#args. See assert_1(), assert_2().
Definition: Debug.h:24
#define idnull
Null id.
Definition: Id.h:124
const Id & id() const
Get listener id.
Definition: Listener.h:31
SharedPtr< const Listener > ConstPtr
Definition: Listener.h:15
const void * _obj
Definition: Listener.h:39
Listener(SlotBase &slot, const void *obj, const Id &id)
Definition: Listener.h:34
Global allocator for small memory blocks. To provide a custom pool define SmallAllocator_createSingle...
Definition: SmallAllocator.h:23
Multicast receiver.
Definition: Signal.h:29
UniquePtr< SlotBase > _slot
Definition: Listener.h:36
virtual ~Listener()
Definition: Listener.h:24
Id _id
Definition: Listener.h:40
Holds a name string and its hashed value for fast comparison ops. See String Identifier.
Definition: Id.h:25
Pointer to a unique, non-shared, object. Finalizer is run upon destruction (deletes object by default...
Definition: SharedPtr.h:164
SlotBase & slot() const
Get slot.
Definition: Listener.h:27
Global Honeycomb namespace.