![]() |
Tuya iOS Smart Life App SDK 5.15.0
|
#import <ThingEncryptMemoryCache.h>
Properties | |
NSString * | name |
NSUInteger | totalCount |
NSUInteger | totalCost |
NSUInteger | countLimit |
NSUInteger | costLimit |
NSTimeInterval | ageLimit |
NSTimeInterval | autoTrimInterval |
BOOL | shouldRemoveAllObjectsOnMemoryWarning |
BOOL | shouldRemoveAllObjectsWhenEnteringBackground |
void(^ | didReceiveMemoryWarningBlock )(ThingEncryptMemoryCache *cache) |
void(^ | didEnterBackgroundBlock )(ThingEncryptMemoryCache *cache) |
BOOL | releaseOnMainThread |
BOOL | releaseAsynchronously |
Definition at line 13 of file ThingEncryptMemoryCache.h.
- (BOOL) containsObjectForKey: | (id) | key |
- (BOOL) containsObjectForKey: | (id) | key |
- (BOOL) containsObjectForKey: | (id) | key |
- (BOOL) containsObjectForKey: | (id) | key |
- (void(^)) didEnterBackgroundBlock | (ThingEncryptMemoryCache *) | cache |
A block to be executed when the app enter background. The default value is nil.
- (void(^)) didEnterBackgroundBlock | (ThingEncryptMemoryCache *) | cache |
A block to be executed when the app enter background. The default value is nil.
- (void(^)) didEnterBackgroundBlock | (ThingEncryptMemoryCache *) | cache |
A block to be executed when the app enter background. The default value is nil.
- (void(^)) didReceiveMemoryWarningBlock | (ThingEncryptMemoryCache *) | cache |
A block to be executed when the app receives a memory warning. The default value is nil.
- (void(^)) didReceiveMemoryWarningBlock | (ThingEncryptMemoryCache *) | cache |
A block to be executed when the app receives a memory warning. The default value is nil.
- (void(^)) didReceiveMemoryWarningBlock | (ThingEncryptMemoryCache *) | cache |
A block to be executed when the app receives a memory warning. The default value is nil.
- (nullable id) objectForKey: | (id) | key |
Returns the value associated with a given key.
key | An object identifying the value. If nil, just return nil. |
- (nullable id) objectForKey: | (id) | key |
Returns the value associated with a given key.
key | An object identifying the value. If nil, just return nil. |
- (nullable id) objectForKey: | (id) | key |
Returns the value associated with a given key.
key | An object identifying the value. If nil, just return nil. |
- (nullable id) objectForKey: | (id) | key |
Returns the value associated with a given key.
key | An object identifying the value. If nil, just return nil. |
- (void) removeAllObjects |
Empties the cache immediately.
- (void) removeAllObjects |
Empties the cache immediately.
- (void) removeAllObjects |
Empties the cache immediately.
- (void) removeAllObjects |
Empties the cache immediately.
- (void) removeObjectForKey: | (id) | key |
Removes the value of the specified key in the cache.
key | The key identifying the value to be removed. If nil, this method has no effect. |
- (void) removeObjectForKey: | (id) | key |
Removes the value of the specified key in the cache.
key | The key identifying the value to be removed. If nil, this method has no effect. |
- (void) removeObjectForKey: | (id) | key |
Removes the value of the specified key in the cache.
key | The key identifying the value to be removed. If nil, this method has no effect. |
- (void) removeObjectForKey: | (id) | key |
Removes the value of the specified key in the cache.
key | The key identifying the value to be removed. If nil, this method has no effect. |
- (void) setObject: | (nullable id) | object | |
forKey: | (id) | key | |
Sets the value of the specified key in the cache (0 cost).
object | The object to be stored in the cache. If nil, it calls removeObjectForKey: . |
key | The key with which to associate the value. If nil, this method has no effect. @discussion Unlike an NSMutableDictionary object, a cache does not copy the key objects that are put into it. |
- (void) setObject: | (nullable id) | object | |
forKey: | (id) | key | |
Sets the value of the specified key in the cache (0 cost).
object | The object to be stored in the cache. If nil, it calls removeObjectForKey: . |
key | The key with which to associate the value. If nil, this method has no effect. @discussion Unlike an NSMutableDictionary object, a cache does not copy the key objects that are put into it. |
- (void) setObject: | (nullable id) | object | |
forKey: | (id) | key | |
Sets the value of the specified key in the cache (0 cost).
object | The object to be stored in the cache. If nil, it calls removeObjectForKey: . |
key | The key with which to associate the value. If nil, this method has no effect. @discussion Unlike an NSMutableDictionary object, a cache does not copy the key objects that are put into it. |
- (void) setObject: | (nullable id) | object | |
forKey: | (id) | key | |
Sets the value of the specified key in the cache (0 cost).
object | The object to be stored in the cache. If nil, it calls removeObjectForKey: . |
key | The key with which to associate the value. If nil, this method has no effect. @discussion Unlike an NSMutableDictionary object, a cache does not copy the key objects that are put into it. |
- (void) setObject: | (nullable id) | object | |
forKey: | (id) | key | |
withCost: | (NSUInteger) | cost | |
Sets the value of the specified key in the cache, and associates the key-value pair with the specified cost.
object | The object to store in the cache. If nil, it calls removeObjectForKey . |
key | The key with which to associate the value. If nil, this method has no effect. |
cost | The cost with which to associate the key-value pair. @discussion Unlike an NSMutableDictionary object, a cache does not copy the key objects that are put into it. |
- (void) setObject: | (nullable id) | object | |
forKey: | (id) | key | |
withCost: | (NSUInteger) | cost | |
Sets the value of the specified key in the cache, and associates the key-value pair with the specified cost.
object | The object to store in the cache. If nil, it calls removeObjectForKey . |
key | The key with which to associate the value. If nil, this method has no effect. |
cost | The cost with which to associate the key-value pair. @discussion Unlike an NSMutableDictionary object, a cache does not copy the key objects that are put into it. |
- (void) setObject: | (nullable id) | object | |
forKey: | (id) | key | |
withCost: | (NSUInteger) | cost | |
Sets the value of the specified key in the cache, and associates the key-value pair with the specified cost.
object | The object to store in the cache. If nil, it calls removeObjectForKey . |
key | The key with which to associate the value. If nil, this method has no effect. |
cost | The cost with which to associate the key-value pair. @discussion Unlike an NSMutableDictionary object, a cache does not copy the key objects that are put into it. |
- (void) setObject: | (nullable id) | object | |
forKey: | (id) | key | |
withCost: | (NSUInteger) | cost | |
Sets the value of the specified key in the cache, and associates the key-value pair with the specified cost.
object | The object to store in the cache. If nil, it calls removeObjectForKey . |
key | The key with which to associate the value. If nil, this method has no effect. |
cost | The cost with which to associate the key-value pair. @discussion Unlike an NSMutableDictionary object, a cache does not copy the key objects that are put into it. |
- (void) trimToAge: | (NSTimeInterval) | age |
Removes objects from the cache with LRU, until all expiry objects removed by the specified value.
age | The maximum age (in seconds) of objects. |
- (void) trimToAge: | (NSTimeInterval) | age |
Removes objects from the cache with LRU, until all expiry objects removed by the specified value.
age | The maximum age (in seconds) of objects. |
- (void) trimToAge: | (NSTimeInterval) | age |
Removes objects from the cache with LRU, until all expiry objects removed by the specified value.
age | The maximum age (in seconds) of objects. |
- (void) trimToAge: | (NSTimeInterval) | age |
Removes objects from the cache with LRU, until all expiry objects removed by the specified value.
age | The maximum age (in seconds) of objects. |
- (void) trimToCost: | (NSUInteger) | cost |
Removes objects from the cache with LRU, until the totalCost
is or equal to the specified value.
cost | The total cost allowed to remain after the cache has been trimmed. |
- (void) trimToCost: | (NSUInteger) | cost |
Removes objects from the cache with LRU, until the totalCost
is or equal to the specified value.
cost | The total cost allowed to remain after the cache has been trimmed. |
- (void) trimToCost: | (NSUInteger) | cost |
Removes objects from the cache with LRU, until the totalCost
is or equal to the specified value.
cost | The total cost allowed to remain after the cache has been trimmed. |
- (void) trimToCost: | (NSUInteger) | cost |
Removes objects from the cache with LRU, until the totalCost
is or equal to the specified value.
cost | The total cost allowed to remain after the cache has been trimmed. |
- (void) trimToCount: | (NSUInteger) | count |
- (void) trimToCount: | (NSUInteger) | count |
- (void) trimToCount: | (NSUInteger) | count |
- (void) trimToCount: | (NSUInteger) | count |
|
readwriteatomic |
The maximum expiry time of objects in cache.
@discussion The default value is DBL_MAX, which means no limit. This is not a strict limit—if an object goes over the limit, the object could be evicted later in backgound thread.
Definition at line 60 of file ThingEncryptMemoryCache.h.
|
readwriteatomic |
The auto trim check time interval in seconds. Default is 5.0.
@discussion The cache holds an internal timer to check whether the cache reaches its limits, and if the limit is reached, it begins to evict objects.
Definition at line 68 of file ThingEncryptMemoryCache.h.
|
readwriteatomic |
The maximum total cost that the cache can hold before it starts evicting objects.
@discussion The default value is NSUIntegerMax, which means no limit. This is not a strict limit—if the cache goes over the limit, some objects in the cache could be evicted later in backgound thread.
Definition at line 51 of file ThingEncryptMemoryCache.h.
|
readwriteatomic |
=============================================================================
The maximum number of objects the cache should hold.
@discussion The default value is NSUIntegerMax, which means no limit. This is not a strict limit—if the cache goes over the limit, some objects in the cache could be evicted later in backgound thread.
=============================================================================
The maximum number of objects the cache should hold.
@discussion The default value is NSUIntegerMax, which means no limit. This is not a strict limit—if the cache goes over the limit, some objects in the cache could be evicted later in backgound thread.
=============================================================================
The maximum number of objects the cache should hold.
@discussion The default value is NSUIntegerMax, which means no limit. This is not a strict limit—if the cache goes over the limit, some objects in the cache could be evicted later in backgound thread.
=============================================================================
The maximum number of objects the cache should hold.
@discussion The default value is NSUIntegerMax, which means no limit. This is not a strict limit—if the cache goes over the limit, some objects in the cache could be evicted later in backgound thread.
Definition at line 42 of file ThingEncryptMemoryCache.h.
|
readwriteatomiccopy |
A block to be executed when the app enter background. The default value is nil.
|
readwriteatomiccopy |
A block to be executed when the app receives a memory warning. The default value is nil.
|
readwriteatomiccopy |
=============================================================================
The name of the cache. Default is nil.
=============================================================================
The name of the cache. Default is nil.
=============================================================================
The name of the cache. Default is nil.
=============================================================================
The name of the cache. Default is nil.
Definition at line 21 of file ThingEncryptMemoryCache.h.
|
readwriteatomic |
If YES
, the key-value pair will be released asynchronously to avoid blocking the access methods, otherwise it will be released in the access method (such as removeObjectForKey:). Default is YES.
Definition at line 108 of file ThingEncryptMemoryCache.h.
|
readwriteatomic |
If YES
, the key-value pair will be released on main thread, otherwise on background thread. Default is NO.
@discussion You may set this value to YES
if the key-value object contains the instance which should be released in main thread (such as UIView/CALayer).
Definition at line 101 of file ThingEncryptMemoryCache.h.
|
readwriteatomic |
If YES
, the cache will remove all objects when the app receives a memory warning. The default value is YES
.
Definition at line 74 of file ThingEncryptMemoryCache.h.
|
readwriteatomic |
If YES
, The cache will remove all objects when the app enter background. The default value is YES
.
Definition at line 80 of file ThingEncryptMemoryCache.h.
|
readatomicassign |
The total cost of objects in the cache (read-only).
Definition at line 27 of file ThingEncryptMemoryCache.h.
|
readatomicassign |
The number of objects in the cache (read-only)
Definition at line 24 of file ThingEncryptMemoryCache.h.