Class Clusters
Class Clusters
- Subject: Class Clusters
- From: Robert Lee Dotson <email@hidden>
- Date: Wed, 26 Jun 2002 12:05:13 -0400
I'm trying to find a way to create my own class cluster.
I'm trying to create a matrix-algebra library in cocoa that will work with three data types: long ints, floats, and doubles. All of the matrix classes will have the exact same interface, with the exception of the data types passed to the methods:
-(id)scalarMultiply:(long int)scalar
-(id)scalarMultiply:(float)scalar
-(id)scalarMultiply:(double)scalar
The only way I've found to do this is to create six classes: LCVIntMatrix, LCVFloatMatrix, and LCVDoubleMatrix (+ mutable counterparts) to handle this. But, I want my users to be ignorant of the implementation, and only want them to interface with the LCVMatrix class.
Apple's class cluster documentation is abysmal, since it only says 'this is a neat thing to do' but doesn't give any examples or guidelines, only examples of how to subclass a class cluster or using composite objects. How do I create an abstract class? How could I implement operator overloading to pass the various data types to the same method?
--Robert Lee Dotson
'Being pro- or anti-lobbying in itself is a sort of Gentlemen v. Players game. And in American History, it's a long time since the Gentlemen won a match.' --The Siege
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.