Re: Has AudioUnits actually been tried in carbon?
Re: Has AudioUnits actually been tried in carbon?
- Subject: Re: Has AudioUnits actually been tried in carbon?
- From: Doug Wyatt <email@hidden>
- Date: Thu, 27 Sep 2001 09:16:29 -0400
C++ has a number of problems that make it difficult to use as an API.
The most significant is the fragile base class problem -- if we publish
a class and then later change its implementation, it is likely to break
binary compatibility with any derived classes, unless we take extreme
care to make things otherwise. One really insidious example is that if
you invoke "new ClassDefinedInALibrary;" sizeof(ClassDefinedInALibrary)
is compiled into the *client* side of the code; if I were to add a
member variable to ClassDefinedInALibrary and build a new version of the
library, no clients would be allocating objects of the correct size.
Yes, there are ways around every problem like this that comes up, but
it's just easier to stick with C API's.
And yes, most C++ programmers will write wrapper classes around our
API's, which is fine and good. At least our API's have a strong
"object-oriented C" flavor, so it should be fairly obvious how to wrap
them in C++ effectively. :-)
Doug
On Thursday, September 27, 2001, at 06:09 , Fokke de Jong wrote:
Why are there no c++ headers? It seems a bit strange to me that if all
the internal code is written in c++ that the headers have to be in c.
Ok I can understand that a lot of people prefer c pragramming, but at
the moment I'm using c++ wrapper classes for stuff that was written in
c++ anyway.
--
Doug Wyatt
work: email@hidden (CoreAudio)
personal: email@hidden
http://www.sonosphere.com
"Music happens when you disrupt space in a secure and confident manner."
-- One of the members of the Art Ensemble of Chicago