Re: Cocoa/Objective-C's Relative Performance
Re: Cocoa/Objective-C's Relative Performance
- Subject: Re: Cocoa/Objective-C's Relative Performance
- From: Steven Kramer <email@hidden>
- Date: Fri, 14 Jan 2005 12:55:27 +0100
Op 13-jan-05 om 15:23 heeft Clark Cox het volgende geschreven:
Alan Odgaard has written ObjC wrappers for C++ STL containers (whose
operation complexities are well-specified and whose implementations
are
often close to optimal, or at least better than what you or I could
come up with on a short timescale ;-).
http://www.top-house.dk/~aae0030/cocoastl/
That looks more like *STL* wrappers to *Cocoa* containers, which seems
to be the opposite of what the OP needs.
And right you are. To use STL containers for Cocoa objects you could
probably get away with a light wrapper. Typing in mail, but, in the
absence of Obj-C exceptions, you might use this
class OCWrapper
{
public:
OCWrapper (id inObject) : object ([inObject retain]) { }
~OCWrapper () { [object release]; }
id Object () { return object; }
private:
id object;
};
to be able to do this:
std::vector < OCWrapper >
And maybe throw in a few of these later?
bool operator == (OCWrapper const& inOther) { return [Object ()
isEqual: inOther.Object ()]; }
Somebody has probably been there and back already, though. Time for
some googling, I guess.
Regards,
Steven Kramer
--
email@hidden
http://sprintteam.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden