Re: Setting the Number of Channels
Re: Setting the Number of Channels
- Subject: Re: Setting the Number of Channels
- From: email@hidden
- Date: Thu, 19 Jun 2003 13:54:41 -0700
Brian Willoughby writes:
>
You're right, Bill, it is easy enough to use the C++
>
CAStreamBasicDescription class within an ObjC project, but it sure
>
slows down the compiler. I remember someone else complaining about
>
how slow the ObjC++ compiler is, and now that I am using
>
CAStreamBasicDescription in a Cocoa app, I know just what they're
>
talking about. This really hurts rapid prototyping.
When I wrap a C++ object in ObjC, I declare it as a void* in the ObjC
header.
E.g.:
typedef void* CPPObject;
@interface ObjCWrapper : NSObject {
CPPObject _cppObject;
}
- (BOOL)doSomethingToCPPObject;
@end
In ObjCWrapper.mm you need to cast _cppObject before working with it,
but it prevents the ObjC++ from "polluting" the rest of the
project. This way you can keep the rest of your files as pure ObjC .m
files.
Using this convention, you only take the ObjC++ compilation speed hit
when modifying the .mm file, not across the entire project.
- sekhar
--
C. Ramakrishnan email@hidden
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.