Home » U++ Library support » U++ Callbacks and Timers » Possible improvements to U++ callbacks
Possible improvements to U++ callbacks [message #18242] |
Thu, 18 September 2008 19:34 |
cas_
Messages: 20 Registered: July 2008 Location: Poland
|
Promising Member |
|
|
I know there are probably more urgent things to deal with (like switching to some modern graphics backend, documentation improvements and perhaps more decent debugging support on Linux), but anyway I've decided to share some thoughts.
U++ supports callbacks through Callback* family of templates. They are simple, effective and sufficient in most situations. However, there is very little support for connecting multiple functions to single callback object - only chaining is supported, as far as I know. Unfortunately, this approach makes it hard to disconnect a previously connected callback. What if you delete an object, which is pointed by a callback placed in some chain? Some existing signal/slot libraries (like libsigc++) give you even possibility to handle such situations automatically (in sigc++ it's enough to derive your class from sigc::trackable).
What do you think about improving U++ callbacks in this way? Would you find it useful? It should be possible to extend current implementation without losing backward compatibility.
|
|
|
|
|
|
Goto Forum:
Current Time: Sat Apr 20 11:30:08 CEST 2024
Total time taken to generate the page: 0.01594 seconds
|