summaryrefslogtreecommitdiffstats
path: root/Classes/HJWeakMutableArray.h
diff options
context:
space:
mode:
Diffstat (limited to 'Classes/HJWeakMutableArray.h')
-rwxr-xr-xClasses/HJWeakMutableArray.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/Classes/HJWeakMutableArray.h b/Classes/HJWeakMutableArray.h
new file mode 100755
index 0000000..7637c91
--- /dev/null
+++ b/Classes/HJWeakMutableArray.h
@@ -0,0 +1,41 @@
+//
+// HJWeakMutableArray.h
+// hjlib
+//
+// Copyright Hunter and Johnson 2009, 2010, 2011
+// HJCache may be used freely in any iOS or Mac application free or commercial.
+// May be redistributed as source code only if all the original files are included.
+// See http://www.markj.net/hjcache-iphone-image-cache/
+
+#import <Foundation/Foundation.h>
+
+
+/*
+ A mutable array of weak references. Used so that we can hold 'back references' to objects
+ without preventing those objects from getting deallocated by normal memory management.
+ */
+@interface HJWeakMutableArray : NSObject {
+ NSMutableArray* array;
+}
+
++(HJWeakMutableArray*) arrayWithCapacity:(int)capacity;
+-(HJWeakMutableArray*) initWithCapacity:(int)capacity;
+
+- (void) addObject:(id)anObject;
+- (id) objectAtIndex:(int)i;
+- (id) findObject:(id)obj;
+- (void) removeObject:(id)obj;
+- (int) count;
+- (NSEnumerator*) objectEnumerator;
+
+@end
+
+
+@interface HJWeakMutableArrayEnumerator : NSEnumerator {
+ NSEnumerator* arrayEnum;
+}
+
+-(HJWeakMutableArrayEnumerator*)initWithInternalArray:(NSArray*)array;
+
+@end
+