jens@6: //
jens@6: //  MYVersionDictionary.h
jens@6: //  Ottoman
jens@6: //
jens@6: //  Created by Jens Alfke on 9/21/09.
jens@6: //  Copyright 2009 Jens Alfke. All rights reserved.
jens@6: //
jens@6: 
jens@6: #import <Foundation/NSDictionary.h>
jens@6: 
jens@6: #ifdef __cplusplus
jens@6: namespace Mooseyard {
jens@6:     class OverlayDictionary;
jens@6:     class VersionDictionary;
jens@6: }
jens@6: #endif
jens@6: 
jens@6: 
jens@6: /** A persistent NSDictionary embedded in a memory-mapped file, 
jens@6:     representing one complete version of a MYOttoman dictionary. */
jens@6: @interface MYVersionDictionary : NSDictionary
jens@6: {
jens@6: #ifdef __cplusplus
jens@6:     const Mooseyard::VersionDictionary *_dict;
jens@6: #else
jens@6:     void *_dict;
jens@6: #endif
jens@6: }
jens@6: 
jens@6: /** The generation number. The first version in a new file is zero. */
jens@6: @property (readonly) int generation;
jens@6: 
jens@6: /** The time at which this version was written to the file. */
jens@6: @property (readonly) NSDate *dateCreated;
jens@6: 
jens@6: /** The previous version, before this one was saved. */
jens@6: @property (readonly) MYVersionDictionary *previousVersion;
jens@6: 
jens@6: /** Is this the latest version in the file? */
jens@6: @property (readonly) BOOL isLatestVersion;
jens@6: 
jens@6: @end
jens@6: 
jens@6: 
jens@6: 
jens@6: @interface MYCurrentVersionDictionary : NSMutableDictionary
jens@6: {
jens@6: #ifdef __cplusplus
jens@6:     Mooseyard::OverlayDictionary *_dict;
jens@6: #else
jens@6:     void *_dict;
jens@6: #endif
jens@6: }
jens@6: 
jens@6: @end