Started to Implement the Parser
This commit is contained in:
34
MathPad/MPArrayCache.h
Normal file
34
MathPad/MPArrayCache.h
Normal 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
|
||||
Reference in New Issue
Block a user