Subject: Re: [boost] Synapse library review starts today December 2
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2016-12-02 13:31:47
On Fri, Dec 2, 2016 at 8:37 AM, Nat Goodspeed <nat_at_[hidden]> wrote:
> I looked through the first page of the linked documentation, and I'm
> confused about how this is better than Boost.Signals2. The documentation
> uses the word "non-intrusive" a number of times without clarifying in what
> sense the existing Signals library is "intrusive."
In Synapse the emitter is simply a "meeting place": using emit<foo>(p) to
emit the signal foo from the object p will call any functions that were
connected by connect<foo>(p,f), where p is simply (the address of) any
object (of any type whatsoever) you have in your program.
For example, on Windows you could use Synapse signals to communicate
messages from a WindowProc, by emitting signals directly from the HWND
handle, as shown in this example:
Note that the WindowProc gets the HWND but there is no mechanism to pass in
another object to be used specifically as an emitter.
As another example, you could emit from a std FILE object, to communicate
progress to a UI, as shown under "Emitting signals from objects of
3rd-party types" in http://zajo.github.io/boost-synapse/Tutorial.html.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk