Re: [LAD] Inter thread Communication: Design Approach

From: David Robillard <d@email-addr-hidden>
Date: Thu Sep 01 2011 - 23:30:12 EEST

On Thu, 2011-09-01 at 18:37 +0000, Fons Adriaensen wrote:
> On Thu, Sep 01, 2011 at 02:18:25PM -0400, David Robillard wrote:
>
> > If you're going to go with the inheritance route anyway, just use a
> > virtual ev->execute() method so the code for all events doesn't have to
> > be in the same place. Assuming you'll have enough that this is actually
> > a benefit anyway...
>
> That's assuming that the event's virtual execute() has access to
> all it needs. In all cases I've encountered that is not the case:
> the event triggers something in the context where it is received
> and processing it requires access to that context's data.
> It's a problem for which I don't know a clean C++ solution.

Sure, it would almost certainly not be a method with no parameters, most
likely you would pass some context object as a parameter which contains
all the necessary things.

-dr

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Fri Sep 2 00:15:02 2011

This archive was generated by hypermail 2.1.8 : Fri Sep 02 2011 - 00:15:02 EEST