Rename the caches manager without `Web` prefix
This commit is contained in:
parent
5426a720f7
commit
bee5425078
|
@ -520,18 +520,18 @@
|
|||
32D122272080B2EB003685A3 /* SDWebImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 32D1221B2080B2EB003685A3 /* SDWebImageCache.m */; };
|
||||
32D122282080B2EB003685A3 /* SDWebImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 32D1221B2080B2EB003685A3 /* SDWebImageCache.m */; };
|
||||
32D122292080B2EB003685A3 /* SDWebImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 32D1221B2080B2EB003685A3 /* SDWebImageCache.m */; };
|
||||
32D1222A2080B2EB003685A3 /* SDWebImageCachesManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 32D1221C2080B2EB003685A3 /* SDWebImageCachesManager.m */; };
|
||||
32D1222B2080B2EB003685A3 /* SDWebImageCachesManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 32D1221C2080B2EB003685A3 /* SDWebImageCachesManager.m */; };
|
||||
32D1222C2080B2EB003685A3 /* SDWebImageCachesManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 32D1221C2080B2EB003685A3 /* SDWebImageCachesManager.m */; };
|
||||
32D1222D2080B2EB003685A3 /* SDWebImageCachesManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 32D1221C2080B2EB003685A3 /* SDWebImageCachesManager.m */; };
|
||||
32D1222E2080B2EB003685A3 /* SDWebImageCachesManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 32D1221C2080B2EB003685A3 /* SDWebImageCachesManager.m */; };
|
||||
32D1222F2080B2EB003685A3 /* SDWebImageCachesManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 32D1221C2080B2EB003685A3 /* SDWebImageCachesManager.m */; };
|
||||
32D122302080B2EB003685A3 /* SDWebImageCachesManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 32D1221D2080B2EB003685A3 /* SDWebImageCachesManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
32D122312080B2EB003685A3 /* SDWebImageCachesManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 32D1221D2080B2EB003685A3 /* SDWebImageCachesManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
32D122322080B2EB003685A3 /* SDWebImageCachesManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 32D1221D2080B2EB003685A3 /* SDWebImageCachesManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
32D122332080B2EB003685A3 /* SDWebImageCachesManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 32D1221D2080B2EB003685A3 /* SDWebImageCachesManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
32D122342080B2EB003685A3 /* SDWebImageCachesManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 32D1221D2080B2EB003685A3 /* SDWebImageCachesManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
32D122352080B2EB003685A3 /* SDWebImageCachesManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 32D1221D2080B2EB003685A3 /* SDWebImageCachesManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
32D1222A2080B2EB003685A3 /* SDImageCachesManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 32D1221C2080B2EB003685A3 /* SDImageCachesManager.m */; };
|
||||
32D1222B2080B2EB003685A3 /* SDImageCachesManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 32D1221C2080B2EB003685A3 /* SDImageCachesManager.m */; };
|
||||
32D1222C2080B2EB003685A3 /* SDImageCachesManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 32D1221C2080B2EB003685A3 /* SDImageCachesManager.m */; };
|
||||
32D1222D2080B2EB003685A3 /* SDImageCachesManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 32D1221C2080B2EB003685A3 /* SDImageCachesManager.m */; };
|
||||
32D1222E2080B2EB003685A3 /* SDImageCachesManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 32D1221C2080B2EB003685A3 /* SDImageCachesManager.m */; };
|
||||
32D1222F2080B2EB003685A3 /* SDImageCachesManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 32D1221C2080B2EB003685A3 /* SDImageCachesManager.m */; };
|
||||
32D122302080B2EB003685A3 /* SDImageCachesManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 32D1221D2080B2EB003685A3 /* SDImageCachesManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
32D122312080B2EB003685A3 /* SDImageCachesManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 32D1221D2080B2EB003685A3 /* SDImageCachesManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
32D122322080B2EB003685A3 /* SDImageCachesManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 32D1221D2080B2EB003685A3 /* SDImageCachesManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
32D122332080B2EB003685A3 /* SDImageCachesManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 32D1221D2080B2EB003685A3 /* SDImageCachesManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
32D122342080B2EB003685A3 /* SDImageCachesManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 32D1221D2080B2EB003685A3 /* SDImageCachesManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
32D122352080B2EB003685A3 /* SDImageCachesManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 32D1221D2080B2EB003685A3 /* SDImageCachesManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
32EB6D8E206D132E005CAEF6 /* SDAnimatedImageRep.m in Sources */ = {isa = PBXBuildFile; fileRef = 320224BA203979BA00E9F285 /* SDAnimatedImageRep.m */; };
|
||||
32EB6D8F206D132E005CAEF6 /* SDAnimatedImageRep.m in Sources */ = {isa = PBXBuildFile; fileRef = 320224BA203979BA00E9F285 /* SDAnimatedImageRep.m */; };
|
||||
32EB6D90206D132E005CAEF6 /* SDAnimatedImageRep.m in Sources */ = {isa = PBXBuildFile; fileRef = 320224BA203979BA00E9F285 /* SDAnimatedImageRep.m */; };
|
||||
|
@ -1598,8 +1598,8 @@
|
|||
32CF1C061FA496B000004BD1 /* SDWebImageCoderHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDWebImageCoderHelper.m; sourceTree = "<group>"; };
|
||||
32D1221A2080B2EB003685A3 /* SDWebImageCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDWebImageCache.h; sourceTree = "<group>"; };
|
||||
32D1221B2080B2EB003685A3 /* SDWebImageCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDWebImageCache.m; sourceTree = "<group>"; };
|
||||
32D1221C2080B2EB003685A3 /* SDWebImageCachesManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDWebImageCachesManager.m; sourceTree = "<group>"; };
|
||||
32D1221D2080B2EB003685A3 /* SDWebImageCachesManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDWebImageCachesManager.h; sourceTree = "<group>"; };
|
||||
32D1221C2080B2EB003685A3 /* SDImageCachesManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDImageCachesManager.m; sourceTree = "<group>"; };
|
||||
32D1221D2080B2EB003685A3 /* SDImageCachesManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDImageCachesManager.h; sourceTree = "<group>"; };
|
||||
32F21B4F20788D8C0036B1D5 /* SDWebImageDownloaderRequestModifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDWebImageDownloaderRequestModifier.h; sourceTree = "<group>"; };
|
||||
32F21B5020788D8C0036B1D5 /* SDWebImageDownloaderRequestModifier.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDWebImageDownloaderRequestModifier.m; sourceTree = "<group>"; };
|
||||
32F7C06D2030114C00873181 /* SDWebImageTransformer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDWebImageTransformer.h; sourceTree = "<group>"; };
|
||||
|
@ -2120,8 +2120,8 @@
|
|||
328BB6BE2082581100760D6C /* SDDiskCache.m */,
|
||||
32D1221A2080B2EB003685A3 /* SDWebImageCache.h */,
|
||||
32D1221B2080B2EB003685A3 /* SDWebImageCache.m */,
|
||||
32D1221D2080B2EB003685A3 /* SDWebImageCachesManager.h */,
|
||||
32D1221C2080B2EB003685A3 /* SDWebImageCachesManager.m */,
|
||||
32D1221D2080B2EB003685A3 /* SDImageCachesManager.h */,
|
||||
32D1221C2080B2EB003685A3 /* SDImageCachesManager.m */,
|
||||
);
|
||||
name = Cache;
|
||||
sourceTree = "<group>";
|
||||
|
@ -2412,7 +2412,7 @@
|
|||
3248476C201775F600AF9E5A /* SDAnimatedImageView.h in Headers */,
|
||||
80377C5F1F2F666300F89830 /* utils.h in Headers */,
|
||||
80377C5B1F2F666300F89830 /* rescaler_utils.h in Headers */,
|
||||
32D122332080B2EB003685A3 /* SDWebImageCachesManager.h in Headers */,
|
||||
32D122332080B2EB003685A3 /* SDImageCachesManager.h in Headers */,
|
||||
323F8BF91F38EF770092B609 /* animi.h in Headers */,
|
||||
32F7C0872030719600873181 /* UIImage+Transform.h in Headers */,
|
||||
80377C4F1F2F666300F89830 /* filters_utils.h in Headers */,
|
||||
|
@ -2482,7 +2482,7 @@
|
|||
80377C271F2F666300F89830 /* rescaler_utils.h in Headers */,
|
||||
323F8B511F38EF770092B609 /* backward_references_enc.h in Headers */,
|
||||
325312C9200F09910046BF1E /* SDWebImageTransition.h in Headers */,
|
||||
32D122312080B2EB003685A3 /* SDWebImageCachesManager.h in Headers */,
|
||||
32D122312080B2EB003685A3 /* SDImageCachesManager.h in Headers */,
|
||||
43A918651D8308FE00B3925F /* SDImageCacheConfig.h in Headers */,
|
||||
4314D1741D0E0E3B004B36C9 /* types.h in Headers */,
|
||||
4314D1761D0E0E3B004B36C9 /* decode.h in Headers */,
|
||||
|
@ -2564,7 +2564,7 @@
|
|||
80377E211F2F66A800F89830 /* neon.h in Headers */,
|
||||
80377C711F2F666400F89830 /* quant_levels_utils.h in Headers */,
|
||||
323F8B541F38EF770092B609 /* backward_references_enc.h in Headers */,
|
||||
32D122342080B2EB003685A3 /* SDWebImageCachesManager.h in Headers */,
|
||||
32D122342080B2EB003685A3 /* SDImageCachesManager.h in Headers */,
|
||||
32F7C0882030719600873181 /* UIImage+Transform.h in Headers */,
|
||||
43A62A1F1D0E0A800089D7DD /* mux.h in Headers */,
|
||||
431BB6E91D06D2C1006A3455 /* SDWebImageDownloaderOperation.h in Headers */,
|
||||
|
@ -2700,7 +2700,7 @@
|
|||
321E608B1F38E8C800405457 /* SDWebImageCoder.h in Headers */,
|
||||
323F8B731F38EF770092B609 /* delta_palettization_enc.h in Headers */,
|
||||
321E60C31F38E91700405457 /* UIImage+ForceDecode.h in Headers */,
|
||||
32D122352080B2EB003685A3 /* SDWebImageCachesManager.h in Headers */,
|
||||
32D122352080B2EB003685A3 /* SDImageCachesManager.h in Headers */,
|
||||
32484768201775F600AF9E5A /* SDAnimatedImageView+WebCache.h in Headers */,
|
||||
80377E561F2F66A800F89830 /* lossless_common.h in Headers */,
|
||||
4397D2E91D0DDD8C00BB2784 /* UIImage+WebP.h in Headers */,
|
||||
|
@ -2799,7 +2799,7 @@
|
|||
3248476B201775F600AF9E5A /* SDAnimatedImageView.h in Headers */,
|
||||
4A2CAE311AB4BB7500B6BC39 /* UIImage+WebP.h in Headers */,
|
||||
323F8BF81F38EF770092B609 /* animi.h in Headers */,
|
||||
32D122322080B2EB003685A3 /* SDWebImageCachesManager.h in Headers */,
|
||||
32D122322080B2EB003685A3 /* SDImageCachesManager.h in Headers */,
|
||||
80377C351F2F666300F89830 /* filters_utils.h in Headers */,
|
||||
32F7C0862030719600873181 /* UIImage+Transform.h in Headers */,
|
||||
80377C321F2F666300F89830 /* color_cache_utils.h in Headers */,
|
||||
|
@ -2853,7 +2853,7 @@
|
|||
431738BD1CDFC2660008FEB9 /* decode.h in Headers */,
|
||||
80377D0B1F2F66A100F89830 /* mips_macro.h in Headers */,
|
||||
329A18591FFF5DFD008C9A2F /* UIImage+WebCache.h in Headers */,
|
||||
32D122302080B2EB003685A3 /* SDWebImageCachesManager.h in Headers */,
|
||||
32D122302080B2EB003685A3 /* SDImageCachesManager.h in Headers */,
|
||||
5376131A155AD0D5005750A4 /* SDWebImageDownloader.h in Headers */,
|
||||
328BB6CD2082581100760D6C /* SDMemoryCache.h in Headers */,
|
||||
4369C2771D9807EC007E863A /* UIView+WebCache.h in Headers */,
|
||||
|
@ -3218,7 +3218,7 @@
|
|||
80377DDE1F2F66A700F89830 /* rescaler_mips32.c in Sources */,
|
||||
80377DCA1F2F66A700F89830 /* filters_sse2.c in Sources */,
|
||||
80377EBE1F2F66D500F89830 /* quant_dec.c in Sources */,
|
||||
32D1222D2080B2EB003685A3 /* SDWebImageCachesManager.m in Sources */,
|
||||
32D1222D2080B2EB003685A3 /* SDImageCachesManager.m in Sources */,
|
||||
80377DB61F2F66A700F89830 /* dec_clip_tables.c in Sources */,
|
||||
80377C5E1F2F666300F89830 /* utils.c in Sources */,
|
||||
32B9B540206ED4230026769D /* SDWebImageDownloaderConfig.m in Sources */,
|
||||
|
@ -3389,7 +3389,7 @@
|
|||
80377D2F1F2F66A700F89830 /* dec_msa.c in Sources */,
|
||||
323F8C151F38EF770092B609 /* muxinternal.c in Sources */,
|
||||
80377D571F2F66A700F89830 /* rescaler_sse2.c in Sources */,
|
||||
32D1222B2080B2EB003685A3 /* SDWebImageCachesManager.m in Sources */,
|
||||
32D1222B2080B2EB003685A3 /* SDImageCachesManager.m in Sources */,
|
||||
43C892A11D9D6DDC0022038D /* demux.c in Sources */,
|
||||
80377C131F2F666300F89830 /* bit_reader_utils.c in Sources */,
|
||||
80377E9C1F2F66D400F89830 /* idec_dec.c in Sources */,
|
||||
|
@ -3553,7 +3553,7 @@
|
|||
323F8BBE1F38EF770092B609 /* predictor_enc.c in Sources */,
|
||||
80377E261F2F66A800F89830 /* rescaler_sse2.c in Sources */,
|
||||
323F8C181F38EF770092B609 /* muxinternal.c in Sources */,
|
||||
32D1222E2080B2EB003685A3 /* SDWebImageCachesManager.m in Sources */,
|
||||
32D1222E2080B2EB003685A3 /* SDImageCachesManager.m in Sources */,
|
||||
80377C741F2F666400F89830 /* rescaler_utils.c in Sources */,
|
||||
431BB6B11D06D2C1006A3455 /* UIView+WebCacheOperation.m in Sources */,
|
||||
80377DF01F2F66A800F89830 /* alpha_processing_sse41.c in Sources */,
|
||||
|
@ -3692,7 +3692,7 @@
|
|||
321E60C91F38E91700405457 /* UIImage+ForceDecode.m in Sources */,
|
||||
80377E551F2F66A800F89830 /* filters.c in Sources */,
|
||||
80377E731F2F66A800F89830 /* yuv_mips32.c in Sources */,
|
||||
32D1222F2080B2EB003685A3 /* SDWebImageCachesManager.m in Sources */,
|
||||
32D1222F2080B2EB003685A3 /* SDImageCachesManager.m in Sources */,
|
||||
4397D2911D0DDD8C00BB2784 /* MKAnnotationView+WebCache.m in Sources */,
|
||||
4397D2921D0DDD8C00BB2784 /* SDWebImagePrefetcher.m in Sources */,
|
||||
323F8BBF1F38EF770092B609 /* predictor_enc.c in Sources */,
|
||||
|
@ -3880,7 +3880,7 @@
|
|||
80377C441F2F666300F89830 /* utils.c in Sources */,
|
||||
80377D8D1F2F66A700F89830 /* lossless_enc_sse41.c in Sources */,
|
||||
80377EAE1F2F66D400F89830 /* quant_dec.c in Sources */,
|
||||
32D1222C2080B2EB003685A3 /* SDWebImageCachesManager.m in Sources */,
|
||||
32D1222C2080B2EB003685A3 /* SDImageCachesManager.m in Sources */,
|
||||
80377D6E1F2F66A700F89830 /* cost_sse2.c in Sources */,
|
||||
80377D991F2F66A700F89830 /* rescaler_mips32.c in Sources */,
|
||||
32B9B53F206ED4230026769D /* SDWebImageDownloaderConfig.m in Sources */,
|
||||
|
@ -4048,7 +4048,7 @@
|
|||
80377D031F2F66A100F89830 /* lossless_enc_sse41.c in Sources */,
|
||||
80377E8E1F2F66D000F89830 /* quant_dec.c in Sources */,
|
||||
80377CE41F2F66A100F89830 /* cost_sse2.c in Sources */,
|
||||
32D1222A2080B2EB003685A3 /* SDWebImageCachesManager.m in Sources */,
|
||||
32D1222A2080B2EB003685A3 /* SDImageCachesManager.m in Sources */,
|
||||
80377D0F1F2F66A100F89830 /* rescaler_mips32.c in Sources */,
|
||||
323F8C081F38EF770092B609 /* muxedit.c in Sources */,
|
||||
32B9B53D206ED4230026769D /* SDWebImageDownloaderConfig.m in Sources */,
|
||||
|
|
|
@ -9,19 +9,19 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
#import "SDWebImageCache.h"
|
||||
|
||||
typedef NS_ENUM(NSUInteger, SDWebImageCachesManagerOperationPolicy) {
|
||||
SDWebImageCachesManagerOperationPolicySerial, // process all caches serially (from the highest priority to the lowest priority cache by order)
|
||||
SDWebImageCachesManagerOperationPolicyConcurrent, // process all caches concurrently
|
||||
SDWebImageCachesManagerOperationPolicyHighestOnly, // process the highest priority cache only
|
||||
SDWebImageCachesManagerOperationPolicyLowestOnly // process the lowest priority cache only
|
||||
typedef NS_ENUM(NSUInteger, SDImageCachesManagerOperationPolicy) {
|
||||
SDImageCachesManagerOperationPolicySerial, // process all caches serially (from the highest priority to the lowest priority cache by order)
|
||||
SDImageCachesManagerOperationPolicyConcurrent, // process all caches concurrently
|
||||
SDImageCachesManagerOperationPolicyHighestOnly, // process the highest priority cache only
|
||||
SDImageCachesManagerOperationPolicyLowestOnly // process the lowest priority cache only
|
||||
};
|
||||
|
||||
@interface SDWebImageCachesManager : NSObject <SDWebImageCache>
|
||||
@interface SDImageCachesManager : NSObject <SDWebImageCache>
|
||||
|
||||
/**
|
||||
Returns the global shared caches manager instance.
|
||||
*/
|
||||
@property (nonatomic, class, readonly, nonnull) SDWebImageCachesManager *sharedManager;
|
||||
@property (nonatomic, class, readonly, nonnull) SDImageCachesManager *sharedManager;
|
||||
|
||||
// These are op policy for cache manager.
|
||||
|
||||
|
@ -29,31 +29,31 @@ typedef NS_ENUM(NSUInteger, SDWebImageCachesManagerOperationPolicy) {
|
|||
Operation policy for query op.
|
||||
Defaults to `Serial`, means query all caches serially (one completion called then next begin) until one cache query success (`image` != nil).
|
||||
*/
|
||||
@property (nonatomic, assign) SDWebImageCachesManagerOperationPolicy queryOperationPolicy;
|
||||
@property (nonatomic, assign) SDImageCachesManagerOperationPolicy queryOperationPolicy;
|
||||
|
||||
/**
|
||||
Operation policy for store op.
|
||||
Defaults to `HighestOnly`, means store to the highest priority cache only.
|
||||
*/
|
||||
@property (nonatomic, assign) SDWebImageCachesManagerOperationPolicy storeOperationPolicy;
|
||||
@property (nonatomic, assign) SDImageCachesManagerOperationPolicy storeOperationPolicy;
|
||||
|
||||
/**
|
||||
Operation policy for remove op.
|
||||
Defaults to `Concurrent`, means remove all caches concurrently.
|
||||
*/
|
||||
@property (nonatomic, assign) SDWebImageCachesManagerOperationPolicy removeOperationPolicy;
|
||||
@property (nonatomic, assign) SDImageCachesManagerOperationPolicy removeOperationPolicy;
|
||||
|
||||
/**
|
||||
Operation policy for contains op.
|
||||
Defaults to `Serial`, means check all caches serially (one completion called then next begin) until one cache check success (`containsCacheType` != None).
|
||||
*/
|
||||
@property (nonatomic, assign) SDWebImageCachesManagerOperationPolicy containsOperationPolicy;
|
||||
@property (nonatomic, assign) SDImageCachesManagerOperationPolicy containsOperationPolicy;
|
||||
|
||||
/**
|
||||
Operation policy for clear op.
|
||||
Defaults to `Concurrent`, means clear all caches concurrently.
|
||||
*/
|
||||
@property (nonatomic, assign) SDWebImageCachesManagerOperationPolicy clearOperationPolicy;
|
||||
@property (nonatomic, assign) SDImageCachesManagerOperationPolicy clearOperationPolicy;
|
||||
|
||||
/**
|
||||
All caches in caches manager. The caches array is a priority queue, which means the later added cache will have the highest priority
|
|
@ -6,10 +6,10 @@
|
|||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
#import "SDWebImageCachesManager.h"
|
||||
#import "SDImageCachesManager.h"
|
||||
|
||||
// This is used for operation management, but not for operation queue execute
|
||||
@interface SDWebImageCachesManagerOperation : NSOperation
|
||||
@interface SDImageCachesManagerOperation : NSOperation
|
||||
|
||||
@property (nonatomic, assign, readonly) NSUInteger pendingCount;
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
|||
|
||||
@end
|
||||
|
||||
@implementation SDWebImageCachesManagerOperation
|
||||
@implementation SDImageCachesManagerOperation
|
||||
|
||||
@synthesize executing = _executing;
|
||||
@synthesize finished = _finished;
|
||||
|
@ -70,13 +70,13 @@
|
|||
|
||||
@end
|
||||
|
||||
@implementation SDWebImageCachesManager
|
||||
@implementation SDImageCachesManager
|
||||
|
||||
+ (SDWebImageCachesManager *)sharedManager {
|
||||
+ (SDImageCachesManager *)sharedManager {
|
||||
static dispatch_once_t onceToken;
|
||||
static SDWebImageCachesManager *manager;
|
||||
static SDImageCachesManager *manager;
|
||||
dispatch_once(&onceToken, ^{
|
||||
manager = [[SDWebImageCachesManager alloc] init];
|
||||
manager = [[SDImageCachesManager alloc] init];
|
||||
});
|
||||
return manager;
|
||||
}
|
||||
|
@ -84,11 +84,11 @@
|
|||
- (instancetype)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.queryOperationPolicy = SDWebImageCachesManagerOperationPolicySerial;
|
||||
self.storeOperationPolicy = SDWebImageCachesManagerOperationPolicyHighestOnly;
|
||||
self.removeOperationPolicy = SDWebImageCachesManagerOperationPolicyConcurrent;
|
||||
self.containsOperationPolicy = SDWebImageCachesManagerOperationPolicySerial;
|
||||
self.clearOperationPolicy = SDWebImageCachesManagerOperationPolicyConcurrent;
|
||||
self.queryOperationPolicy = SDImageCachesManagerOperationPolicySerial;
|
||||
self.storeOperationPolicy = SDImageCachesManagerOperationPolicyHighestOnly;
|
||||
self.removeOperationPolicy = SDImageCachesManagerOperationPolicyConcurrent;
|
||||
self.containsOperationPolicy = SDImageCachesManagerOperationPolicySerial;
|
||||
self.clearOperationPolicy = SDImageCachesManagerOperationPolicyConcurrent;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
@ -130,25 +130,25 @@
|
|||
return [caches.firstObject queryImageForKey:key options:options context:context completion:completionBlock];
|
||||
}
|
||||
switch (self.queryOperationPolicy) {
|
||||
case SDWebImageCachesManagerOperationPolicyHighestOnly: {
|
||||
case SDImageCachesManagerOperationPolicyHighestOnly: {
|
||||
id<SDWebImageCache> cache = caches.lastObject;
|
||||
return [cache queryImageForKey:key options:options context:context completion:completionBlock];
|
||||
}
|
||||
break;
|
||||
case SDWebImageCachesManagerOperationPolicyLowestOnly: {
|
||||
case SDImageCachesManagerOperationPolicyLowestOnly: {
|
||||
id<SDWebImageCache> cache = caches.firstObject;
|
||||
return [cache queryImageForKey:key options:options context:context completion:completionBlock];
|
||||
}
|
||||
break;
|
||||
case SDWebImageCachesManagerOperationPolicyConcurrent: {
|
||||
SDWebImageCachesManagerOperation *operation = [SDWebImageCachesManagerOperation new];
|
||||
case SDImageCachesManagerOperationPolicyConcurrent: {
|
||||
SDImageCachesManagerOperation *operation = [SDImageCachesManagerOperation new];
|
||||
[operation beginWithTotalCount:caches.count];
|
||||
[self concurrentQueryImageForKey:key options:options context:context completion:completionBlock enumerator:caches.reverseObjectEnumerator operation:operation];
|
||||
return operation;
|
||||
}
|
||||
break;
|
||||
case SDWebImageCachesManagerOperationPolicySerial: {
|
||||
SDWebImageCachesManagerOperation *operation = [SDWebImageCachesManagerOperation new];
|
||||
case SDImageCachesManagerOperationPolicySerial: {
|
||||
SDImageCachesManagerOperation *operation = [SDImageCachesManagerOperation new];
|
||||
[operation beginWithTotalCount:caches.count];
|
||||
[self serialQueryImageForKey:key options:options context:context completion:completionBlock enumerator:caches.reverseObjectEnumerator operation:operation];
|
||||
return operation;
|
||||
|
@ -173,23 +173,23 @@
|
|||
return;
|
||||
}
|
||||
switch (self.storeOperationPolicy) {
|
||||
case SDWebImageCachesManagerOperationPolicyHighestOnly: {
|
||||
case SDImageCachesManagerOperationPolicyHighestOnly: {
|
||||
id<SDWebImageCache> cache = caches.lastObject;
|
||||
[cache storeImage:image imageData:imageData forKey:key cacheType:cacheType completion:completionBlock];
|
||||
}
|
||||
break;
|
||||
case SDWebImageCachesManagerOperationPolicyLowestOnly: {
|
||||
case SDImageCachesManagerOperationPolicyLowestOnly: {
|
||||
id<SDWebImageCache> cache = caches.firstObject;
|
||||
[cache storeImage:image imageData:imageData forKey:key cacheType:cacheType completion:completionBlock];
|
||||
}
|
||||
break;
|
||||
case SDWebImageCachesManagerOperationPolicyConcurrent: {
|
||||
SDWebImageCachesManagerOperation *operation = [SDWebImageCachesManagerOperation new];
|
||||
case SDImageCachesManagerOperationPolicyConcurrent: {
|
||||
SDImageCachesManagerOperation *operation = [SDImageCachesManagerOperation new];
|
||||
[operation beginWithTotalCount:caches.count];
|
||||
[self concurrentStoreImage:image imageData:imageData forKey:key cacheType:cacheType completion:completionBlock enumerator:caches.reverseObjectEnumerator operation:operation];
|
||||
}
|
||||
break;
|
||||
case SDWebImageCachesManagerOperationPolicySerial: {
|
||||
case SDImageCachesManagerOperationPolicySerial: {
|
||||
[self serialStoreImage:image imageData:imageData forKey:key cacheType:cacheType completion:completionBlock enumerator:caches.reverseObjectEnumerator];
|
||||
}
|
||||
break;
|
||||
|
@ -211,23 +211,23 @@
|
|||
return;
|
||||
}
|
||||
switch (self.removeOperationPolicy) {
|
||||
case SDWebImageCachesManagerOperationPolicyHighestOnly: {
|
||||
case SDImageCachesManagerOperationPolicyHighestOnly: {
|
||||
id<SDWebImageCache> cache = caches.lastObject;
|
||||
[cache removeImageForKey:key cacheType:cacheType completion:completionBlock];
|
||||
}
|
||||
break;
|
||||
case SDWebImageCachesManagerOperationPolicyLowestOnly: {
|
||||
case SDImageCachesManagerOperationPolicyLowestOnly: {
|
||||
id<SDWebImageCache> cache = caches.firstObject;
|
||||
[cache removeImageForKey:key cacheType:cacheType completion:completionBlock];
|
||||
}
|
||||
break;
|
||||
case SDWebImageCachesManagerOperationPolicyConcurrent: {
|
||||
SDWebImageCachesManagerOperation *operation = [SDWebImageCachesManagerOperation new];
|
||||
case SDImageCachesManagerOperationPolicyConcurrent: {
|
||||
SDImageCachesManagerOperation *operation = [SDImageCachesManagerOperation new];
|
||||
[operation beginWithTotalCount:caches.count];
|
||||
[self concurrentRemoveImageForKey:key cacheType:cacheType completion:completionBlock enumerator:caches.reverseObjectEnumerator operation:operation];
|
||||
}
|
||||
break;
|
||||
case SDWebImageCachesManagerOperationPolicySerial: {
|
||||
case SDImageCachesManagerOperationPolicySerial: {
|
||||
[self serialRemoveImageForKey:key cacheType:cacheType completion:completionBlock enumerator:caches.reverseObjectEnumerator];
|
||||
}
|
||||
break;
|
||||
|
@ -249,24 +249,24 @@
|
|||
return;
|
||||
}
|
||||
switch (self.clearOperationPolicy) {
|
||||
case SDWebImageCachesManagerOperationPolicyHighestOnly: {
|
||||
case SDImageCachesManagerOperationPolicyHighestOnly: {
|
||||
id<SDWebImageCache> cache = caches.lastObject;
|
||||
[cache containsImageForKey:key cacheType:cacheType completion:completionBlock];
|
||||
}
|
||||
break;
|
||||
case SDWebImageCachesManagerOperationPolicyLowestOnly: {
|
||||
case SDImageCachesManagerOperationPolicyLowestOnly: {
|
||||
id<SDWebImageCache> cache = caches.firstObject;
|
||||
[cache containsImageForKey:key cacheType:cacheType completion:completionBlock];
|
||||
}
|
||||
break;
|
||||
case SDWebImageCachesManagerOperationPolicyConcurrent: {
|
||||
SDWebImageCachesManagerOperation *operation = [SDWebImageCachesManagerOperation new];
|
||||
case SDImageCachesManagerOperationPolicyConcurrent: {
|
||||
SDImageCachesManagerOperation *operation = [SDImageCachesManagerOperation new];
|
||||
[operation beginWithTotalCount:caches.count];
|
||||
[self concurrentContainsImageForKey:key cacheType:cacheType completion:completionBlock enumerator:caches.reverseObjectEnumerator operation:operation];
|
||||
}
|
||||
break;
|
||||
case SDWebImageCachesManagerOperationPolicySerial: {
|
||||
SDWebImageCachesManagerOperation *operation = [SDWebImageCachesManagerOperation new];
|
||||
case SDImageCachesManagerOperationPolicySerial: {
|
||||
SDImageCachesManagerOperation *operation = [SDImageCachesManagerOperation new];
|
||||
[operation beginWithTotalCount:caches.count];
|
||||
[self serialContainsImageForKey:key cacheType:cacheType completion:completionBlock enumerator:caches.reverseObjectEnumerator operation:operation];
|
||||
}
|
||||
|
@ -286,23 +286,23 @@
|
|||
return;
|
||||
}
|
||||
switch (self.clearOperationPolicy) {
|
||||
case SDWebImageCachesManagerOperationPolicyHighestOnly: {
|
||||
case SDImageCachesManagerOperationPolicyHighestOnly: {
|
||||
id<SDWebImageCache> cache = caches.lastObject;
|
||||
[cache clearWithCacheType:cacheType completion:completionBlock];
|
||||
}
|
||||
break;
|
||||
case SDWebImageCachesManagerOperationPolicyLowestOnly: {
|
||||
case SDImageCachesManagerOperationPolicyLowestOnly: {
|
||||
id<SDWebImageCache> cache = caches.firstObject;
|
||||
[cache clearWithCacheType:cacheType completion:completionBlock];
|
||||
}
|
||||
break;
|
||||
case SDWebImageCachesManagerOperationPolicyConcurrent: {
|
||||
SDWebImageCachesManagerOperation *operation = [SDWebImageCachesManagerOperation new];
|
||||
case SDImageCachesManagerOperationPolicyConcurrent: {
|
||||
SDImageCachesManagerOperation *operation = [SDImageCachesManagerOperation new];
|
||||
[operation beginWithTotalCount:caches.count];
|
||||
[self concurrentClearWithCacheType:cacheType completion:completionBlock enumerator:caches.reverseObjectEnumerator operation:operation];
|
||||
}
|
||||
break;
|
||||
case SDWebImageCachesManagerOperationPolicySerial: {
|
||||
case SDImageCachesManagerOperationPolicySerial: {
|
||||
[self serialClearWithCacheType:cacheType completion:completionBlock enumerator:caches.reverseObjectEnumerator];
|
||||
}
|
||||
break;
|
||||
|
@ -313,7 +313,7 @@
|
|||
|
||||
#pragma mark - Concurrent Operation
|
||||
|
||||
- (void)concurrentQueryImageForKey:(NSString *)key options:(SDWebImageOptions)options context:(SDWebImageContext *)context completion:(SDImageCacheQueryCompletionBlock)completionBlock enumerator:(NSEnumerator<id<SDWebImageCache>> *)enumerator operation:(SDWebImageCachesManagerOperation *)operation {
|
||||
- (void)concurrentQueryImageForKey:(NSString *)key options:(SDWebImageOptions)options context:(SDWebImageContext *)context completion:(SDImageCacheQueryCompletionBlock)completionBlock enumerator:(NSEnumerator<id<SDWebImageCache>> *)enumerator operation:(SDImageCachesManagerOperation *)operation {
|
||||
NSParameterAssert(enumerator);
|
||||
NSParameterAssert(operation);
|
||||
for (id<SDWebImageCache> cache in enumerator) {
|
||||
|
@ -346,7 +346,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
- (void)concurrentStoreImage:(UIImage *)image imageData:(NSData *)imageData forKey:(NSString *)key cacheType:(SDImageCacheType)cacheType completion:(SDWebImageNoParamsBlock)completionBlock enumerator:(NSEnumerator<id<SDWebImageCache>> *)enumerator operation:(SDWebImageCachesManagerOperation *)operation {
|
||||
- (void)concurrentStoreImage:(UIImage *)image imageData:(NSData *)imageData forKey:(NSString *)key cacheType:(SDImageCacheType)cacheType completion:(SDWebImageNoParamsBlock)completionBlock enumerator:(NSEnumerator<id<SDWebImageCache>> *)enumerator operation:(SDImageCachesManagerOperation *)operation {
|
||||
NSParameterAssert(enumerator);
|
||||
NSParameterAssert(operation);
|
||||
for (id<SDWebImageCache> cache in enumerator) {
|
||||
|
@ -371,7 +371,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
- (void)concurrentRemoveImageForKey:(NSString *)key cacheType:(SDImageCacheType)cacheType completion:(SDWebImageNoParamsBlock)completionBlock enumerator:(NSEnumerator<id<SDWebImageCache>> *)enumerator operation:(SDWebImageCachesManagerOperation *)operation {
|
||||
- (void)concurrentRemoveImageForKey:(NSString *)key cacheType:(SDImageCacheType)cacheType completion:(SDWebImageNoParamsBlock)completionBlock enumerator:(NSEnumerator<id<SDWebImageCache>> *)enumerator operation:(SDImageCachesManagerOperation *)operation {
|
||||
NSParameterAssert(enumerator);
|
||||
NSParameterAssert(operation);
|
||||
for (id<SDWebImageCache> cache in enumerator) {
|
||||
|
@ -396,7 +396,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
- (void)concurrentContainsImageForKey:(NSString *)key cacheType:(SDImageCacheType)cacheType completion:(SDImageCacheContainsCompletionBlock)completionBlock enumerator:(NSEnumerator<id<SDWebImageCache>> *)enumerator operation:(SDWebImageCachesManagerOperation *)operation {
|
||||
- (void)concurrentContainsImageForKey:(NSString *)key cacheType:(SDImageCacheType)cacheType completion:(SDImageCacheContainsCompletionBlock)completionBlock enumerator:(NSEnumerator<id<SDWebImageCache>> *)enumerator operation:(SDImageCachesManagerOperation *)operation {
|
||||
NSParameterAssert(enumerator);
|
||||
NSParameterAssert(operation);
|
||||
for (id<SDWebImageCache> cache in enumerator) {
|
||||
|
@ -429,7 +429,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
- (void)concurrentClearWithCacheType:(SDImageCacheType)cacheType completion:(SDWebImageNoParamsBlock)completionBlock enumerator:(NSEnumerator<id<SDWebImageCache>> *)enumerator operation:(SDWebImageCachesManagerOperation *)operation {
|
||||
- (void)concurrentClearWithCacheType:(SDImageCacheType)cacheType completion:(SDWebImageNoParamsBlock)completionBlock enumerator:(NSEnumerator<id<SDWebImageCache>> *)enumerator operation:(SDImageCachesManagerOperation *)operation {
|
||||
NSParameterAssert(enumerator);
|
||||
NSParameterAssert(operation);
|
||||
for (id<SDWebImageCache> cache in enumerator) {
|
||||
|
@ -456,7 +456,7 @@
|
|||
|
||||
#pragma mark - Serial Operation
|
||||
|
||||
- (void)serialQueryImageForKey:(NSString *)key options:(SDWebImageOptions)options context:(SDWebImageContext *)context completion:(SDImageCacheQueryCompletionBlock)completionBlock enumerator:(NSEnumerator<id<SDWebImageCache>> *)enumerator operation:(SDWebImageCachesManagerOperation *)operation {
|
||||
- (void)serialQueryImageForKey:(NSString *)key options:(SDWebImageOptions)options context:(SDWebImageContext *)context completion:(SDImageCacheQueryCompletionBlock)completionBlock enumerator:(NSEnumerator<id<SDWebImageCache>> *)enumerator operation:(SDImageCachesManagerOperation *)operation {
|
||||
NSParameterAssert(enumerator);
|
||||
NSParameterAssert(operation);
|
||||
id<SDWebImageCache> cache = enumerator.nextObject;
|
||||
|
@ -526,7 +526,7 @@
|
|||
}];
|
||||
}
|
||||
|
||||
- (void)serialContainsImageForKey:(NSString *)key cacheType:(SDImageCacheType)cacheType completion:(SDImageCacheContainsCompletionBlock)completionBlock enumerator:(NSEnumerator<id<SDWebImageCache>> *)enumerator operation:(SDWebImageCachesManagerOperation *)operation {
|
||||
- (void)serialContainsImageForKey:(NSString *)key cacheType:(SDImageCacheType)cacheType completion:(SDImageCacheContainsCompletionBlock)completionBlock enumerator:(NSEnumerator<id<SDWebImageCache>> *)enumerator operation:(SDImageCachesManagerOperation *)operation {
|
||||
NSParameterAssert(enumerator);
|
||||
NSParameterAssert(operation);
|
||||
id<SDWebImageCache> cache = enumerator.nextObject;
|
Loading…
Reference in New Issue