@@ -703,7 +703,54 @@ if (position < capacity) return buckets[position++]->value; else return NULL; +} +@end + +@implementation OFMapTableEnumeratorWrapper +- initWithEnumerator: (OFMapTableEnumerator*)enumerator_ + object: (id)object_ +{ + self = [super init]; + + enumerator = [enumerator_ retain]; + object = [object_ retain]; + + return self; +} + +- (void)dealloc +{ + [enumerator release]; + [object release]; + + [super dealloc]; +} + +- (id)nextObject +{ + id ret; + + @try { + ret = [enumerator nextValue]; + } @catch (OFEnumerationMutationException *e) { + @throw [OFEnumerationMutationException + exceptionWithClass: [object class] + object: object]; + } + + return ret; +} + +- (void)reset +{ + @try { + [enumerator reset]; + } @catch (OFEnumerationMutationException *e) { + @throw [OFEnumerationMutationException + exceptionWithClass: [object class] + object: object]; + } } @end