
On 2 December 2016 at 20:00, Nat Goodspeed
On Fri, Dec 2, 2016 at 1:31 PM, Emil Dotchevski
wrote: See http://zajo.github.io/boost-synapse/questions_and_answers.html.
Thanks.
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.
So, the library contains something like a thread_local unordered_map whose keys are arbitrary pointers?
Last time I checked, it was a static map if I remember correctly, inside a function. While I like the basic idea of Synapse, I do not like that I do not have any control as to where the observers are stored. It was my only complain at the initial presentation of the library. I didn't have time yet to look at this version of the library (I will soon), but basically if it could let me add an optional parametter to the connect so that I provide the storage (which lifetime and maybe implementtion I would guarantee myself), it would allow me to control allocations of these stored connections.
From what I read last time it looked possible but maybe it is not.
A. Joël Lamotte