1417
|
1 |
'From Smalltalk/X, Version:4.1.1 on 24-Okt-2000 at 12:50:49' !
|
|
2 |
|
1415
|
3 |
"{ Package: 'cg:private' }"
|
|
4 |
|
|
5 |
Object subclass:#SnapShotImage
|
|
6 |
instanceVariableNames:'memory globals'
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'System-Support'
|
|
10 |
!
|
|
11 |
|
|
12 |
|
|
13 |
!SnapShotImage class methodsFor:'instance creation'!
|
|
14 |
|
|
15 |
for:aFilename
|
|
16 |
^ self new for:aFilename
|
|
17 |
! !
|
|
18 |
|
|
19 |
!SnapShotImage methodsFor:'private'!
|
|
20 |
|
|
21 |
fetchGlobals
|
1417
|
22 |
globals := IdentityDictionary new.
|
1415
|
23 |
memory globalEntries do:[:eachEntry |
|
1417
|
24 |
|nameSymRef valRef nameSym value|
|
1415
|
25 |
|
1417
|
26 |
nameSymRef := eachEntry key.
|
|
27 |
valRef := eachEntry value.
|
|
28 |
nameSymRef isImageSymbol ifFalse:[self halt].
|
1415
|
29 |
|
1417
|
30 |
nameSym := (memory printStringOfSymbol:nameSymRef) asSymbol.
|
|
31 |
globals at:nameSym put:valRef
|
1415
|
32 |
].
|
|
33 |
!
|
|
34 |
|
|
35 |
for:aFilename
|
|
36 |
memory := SnapShotImageMemory for:aFilename.
|
|
37 |
memory readHeader
|
|
38 |
! !
|
|
39 |
|
|
40 |
!SnapShotImage methodsFor:'smalltalk protocol'!
|
|
41 |
|
|
42 |
allClassesDo:aBlock
|
1417
|
43 |
self keysAndValuesDo:[:key :valRef |
|
|
44 |
valRef isInteger ifFalse:[
|
|
45 |
valRef ~~ true ifTrue:[
|
|
46 |
valRef ~~ false ifTrue:[
|
|
47 |
valRef notNil ifTrue:[
|
|
48 |
valRef isImageBehavior ifTrue:[
|
|
49 |
aBlock value:valRef
|
|
50 |
]
|
|
51 |
]
|
|
52 |
]
|
|
53 |
]
|
1415
|
54 |
]
|
|
55 |
].
|
|
56 |
!
|
|
57 |
|
1417
|
58 |
at:aKey
|
|
59 |
globals isNil ifTrue:[
|
|
60 |
self fetchGlobals
|
|
61 |
].
|
|
62 |
^ globals at:aKey
|
|
63 |
!
|
|
64 |
|
1415
|
65 |
keysAndValuesDo:aTwoArgBlock
|
|
66 |
globals isNil ifTrue:[
|
|
67 |
self fetchGlobals
|
|
68 |
].
|
|
69 |
globals keysAndValuesDo:aTwoArgBlock
|
|
70 |
! !
|
|
71 |
|
|
72 |
!SnapShotImage class methodsFor:'documentation'!
|
|
73 |
|
|
74 |
version
|
|
75 |
^ '$Header$'
|
|
76 |
! !
|