Runtime Dynamic Dispatch (boost-dispatch)

Hi Everyone, I'm about to make a shameless plug about the runtime dispatch library I've been working on the past few months (mostly testing and using in a project), which I've uploaded to the vault: http://tinyurl.com/ycsq6n for everyone to check out and comment on. I've hosted the project at sourceforge, and the release files (and subversion repo) can be downloaded from: http://sourceforge.net/projects/dispatcher The latest release already contains a strategized_map type (as suggested earlier) which will later more or less turn into a `dynamic object reference dispatcher' which acts more like the dispatcher. Comments and insights will be most appreciated. Have a great day everyone! -- Dean Michael C. Berris C++ Software Architect Orange and Bronze Software Labs, Ltd. Co. web: http://software.orangeandbronze.com/ email: dean@orangeandbronze.com mobile: +63 928 7291459 phone: +63 2 8943415 other: +1 408 4049532 blogs: http://mikhailberis.blogspot.com http://3w-agility.blogspot.com http://cplusplus-soup.blogspot.com

On 10/18/06, Dean Michael Berris <mikhailberis@gmail.com> wrote:
I'm about to make a shameless plug about the runtime dispatch library I've been working on the past few months (mostly testing and using in a project), which I've uploaded to the vault: http://tinyurl.com/ycsq6n for everyone to check out and comment on.
I think this question was raised before, and I'm not sure if it was answered in a meaningful way so I'll ask it again. What is the difference between your dispatcher and a std::map<Key, boost::function<Prototype> >? -- Caleb Epstein

Hi Caleb, On 10/19/06, Caleb Epstein <caleb.epstein@gmail.com> wrote:
I think this question was raised before, and I'm not sure if it was answered in a meaningful way so I'll ask it again.
What is the difference between your dispatcher and a std::map<Key, boost::function<Prototype> >?
Okay, I think I answered this before, but I'll try answering it again. :-) First, the dispatcher allows you to define a stateful validation function/functor for the indexes used to access the dispatcher. That means, you can check and make sure that the index being used to access the registered functions are valid -- this is usually domain specific, and left as a template parameter to the dispatcher. There are examples in the documentation that comes with the downloadable file(s). Second, the dispatcher allows you to define a stateful routing strategy for "manipulating" the indexes as they are used to refer to the elements in the dispatcher. There's an example as to how you can use the routing strategy to implement a simple round-robin "hash". This functionality is usually domain specific, and is left as a template parameter to the dispatcher. The third difference is that it allows you a reusable, generic, and type-safe way of scheduling index invocations using the invoker interface. This allows you to do something like: typedef boost::dispatch::dispatcher<void(int, int), std::string> dispatcher_t dispatcher_t dispatcher_instance; // ... register your handlers here, or elsewhere ... dispatcher_t::invoke_(dispatcher_instance)(param1, param2) << "first" << "second" << "third"; Typical usage is for implementing a factory, using it for scheduling load distribution on a pool of threads, etc. A simple std::map<IndexType, boost::function<Prototype> > does not give you the above three facilities. I hope this answers your question. -- Dean Michael C. Berris C++ Software Architect Orange and Bronze Software Labs, Ltd. Co. web: http://software.orangeandbronze.com/ email: dean@orangeandbronze.com mobile: +63 928 7291459 phone: +63 2 8943415 other: +1 408 4049532 blogs: http://mikhailberis.blogspot.com http://3w-agility.blogspot.com http://cplusplus-soup.blogspot.com

Dean Michael Berris said: (by the date of Wed, 18 Oct 2006 22:24:09 +0800)
Hi Everyone,
I'm about to make a shameless plug about the runtime dispatch library I've been working on the past few months (mostly testing and using in a project), which I've uploaded to the vault: http://tinyurl.com/ycsq6n for everyone to check out and comment on.
can it be used for multimethods ? -- Janek Kozicki |
participants (3)
-
Caleb Epstein
-
Dean Michael Berris
-
Janek Kozicki