Boost logo

Boost :

From: Edward Diener (eddielee_at_[hidden])
Date: 2006-06-13 21:27:44


Carlo Wood wrote:
> I've written something simular as is current talked about in
> the thread 'Interest in a runtime dynamic dispatch library', but
> since the callbacks are called when some event occurs, I call
> them 'event servers'. I suppose that might include a 'dispatcher',
> but I wouldn't have a clu which part ;). And to be honest, I can't
> think of much that makes this useful without the whole thing.
>
> The concept of my 'event servers' is the following:
>
> The user declares(/derives) a class which represents an 'event server'.
> Each event server services events of a certain 'type'.
> In particular, the type of the data that is returned as parameter
> of the callback function is fixed per event server (though totally
> arbitrary per event server class). I call this 'the event type'.
>
> Thus,
>
> FooEventServer foo_event_server;

Look at Boost Signals. It allows any function to trigger an event of any
type and it allows any function of the correct type to handle the event.
By "function" one means a free function, member function, or function
object. It has no restrictions as to the class whose member function
triggers the event or the class whose member function handles the event.

This is not to say that your concept is not a valuable one but just that
Boost Signal has a flexibility which many programmers may want in an
event dispatching/event handling system, as opposed to a more
restrictive yet more focused system.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk