Subject: Re: [boost] Interest in non-intrusive signal/slot lib?
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2015-05-20 02:35:09
On 20/05/2015 18:21, Vicente J. Botet Escriba wrote:
> These links give me differences not the advantages. Could you be more
> precise? Could you show how things are done with each library and the
> associated performances? What can not be done with Boost.Signal2 that
> can be done with your library?
The main distinguishing feature is the non-intrusiveness, ie. the
ability to emit an event that claims a raw OS/library handle as its source.
It means that at least with regard to event-handling, there is no need
to wrap this handle in a representative object that includes the signal
support. (ie. the way you'd do an HWND-with-events with Signals2 is by
creating a "Window" class that contains an HWND and the signal
instances. But then you also usually need the plumbing to look up an
existing Window by HWND or create a new one -- whereas none of that is
needed in Synapse.)
TBH though in the presented examples I would doubt that signal/event
handling is the only concern (in a real application), so you might end
up creating those Window objects anyway, in which case the appeal
lessens. So I can't personally think of any cases where I would use
this instead of Signals2 or libsigc++ or similar.
(BTW a better comparison would be against Signal, not Signal2; Synapse
is non-thread-safe like the former and unlike the latter.)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk