/core/externals/update-engine/Core/KSMemoryTicketStore.h

http://macfuse.googlecode.com/ · C Header · 42 lines · 7 code · 5 blank · 30 comment · 0 complexity · 4626fc14d31efda9ad4628981fe527a3 MD5 · raw file

  1. // Copyright 2008 Google Inc.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #import <Foundation/Foundation.h>
  15. #import "KSTicketStore.h"
  16. // KSMemoryTicketStore
  17. //
  18. // This KSTicketStore subclass represents an in-memory, temporary ticket store
  19. // that does not persist across invocations of the application. The tickets
  20. // stored in this store are only stored as long as the KSMemoryTicketStore
  21. // instance exists. This is simply a KSTicketStore that is backed by an
  22. // in-memory NSDictionary rather than disk. The arg passed to -initWithPath:
  23. // MUST be nil.
  24. //
  25. // Sample usage:
  26. //
  27. // KSTicket *t = ...
  28. // KSTicketStore *ts = [[KSMemoryTicketStore alloc] init];
  29. // [ts storeTicket:t]; // [ts ticketCount] == 1
  30. // [ts storeDeleteTicket:t]; // [ts ticketCount] == 0
  31. //
  32. @interface KSMemoryTicketStore : KSTicketStore {
  33. @private
  34. NSMutableDictionary *tickets_;
  35. }
  36. // No new methods added. See KSTicketStore.h for API.
  37. @end