home *** CD-ROM | disk | FTP | other *** search
- // EOGlobalID.h
- // Copyright (c) 1995, NeXT Software, Inc. All rights reserved.
- //
- // The EOGlobalID is a compact universal ID for a persistent object
- // and is the key used for uniquing. A EOGlobalID should be suitable
- // for identifying objects between editing contexts both within
- // an application and across application instances (such as when performing
- // distributed change notification).
- //
- #import <Foundation/Foundation.h>
- #import <EOControl/EODefines.h>
-
- // When a newly inserted object becomes persistent, the global ID is changed
- // from a temporary one to a more permanent one. Whenever a swap is made the
- // following notification needs to be published so that anyone holding the
- // original TemporaryGlobalID can change it for the new one. The userInfo
- // dictionary contains a mapping of old globalIDs to the new ones.
- //
- EOCONTROL_EXTERN NSString *EOGlobalIDChangedNotification;
-
- // Abstract class for all ids
- @interface EOGlobalID : NSObject <NSCopying>
- - (BOOL)isEqual:other;
- - (unsigned)hash;
-
- - (BOOL)isTemporary;
- // NO by default
- @end
-
- // EOTemporaryGlobalID is used by the editing context whenever an object
- // is inserted with a nil GlobalID
- //
- @interface EOTemporaryGlobalID : EOGlobalID <NSCoding>
- {
- unsigned _uintValue;
- unsigned _refCount;
- }
-
- - init;
- // automatically assignes a new sequence number
-
- - (BOOL)isTemporary;
- // Always YES
-
- - (void)encodeWithCoder:(NSCoder *)aCoder;
- - (id)initWithCoder:(NSCoder *)aDecoder;
- // TemporaryGlobalIDs are not globally unique when archived -- they are unique
- // only to one instance of a single process. Passing them between processes
- // generally won't work unless only one of the processes ever allocates ids
- @end
-