[alsa-devel] ALSA C++ API updated for 1.0.16

Michael Gerdau mgerdau at tiscali.de
Tue Feb 26 15:49:50 CET 2008


> > ALSA_HPP_CLASS& set_##name(...) { ...; return *this; }\
> 
> Is there a reason why you return the object itself?  Usually, returning
> an object implies that that object is a _different_ object with the
> setting applied, which would mean that the original object was _not_
> changed, but that isn't true here.

I'm not an OO design guru, but at least IOC (IBM OpenClass; it used to
be a rather powerful multiplatform GUI framework - before they made it
AIX only) used this very paradigma all over the place.

You were supposed to write statements like:
  obj.method1().method2().method3().___.method_n();

At least that's what all their example code looked like.

Best,
Michael
-- 
 Michael Gerdau       email: mgerdau at tiscali.de
 GPG-keys available on request or at public keyserver
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20080226/fe5304fe/attachment.sig 


More information about the Alsa-devel mailing list