WAStateRegistry


Seaside-StateRegistry

Comment:



Hierarchy:

ProtoObject
Object
WAStateRegistry

Summary:

instance variables:

lastSnapshot objects

methods:

instance class
as yet unclassified as yet unclassified

Detail:

instance variables:

lastSnapshot
inferredType:
UndefinedObject
objects
InitialValue:
a WeakIdentityKeyDictionary()
inferredType:
WeakIdentityKeyDictionary

instance methods:

as yet unclassified
calculateFootprint

	^ (objects detectSum: [:ea | 2 + ea class instSize + (ea class isVariable ifTrue: [ea size + 1] ifFalse: [0])]) * 4
initialize

	objects _ SeasidePlatformSupport weakDictionaryOfSize: 10.
registerObject: anObject

	objects at: anObject put: anObject snapshotCopy
restoreLastSnapshot

	lastSnapshot ifNotNil: [self restoreSnapshot: lastSnapshot]
restoreObject: object fromSnapshot: copy

	object restoreFromSnapshot: copy.
	objects at: object put: copy.
restoreSnapshot: aDictionary

	aDictionary keysAndValuesDo:
		[:k :v |
		self restoreObject: k fromSnapshot: v]
size

	^ objects size
snapshot

	lastSnapshot := SeasidePlatformSupport weakDictionaryOfSize: objects size.
	objects keysAndValuesDo:
		[:obj :copy|
		(obj isIdenticalToSnapshot: copy)
			ifTrue: [lastSnapshot at: obj put: copy]
			ifFalse: [lastSnapshot at: obj put: obj snapshotCopy]].
	^ lastSnapshot

class methods:

as yet unclassified
new

	^ super new initialize

^top


- made by Dandelion -