author | Jens Alfke <jens@mooseyard.com> |
Thu Sep 24 21:47:06 2009 -0700 (2009-09-24) | |
changeset 6 | f2cd752db494 |
permissions | -rw-r--r-- |
jens@6 | 1 |
// |
jens@6 | 2 |
// MYVersionDictionary.h |
jens@6 | 3 |
// Ottoman |
jens@6 | 4 |
// |
jens@6 | 5 |
// Created by Jens Alfke on 9/21/09. |
jens@6 | 6 |
// Copyright 2009 Jens Alfke. All rights reserved. |
jens@6 | 7 |
// |
jens@6 | 8 |
|
jens@6 | 9 |
#import <Foundation/NSDictionary.h> |
jens@6 | 10 |
|
jens@6 | 11 |
#ifdef __cplusplus |
jens@6 | 12 |
namespace Mooseyard { |
jens@6 | 13 |
class OverlayDictionary; |
jens@6 | 14 |
class VersionDictionary; |
jens@6 | 15 |
} |
jens@6 | 16 |
#endif |
jens@6 | 17 |
|
jens@6 | 18 |
|
jens@6 | 19 |
/** A persistent NSDictionary embedded in a memory-mapped file, |
jens@6 | 20 |
representing one complete version of a MYOttoman dictionary. */ |
jens@6 | 21 |
@interface MYVersionDictionary : NSDictionary |
jens@6 | 22 |
{ |
jens@6 | 23 |
#ifdef __cplusplus |
jens@6 | 24 |
const Mooseyard::VersionDictionary *_dict; |
jens@6 | 25 |
#else |
jens@6 | 26 |
void *_dict; |
jens@6 | 27 |
#endif |
jens@6 | 28 |
} |
jens@6 | 29 |
|
jens@6 | 30 |
/** The generation number. The first version in a new file is zero. */ |
jens@6 | 31 |
@property (readonly) int generation; |
jens@6 | 32 |
|
jens@6 | 33 |
/** The time at which this version was written to the file. */ |
jens@6 | 34 |
@property (readonly) NSDate *dateCreated; |
jens@6 | 35 |
|
jens@6 | 36 |
/** The previous version, before this one was saved. */ |
jens@6 | 37 |
@property (readonly) MYVersionDictionary *previousVersion; |
jens@6 | 38 |
|
jens@6 | 39 |
/** Is this the latest version in the file? */ |
jens@6 | 40 |
@property (readonly) BOOL isLatestVersion; |
jens@6 | 41 |
|
jens@6 | 42 |
@end |
jens@6 | 43 |
|
jens@6 | 44 |
|
jens@6 | 45 |
|
jens@6 | 46 |
@interface MYCurrentVersionDictionary : NSMutableDictionary |
jens@6 | 47 |
{ |
jens@6 | 48 |
#ifdef __cplusplus |
jens@6 | 49 |
Mooseyard::OverlayDictionary *_dict; |
jens@6 | 50 |
#else |
jens@6 | 51 |
void *_dict; |
jens@6 | 52 |
#endif |
jens@6 | 53 |
} |
jens@6 | 54 |
|
jens@6 | 55 |
@end |