|
Boost : |
From: Dean Michael Berris (mikhailberis_at_[hidden])
Date: 2008-03-27 17:25:32
Hey Marco!
On Thu, Mar 27, 2008 at 2:48 AM, Marco Costalba <mcostalba_at_[hidden]> wrote:
> While I was reading the very nice Dynamic Dispatcher Library by Dean
> Michael Berris (dispatcher-0.2.zip in Vault) I realized that it is
> possible to magically ;-) get a runtime dynamic dispatcher out of the
> overload library simply using a container to store overloads !
>
There's a much more updated version in
http://dispatcher.sourceforge.net/ -- there's also a subversion
repository from which you can get the absolute latest (and most
tested) version of the dispatcher library.
> More, the dispatcher you get is multi-signature (heterogeneous
> function types), instead of homogeneous function type as is the Dean's
> one.
>
> The key enabler is that class overload has value semantic.
>
> Of course with the Dean's one you get more, in particularly you get:
>
> - Strategized Index Validation
>
> - Strategized Routing
>
> - Scheduled/Sequenced Invocation
>
> But if you are not interested in this additional features you can give
> overload a try. I have updated the docs and the examples in Vault
> (overload_26_3_2008.zip) to reflect this new "discovery" ;-)
>
> Dean, I' didn't realized this use of overload as a dispatcher until
> reading your code, are you still interested in a multi-signature
> dispatcher?
>
Yes, I'm still interested in a multi-signature dispatcher. I'm
actually just waiting for "free time" to actually use the
Boost.Overload implementation which uses Boost.Functions inside (for
familiarity's sake) for a multi-signature dispatcher, which should
really be trivial to implement.
It would be nice if you'd like to put in your implementation into the
RDDL and let me know how you find it. :)
One thing I've been playing around is to forgo my Functor class
wrapper which encapsulated a Boost.Function inside, and "simplify" it
into an std::map<> conforming interface that allowed for strategized
index validation/routing, and sequenced invocations. That _may_ be a
bit more involved, but I think would be a worthy effort someday. ;)
-- Dean Michael C. Berris Software Engineer, Friendster, Inc. [http://blog.cplusplus-soup.com] [mikhailberis_at_[hidden]] [+63 928 7291459] [+1 408 4049523]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk