Andre Poenitz wrote:
On Tue, Sep 19, 2006 at 10:30:11AM +0200, Abdelrazak Younes wrote:
Unfortunately, there's no obvious better solution than these big, ugly
switch statements. At least, not in C++.
There is one elegant solution IMHO, array of function pointers. This
would mean that each LFUN (or a group of LFUN) would have to be
encapsulated in a method. But this is something that should be done anyway.
If you're there you can as well call the method a 'slot' and connect it
to an, erm, 'signal'.
I would be OK with that but only if we sanitize a bit how the lfun are
used. Emitting a dozen boost signal on a simple keystroke won't be fast
I guess. On these cases, calling out these "slots" directly without
passing through the LFUN machinery would be the right thing to do.
Abdel.