Boost logo

Boost :

From: Dean Michael Berris (mikhailberis_at_[hidden])
Date: 2006-06-08 04:09:59


Hi Everyone,

Is there interest in a runtime dynamic index driven dispatch library
here? The concept of the library is a bit simple, and is somewhat
related to the Boost.Signals library -- but different in intent.

Basically the main component of the library is a dynamic callback
registry/dispatcher object which maintains callback references to
nullary free functions and nullary functors. To illustrate how the
library is intended to be used, the following code snippets have been
provided:

//set up a registry
dispatch::dispatcher<void (), int> callbacks;

// register a nullary free function f to index 0
callbacks[0] = f;

// bind arguments to a single argument function p to index 1
callbacks[1] = boost::bind(p, 1);

// get user input then execute appropriate callback
int i;
cin >> i;
callbacks[i]();

Feedback would be most appreciated.

Thanks and have a great day everyone!

-- 
Dean Michael C. Berris
C/C++ Software Architect
Orange and Bronze Software Labs
http://3w-agility.blogspot.com/
http://cplusplus-soup.blogspot.com/
Mobile: +639287291459
Email: dean [at] orangeandbronze [dot] com

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