Archived
1

Started to Implement the Parser

This commit is contained in:
Kim Wittenburg
2014-09-06 01:54:15 +02:00
parent 6aafbf9d2e
commit 8df8317413
10 changed files with 570 additions and 16 deletions

34
MathPad/MPArrayCache.h Normal file
View File

@@ -0,0 +1,34 @@
//
// MPArrayCache.h
// MathPad
//
// Created by Kim Wittenburg on 31.08.14.
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
//
#import <Foundation/Foundation.h>
// A wrapper around NSCache to support index-based caches. Indexes are
// automatically adjusted to represent array-like behaviours.
@interface MPArrayCache : NSObject {
@private
NSCache *_cache;
}
- (id)init; /* designated initializer */
- (void)cacheObject:(id)object
forIndex:(NSUInteger)index;
- (id)cachedObjectForIndex:(NSUInteger)index;
- (void)clearCacheAtIndex:(NSUInteger)index
replacementLength:(NSUInteger)replacementLength;
- (void)clearCacheInRange:(NSRange)range
replacementLength:(NSUInteger)replacementLength;
- (void)replaceCachedObjectAtIndex:(NSUInteger)index
withObjects:(NSArray *)objects;
- (void)replaceCachedObjectsInRange:(NSRange)range
withObjects:(NSArray *)objects;
@end