Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
OOCacheManager.h
Go to the documentation of this file.
1/*
2
3OOCacheManager.h
4By Jens Ayton
5
6Singleton class responsible for handling Oolite's data cache.
7The cache manager stores arbitrary property lists in separate namespaces
8(referred to simply as caches). The cache is emptied if it was created with a
9different verison of Oolite, or if it was created on a system with a different
10byte sex.
11
12Oolite
13Copyright (C) 2004-2013 Giles C Williams and contributors
14
15This program is free software; you can redistribute it and/or
16modify it under the terms of the GNU General Public License
17as published by the Free Software Foundation; either version 2
18of the License, or (at your option) any later version.
19
20This program is distributed in the hope that it will be useful,
21but WITHOUT ANY WARRANTY; without even the implied warranty of
22MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23GNU General Public License for more details.
24
25You should have received a copy of the GNU General Public License
26along with this program; if not, write to the Free Software
27Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
28MA 02110-1301, USA.
29
30*/
31
32#import "OOCocoa.h"
33
34
35@interface OOCacheManager: NSObject
36{
37@private
38 NSMutableDictionary *_caches;
41 BOOL _dirty;
42}
43
44+ (OOCacheManager *)sharedCache;
45
46- (id)objectForKey:(NSString *)inKey inCache:(NSString *)inCacheKey;
47- (void)setObject:(id)inElement forKey:(NSString *)inKey inCache:(NSString *)inCacheKey;
48- (void)removeObjectForKey:(NSString *)inKey inCache:(NSString *)inCacheKey;
49- (void)clearCache:(NSString *)inCacheKey;
50- (void)clearAllCaches;
51- (void) reloadAllCaches;
52
53- (void)setAllowCacheWrites:(BOOL)flag;
54
55- (NSString *)cacheDirectoryPathCreatingIfNecessary:(BOOL)create;
56
57- (void)flush;
58- (void)finishOngoingFlush; // Wait for flush to complete. Does nothing if async flushing is disabled.
59
60@end
NSMutableDictionary * _caches