forked from pmougin/F-Script
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathArrayRepId.h
61 lines (49 loc) · 2.14 KB
/
ArrayRepId.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* ArrayRepId.h Copyright (c) 1998-2009 Philippe Mougin. */
/* This software is open source. See the license. */
/*
Provides the class for the internal representation of FSArray of ids.
*/
#import <Foundation/Foundation.h>
#import "FSNSObject.h"
#import "ArrayRep.h"
@class FSBlock;
@interface ArrayRepId: NSMutableArray <ArrayRep>
{
NSUInteger retainCount; // optimized reference counting
@public
__strong id *t; // The actual array of ids
NSUInteger count; // the number of element in the array
NSUInteger capacity; // the size of the memory block pointed by t
}
///////////////////////////////////// USER METHODS SUPPORT
- (id)at:(id)index put:(id)elem;
- (id)indexWithArray:(FSArray *)index;
- (FSArray *)rotatedBy:(NSNumber *)operand;
///////////////////////////////////// OTHER METHODS
- (void)addObject:(id)anObject;
- (void)addObjectsFromFSArray:(FSArray *)otherArray;
- (ArrayRepId *) asArrayRepId;
- (id)copyWithZone:(NSZone *)zone;
- (NSUInteger)count;
- (void *)dataPtr;
- (void)dealloc;
- (NSString *)descriptionLimited:(NSUInteger)nbElem;
- (NSUInteger)indexOfObject:(id)anObject inRange:(NSRange)range identical:(BOOL)identical;
- (id)init;
//- initFrom:(unsigned)from to:(unsigned)to step:(unsigned)step;
- (id)initFilledWith:(id)elem count:(NSUInteger)nb; // contract: a return value of nil means not enough memory
- (id)initWithCapacity:(NSUInteger)aNumItems; // designated initializer
// contract: a return value of nil means not enough memory
- (id)initWithObjects:(id *)objects count:(NSUInteger)nb;
- (id)initWithObjectsNoCopy:(id *)tab count:(NSUInteger)nb;
- (void)insertObject:anObject atIndex:(NSUInteger)index;
- (id)objectAtIndex:(NSUInteger)index;
- (void)removeLastElem;
- (void)removeLastObject;
- (void)removeElemAtIndex:(NSUInteger)index;
- (void)removeObjectAtIndex:(NSUInteger)index;
- (void)replaceObjectAtIndex:(NSUInteger)index withObject:(id)anObject;
- (NSArray *)subarrayWithRange:(NSRange)range;
- (enum ArrayRepType)repType;
- (FSArray *)where:(NSArray *)booleans; // precondition: booleans is actualy an array and is of same size as the receiver
@end