KHolder.h 658 B

123456789101112131415161718192021222324252627282930
  1. //
  2. // KHolder.h
  3. // KacheDemo
  4. //
  5. // Created by jiajun on 7/25/12.
  6. // Copyright (c) 2012 __MyCompanyName__. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @class KQueue;
  10. @class KPool;
  11. @class KObject;
  12. @interface KHolder : NSObject
  13. {
  14. NSMutableDictionary *objects;
  15. NSMutableArray *keys;
  16. NSUInteger size;
  17. }
  18. - (void)setValue:(id)value forKey:(NSString *)key expiredAfter:(NSInteger)duration;
  19. - (id)valueForKey:(NSString *)key;
  20. - (KObject *)objectForKey:(NSString *)key;
  21. - (void)removeObjectForKey:(NSString *)key;
  22. - (NSDictionary *)serialize;
  23. - (void)unserializeFrom:(NSDictionary *)dict;
  24. @end