On 09/01/2011 10:37 PM, Harry van Haaren wrote:
Hmm, i used Functors and Closures in jass for passing commands to the
realtime thread and wrote a small article about it.
http://178.63.2.231/~tapas/wordpress/?page_id=45
Coupled with a poor man's garbage collection scheme using
boost::shared_ptr's this was a quite quick way to hack up jass. There's
no need to introduce new types if you want to do something new. Actually
there's only exactly one type that gets passed through the command
ringbuffer and that is boost::function. See e.g.
https://github.com/fps/jass/blob/master/engine.h
and
https://github.com/fps/jass/blob/master/main_window.h
I agree that this method doesn't necessarily scale to other kind of
applications and it also might be a bit more error prone than a well
thought out event system using types that cover all bases, it does make
for a quite good solution for an app of the scope of jass..
Have fun,
Flo
> -Harry
Taking a look..
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev
LINUX® is a registered trademark of Linus Torvalds in the USA and other countries.
Linuxaudio.org logo copyright Thorsten Wilms © 2006.
Hosting provided by the Virginia Tech Department of Music and DISIS.