ImageCacheLRU.h 823 B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // ImageCacheLRU.h
  3. // LenzCameraNativeModuleForRN
  4. //
  5. // Created by 王昭威 on 2023/1/23.
  6. //
  7. #import <Foundation/Foundation.h>
  8. NS_ASSUME_NONNULL_BEGIN
  9. @class ImageCacheLRUNode;
  10. @interface ImageCacheLRU : NSObject
  11. @property (nonatomic, strong) ImageCacheLRUNode* head;
  12. @property (nonatomic, strong) ImageCacheLRUNode* tail;
  13. - (UIImage*)queryByKey: (NSString*)key;
  14. - (void)insertByKey: (NSString*)key image: (UIImage*)image;
  15. @end
  16. @interface ImageCacheLRUNode : NSObject
  17. @property (nonatomic, copy) NSString* key;
  18. @property (nonatomic, strong, nullable) ImageCacheLRUNode* previous;
  19. @property (nonatomic, strong, nullable) ImageCacheLRUNode* next;
  20. @property (nonatomic, strong, nullable) UIImage* image;
  21. - (instancetype)initWithImage: (nullable UIImage*)image key: (NSString*)key;
  22. @end
  23. NS_ASSUME_NONNULL_END