Reimplementation of processRecentChanges handling. (see ChangeLog)

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20656 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Ayers 2005-02-03 18:19:29 +00:00
parent 556940e16b
commit 246b40bc6a
3 changed files with 1196 additions and 699 deletions

View file

@ -25,9 +25,74 @@
(-forgetLocksForObjectsWithGlobalIDs:) Ditto.
* EOAccess/EODatabaseDataSource.m (-insertObject): Do not
insert object into the editing context.
* EOAdaptors/Postgres95/Postgres95Adaptor.m (externalTypeNames):
Add new types.
* EOControl/EOEditingContext.h
(_objectsById): Rename to _globalIDsByObject.
(ignoreSharedContextNotifications, isSharedContextLocked): Added.
(_sharedContext, fetchTimestamp): Ditto.
(-_insertObject:withGlobalID:, -_observeUndoManagerNotifications)
(-_processDeletedObjects)
(-_processOwnedObjectsUsingChangeTable:deleteTable:)
(-_registerClearStateWithUndoManager): Remove public declarations
of private methods.
(-didMergeChangedObjectsInEditingContext:) Rename to
-editingContextDidMergeChanges:.
* EOControl/EOEditingContext.m: Update header dependencies.
Declare private methods locally.
(EOThreadSafeQueue): New local class.
(null, EOEditingContextClass, EOAssociationClass)
(ecDeallocHT, assocDeallocHT): New static local variables.
(EOConstObject, EOConstChanges, EOConstKey, EOConstValue)
(EOConstAdd, EOConstDel): Added experimental variables.
(_mergeValueForKey): New function.
(-_mergeObject:withChanges:): Implement.
(-_objectBasedChangeInfoForGIDInfo:): Ditto.
(-_processObjectStoreChanges:): Implement.
(-_objectsChangedInStore:): Reimplement.
(-_changesFromInvalidatingObjectsWithGlobalIDs:): Implement.
(-_uncommittedChangesForObject:fromSnapshot:): Implement.
(-_mutableSetFromToManyArray:): Implement.
(-_globalIDChanged:): Reimplement.
(-_processNotificationQueue): Implement.
(-_sendOrEnqueueNotification:selector:): Implement.
(-invalidateAllObjects): Reimplement.
(-_forgetObjectWithGlobalID:): Implement.
(-_invalidateObject:withGlobalID:) Implement.
(-_invalidateObjectWithGlobalID:) Implement.
(-_invalidateObjectsWithGlobalIDs:) Implement.
(-invalidateObjectsWithGlobalIDs:) Reimplement.
(-_resetAllChanges:): Implement.
(-_resetAllChanges): Implement.
(-_enqueueEndOfEventNotification): Reimplement.
(-_processEndOfEventNotification): Reimplement.
(-noop:): Implement.
(-_undoManagerCheckpoint:): Remove TODO.
(-processRecentChanges): Ditto.
(-_processRecentChanges:): Reimplement.
(-_clearChangedThisTransaction:): Implement.
(+initialize): Initialize some static variables.
(+objectDeallocated:): Implemented.
(_objectsById): Update usages with _globalIDsByObject.
Do not retain objects but rely on new objectDeallocated:
mechanism.
(-initWithParentObjectStore:): Initialize undo manager.
(-init): Make more gdb friendly.
(-insertObject:): Use standard autorelease macro.
(-_insertObject:withGlobalID:) Always insert the a new object
into the inserted objects independent of previous GID mappings.
(-hasChanges): Also check unprocessed changes.
(-revert): Enable undo manager handling.
(-objectWillChange:): Register for revert.
(-recordObject:globalID:): Initialize ecDeallocHT and insert
objects that are registered.
(-forgetObject:): Remove objects from ecDeallocHT.
([NSObject-dealloc]): Added hack to automagically deregister
objects fromm the editing context and association mappings.
2005-02-02 Matt Rice <ratmice@yahoo.com>
* EOAccess/EOEntity.m (-setName:): Validate the new name and remove

View file

@ -52,6 +52,7 @@
{
EOObjectStore *_objectStore;
NSUndoManager *_undoManager;
NSHashTable *_unprocessedChanges;
NSHashTable *_unprocessedDeletes;
NSHashTable *_unprocessedInserts;
@ -59,7 +60,7 @@
NSHashTable *_deletedObjects;
NSHashTable *_changedObjects;
NSMapTable *_objectsById;
NSMapTable *_globalIDsByObject;
NSMapTable *_objectsByGID;
NSMutableDictionary *_snapshotsByGID;
NSMutableDictionary *_eventSnapshotsByGID;
@ -68,6 +69,7 @@
NSMutableArray *_editors;
id _messageHandler;
unsigned short _undoTransactionID;
struct {
unsigned registeredForCallback:1;
unsigned propagatesDeletesAtEndOfEvent:1;
@ -80,8 +82,11 @@
unsigned registeredUndoTransactionID:1;
unsigned retainsAllRegisteredObjects:1;
unsigned lockUsingParent:1;
unsigned unused:5;
unsigned ignoreSharedContextNotifications:1;
unsigned isSharedContextLocked:1;
unsigned unused:3;
} _flags;
struct {
unsigned willRunLoginPanel:1;
unsigned shouldFetchObjects:1;
@ -94,9 +99,11 @@
} _delegateRespondsTo;
NSRecursiveLock*_lock;
id _sharedContext;
int _lockCount;
id _notificationQueue;
NSAutoreleasePool * _lockPool;
NSTimeInterval fetchTimestamp;
}
+ (void)setDefaultFetchTimestampLag: (NSTimeInterval)lag;
@ -112,8 +119,6 @@
- (void)insertObject: (id)object;
- (void)insertObject: (id)object
withGlobalID: (EOGlobalID *)gid;
- (void)_insertObject: (id)object
withGlobalID: (EOGlobalID *)gid;
-(void)setLevelsOfUndo: (int)levels;
@ -138,8 +143,6 @@
- (void)setUndoManager: (NSUndoManager *)undoManager;
- (NSUndoManager *)undoManager;
- (void)_observeUndoManagerNotifications;
- (void)objectWillChange: (id)object;
- (void)recordObject: (id)object
@ -155,9 +158,6 @@
- (NSArray *)insertedObjects;
- (NSArray *)deletedObjects;
- (void)_processDeletedObjects;
- (void)_processOwnedObjectsUsingChangeTable: (NSHashTable *)changeTable
deleteTable: (NSHashTable *)deleteTable;
- (void)propagatesDeletesUsingTable: (NSHashTable *)deleteTable;
- (void)validateDeletesUsingTable: (NSHashTable *)deleteTable;
- (BOOL)validateTable: (NSHashTable *)table
@ -167,7 +167,6 @@
- (void)processRecentChanges;
- (void)_registerClearStateWithUndoManager;
- (BOOL)propagatesDeletesAtEndOfEvent;
- (void)setPropagatesDeletesAtEndOfEvent: (BOOL)propagatesDeletesAtEndOfEvent;
@ -287,9 +286,8 @@ shouldInvalidateObject: (id)object
shouldFetchObjectsDescribedByFetchSpecification: (EOFetchSpecification *)fetchSpecification;
- (BOOL)editingContext: (EOEditingContext *)editingContext
shouldMergeChangedObject: (id)object;
- (void)didMergeChangedObjectsInEditingContext: (EOEditingContext *)editingContext;
shouldMergeChangesForObject: (id)object;
- (void)editingContextDidMergeChanges: (EOEditingContext *)editingContext;
@end

File diff suppressed because it is too large Load diff