18 #define SIGNAL_DECL(BaseClass) \
19 static mt_global(const String, _signalBase, (#BaseClass));
22 #define SIGNAL(Name, Param) \
23 struct Name : Signal<void Param> { static mt_global(const Id, id, (sout() << _signalBase() << "::"#Name)); };
35 const Id&
id()
const {
return _id; }
45 template<
class Signal,
class Seq = mt::make_
idxseq<Signal::arity>>
47 template<
class Signal,
szt... Seq>
48 struct SlotSignal<Signal,mt::
idxseq<Seq...>> : SlotBase
50 SlotSignal(
const Id&
id) : SlotBase(id, Signal::id()) {}
51 virtual void operator()(
const typename Signal::template param<Seq>&... args) = 0;
54 template<
class Signal,
class F,
class Seq = mt::make_
idxseq<Signal::arity>>
56 template<
class Signal,
class F,
szt... Seq>
57 struct Slot<Signal,F,mt::
idxseq<Seq...>> :
public SlotSignal<Signal>
59 typedef SlotSignal<Signal> Super;
61 Slot(
const Id&
id, F&& f) : Super(id), _f(forward<F>(f)) {}
63 virtual void operator()(
const typename Signal::template param<Seq>&... args)
const Id & id() const
Definition: Signal.h:35
SlotBase(const Id &id, const Id &signalId)
Definition: Signal.h:32
const Id & signalId() const
Definition: Signal.h:36
virtual ~SlotBase()
Definition: Signal.h:33
Objects that inherit from this class will use Alloc for new/delete ops.
Definition: Allocator.h:129
Multicast sender.
Definition: Signal.h:26
Get function type traits.
Definition: Meta.h:227
size_t szt
Size type, shorthand for size_t.
Definition: Core.h:90
Sig_ Sig
Definition: Signal.h:26
Multicast receiver.
Definition: Signal.h:29
Holds a name string and its hashed value for fast comparison ops. See String Identifier.
Definition: Id.h:25
Global Honeycomb namespace.