LRUCacheNode.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Licensed under the Apache License, Version 2.0 (the "License");
  3. * you may not use this file except in compliance with the License.
  4. * See the NOTICE file distributed with this work for additional
  5. * information regarding copyright ownership.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. NS_ASSUME_NONNULL_BEGIN
  18. @interface LRUCacheNode : NSObject
  19. /*! Node value */
  20. @property (nonatomic, readonly) id value;
  21. /*! Node key */
  22. @property (nonatomic, readonly) id<NSCopying> key;
  23. /*! Pointer to the next node */
  24. @property (nonatomic, nullable) LRUCacheNode *next;
  25. /*! Pointer to the previous node */
  26. @property (nonatomic, nullable) LRUCacheNode *prev;
  27. /**
  28. Factory method to create a new cache node with the given value and key
  29. @param value Node value
  30. @param key Node key
  31. @returns Cache node instance
  32. */
  33. + (instancetype)nodeWithValue:(id)value key:(id<NSCopying>)key;
  34. @end
  35. NS_ASSUME_NONNULL_END