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