Runtime dynamic dispatcher [was: Overload V2]

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 ! 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? Thanks Marco

Hey Marco! On Thu, Mar 27, 2008 at 2:48 AM, Marco Costalba <mcostalba@gmail.com> 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@gmail.com] [+63 928 7291459] [+1 408 4049523]

On Thu, Mar 27, 2008 at 10:25 PM, Dean Michael Berris <mikhailberis@gmail.com> wrote:
Hey Marco!
It would be nice if you'd like to put in your implementation into the RDDL and let me know how you find it. :)
Sorry for the silly question, but what is a RDDL ? Thanks Marco

On Fri, Mar 28, 2008 at 8:09 PM, Marco Costalba <mcostalba@gmail.com> wrote:
On Thu, Mar 27, 2008 at 10:25 PM, Dean Michael Berris <mikhailberis@gmail.com> wrote:
Hey Marco!
It would be nice if you'd like to put in your implementation into the RDDL and let me know how you find it. :)
Sorry for the silly question, but what is a RDDL ?
Oh, sorry. I was in a hurry -- RDDL stands for Runtime Dynamic Dispatch Library. :) -- Dean Michael C. Berris Software Engineer, Friendster, Inc. [http://blog.cplusplus-soup.com] [mikhailberis@gmail.com] [+63 928 7291459] [+1 408 4049523]

On Mon, Mar 31, 2008 at 1:40 PM, Dean Michael Berris <mikhailberis@gmail.com> wrote:
Sorry for the silly question, but what is a RDDL ?
Oh, sorry. I was in a hurry -- RDDL stands for Runtime Dynamic Dispatch Library. :)
I knew it was a dumb question ;-) I have downloaded boost 1.35 and dispatcher code from sourceforge subversion repository. It seem a good point to "inject" my overload implementation is the dispatcher class functor: overload it seems, more or less naturally, should replace that... Am I starting wrong? Thanks Marco

Hi Marco, On Mon, Mar 31, 2008 at 3:56 PM, Marco Costalba <mcostalba@gmail.com> wrote:
On Mon, Mar 31, 2008 at 1:40 PM, Dean Michael Berris <mikhailberis@gmail.com> wrote:
Sorry for the silly question, but what is a RDDL ?
Oh, sorry. I was in a hurry -- RDDL stands for Runtime Dynamic Dispatch Library. :)
I knew it was a dumb question ;-)
I have downloaded boost 1.35 and dispatcher code from sourceforge subversion repository.
It seem a good point to "inject" my overload implementation is the dispatcher class functor: overload it seems, more or less naturally, should replace that...
Am I starting wrong?
If you're set out to replace Boost.Function, then maybe you would replace class functor. However, here are the issues you'll face: 1. You're going to either have to change the implementation of the registry, so that the signature parameter becomes a sequence of signatures instead of just a single signature. This is what you'll have to do if you're out to replace Boost.Function -- which doesn't make much sense as of the moment. 2. You will eventually have to distinguish the registry implementation of an overloaded dispatcher from a single-signature dispatcher. This is because it doesn't make much sense (or any sense) to use an overloaded dispatcher from a single-signature dispatcher. We can take the discussion off-list if you're interested in moving forward. Have a good week ahead. -- Dean Michael C. Berris Software Engineer, Friendster, Inc. [http://blog.cplusplus-soup.com] [mikhailberis@gmail.com] [+63 928 7291459] [+1 408 4049523]

Hi Marco, On Mon, Mar 31, 2008 at 3:56 PM, Marco Costalba <mcostalba@gmail.com> wrote:
On Mon, Mar 31, 2008 at 1:40 PM, Dean Michael Berris <mikhailberis@gmail.com> wrote:
Sorry for the silly question, but what is a RDDL ?
Oh, sorry. I was in a hurry -- RDDL stands for Runtime Dynamic Dispatch Library. :)
I knew it was a dumb question ;-)
I have downloaded boost 1.35 and dispatcher code from sourceforge subversion repository.
It seem a good point to "inject" my overload implementation is the dispatcher class functor: overload it seems, more or less naturally, should replace that...
Am I starting wrong?
If you're set out to replace Boost.Function, then maybe you would replace class functor. However, here are the issues you'll face: 1. You're going to either have to change the implementation of the registry, so that the signature parameter becomes a sequence of signatures instead of just a single signature. This is what you'll have to do if you're out to replace Boost.Function -- which doesn't make much sense as of the moment. 2. You will eventually have to distinguish the registry implementation of an overloaded dispatcher from a single-signature dispatcher. This is because it doesn't make much sense (or any sense) to use an overloaded dispatcher from a single-signature dispatcher. We can take the discussion off-list if you're interested in moving forward. Have a good week ahead. -- Dean Michael C. Berris Software Engineer, Friendster, Inc. [http://blog.cplusplus-soup.com] [mikhailberis@gmail.com] [+63 928 7291459] [+1 408 4049523]
participants (2)
-
Dean Michael Berris
-
Marco Costalba