Re: Needed : set class for Cocoa

2009-02-06 Thread Tommy Nordgren
On Feb 6, 2009, at 2:50 AM, Sean McBride wrote: Tommy Nordgren (tommy.nordg...@comhem.se) on 2009-02-06 7:55 PM said: I have decided to do an implementation myself, as an objective c++ wrapper to std::set. I want to use the class to aid in destruction of directed cyclical object graphs, in d

Re: Needed : set class for Cocoa

2009-02-06 Thread Adam R. Maxwell
On Feb 6, 2009, at 8:47 AM, Sean McBride wrote: On 2/5/09 7:57 PM, Adam R. Maxwell said: The nice part is that it can then be cast to an NSMutableSet. Are you sure? I thought toll-free bridging only worked if you don't use custom CF callbacks. IAC, I don't think the OP said he needed to

Re: Needed : set class for Cocoa

2009-02-06 Thread Sean McBride
On 2/5/09 7:57 PM, Adam R. Maxwell said: >>> I have decided to do an implementation myself, as an objective c++ >>> wrapper to >>> std::set. I want to use the class to aid in destruction of >>> directed cyclical object graphs, >>> in dual mode frameworks. >> >> "Dual mode" as in both Retain-Relea

Re: Needed : set class for Cocoa

2009-02-05 Thread Adam R. Maxwell
On Feb 5, 2009, at 5:50 PM, Sean McBride wrote: Tommy Nordgren (tommy.nordg...@comhem.se) on 2009-02-06 7:55 PM said: I have decided to do an implementation myself, as an objective c++ wrapper to std::set. I want to use the class to aid in destruction of directed cyclical object graphs, in d

Re: Needed : set class for Cocoa

2009-02-05 Thread Sean McBride
Tommy Nordgren (tommy.nordg...@comhem.se) on 2009-02-06 7:55 PM said: >I have decided to do an implementation myself, as an objective c++ >wrapper to >std::set. I want to use the class to aid in destruction of >directed cyclical object graphs, >in dual mode frameworks. "Dual mode" as in both Ret

Re: Needed : set class for Cocoa

2009-02-05 Thread Tommy Nordgren
On Feb 6, 2009, at 1:18 AM, Sean McBride wrote: Tommy Nordgren (tommy.nordg...@comhem.se) on 2009-02-06 6:29 PM said: Do anyone know of a set container class for Cocoa objects, that use pointer semantics. Like this: NSMutableString * s1 = [@"Hello" mutableCopy], * s2 = [@"Hello" mu

Re: Needed : set class for Cocoa

2009-02-05 Thread Peter N Lewis
At 0:29 +0100 6/2/09, Tommy Nordgren wrote: Do anyone know of a set container class for Cocoa objects, that use pointer semantics. You could always just use the C++ std::set Not Cocoa, as such, but has the semantics you desire. Enjoy, Peter

Re: Needed : set class for Cocoa

2009-02-05 Thread Sean McBride
Tommy Nordgren (tommy.nordg...@comhem.se) on 2009-02-06 6:29 PM said: >Do anyone know of a set container class for Cocoa objects, that use >pointer semantics. > >Like this: > NSMutableString * s1 = [@"Hello" mutableCopy], * s2 = [@"Hello" >mutableCopy]; > > Somesetclass *someSet = [[

Re: Needed : set class for Cocoa

2009-02-05 Thread Quincey Morris
On Feb 5, 2009, at 15:59, Quincey Morris wrote: Alternatively, you can use NSSet with values "encoded" by [NSValue valueWithPointer: someObject], and "decoded" by [someValueObject pointerValue]. Er, sorry, if you're going that route, it would be slightly more correct to use [NSValue value

Re: Needed : set class for Cocoa

2009-02-05 Thread Jason Foreman
You could throw the pointers into NSValue objects and store those in an NS[Mutable]Set.. Jason On Feb 5, 2009, at 5:29 PM, Tommy Nordgren wrote: Do anyone know of a set container class for Cocoa objects, that use pointer semantics. Like this: NSMutableString * s1 = [@"Hello" muta

Re: Needed : set class for Cocoa

2009-02-05 Thread Quincey Morris
On Feb 5, 2009, at 15:29, Tommy Nordgren wrote: Do anyone know of a set container class for Cocoa objects, that use pointer semantics. Like this: NSMutableString * s1 = [@"Hello" mutableCopy], * s2 = [@"Hello" mutableCopy]; Somesetclass *someSet = [[Somesetclass alloc]init];

Re: Needed : set class for Cocoa

2009-02-05 Thread Ken Thomases
On Feb 5, 2009, at 5:29 PM, Tommy Nordgren wrote: Do anyone know of a set container class for Cocoa objects, that use pointer semantics. Like this: NSMutableString * s1 = [@"Hello" mutableCopy], * s2 = [@"Hello" mutableCopy]; Somesetclass *someSet = [[Somesetclass alloc]init];

Re: Needed : set class for Cocoa

2009-02-05 Thread Graham Cox
On 6 Feb 2009, at 10:44 am, Jordan Breeding wrote: NSSet/NSMutableSet They don't compare by pointer, they compare using -isEqual:, which returns YES for the two strings that the OP indicated. I can only suggest wrapping the objects in an NSValue using [NSValue valueWithPointer:]; thoug

Re: Needed : set class for Cocoa

2009-02-05 Thread Jordan Breeding
On 05 Feb, 2009, at 17:44, Jordan Breeding wrote: On 05 Feb, 2009, at 17:29, Tommy Nordgren wrote: Do anyone know of a set container class for Cocoa objects, that use pointer semantics. Like this: NSMutableString * s1 = [@"Hello" mutableCopy], * s2 = [@"Hello" mutableCopy]; S

Re: Needed : set class for Cocoa

2009-02-05 Thread Jordan Breeding
On 05 Feb, 2009, at 17:29, Tommy Nordgren wrote: Do anyone know of a set container class for Cocoa objects, that use pointer semantics. Like this: NSMutableString * s1 = [@"Hello" mutableCopy], * s2 = [@"Hello" mutableCopy]; Somesetclass *someSet = [[Somesetclass alloc]init];

Needed : set class for Cocoa

2009-02-05 Thread Tommy Nordgren
Do anyone know of a set container class for Cocoa objects, that use pointer semantics. Like this: NSMutableString * s1 = [@"Hello" mutableCopy], * s2 = [@"Hello" mutableCopy]; Somesetclass *someSet = [[Somesetclass alloc]init]; [someSet add:s1]; [someSet add: s2];