SnapShotImage.st
changeset 1418 7466259d8bb5
parent 1417 28d6026fe30c
child 1422 948a90b76e72
equal deleted inserted replaced
1417:28d6026fe30c 1418:7466259d8bb5
     1 'From Smalltalk/X, Version:4.1.1 on 24-Okt-2000 at 12:50:49'                    !
       
     2 
       
     3 "{ Package: 'cg:private' }"
     1 "{ Package: 'cg:private' }"
     4 
     2 
     5 Object subclass:#SnapShotImage
     3 Object subclass:#SnapShotImage
     6 	instanceVariableNames:'memory globals'
     4 	instanceVariableNames:'memory globals'
     7 	classVariableNames:''
     5 	classVariableNames:''
    32     ].
    30     ].
    33 !
    31 !
    34 
    32 
    35 for:aFilename
    33 for:aFilename
    36     memory := SnapShotImageMemory for:aFilename.
    34     memory := SnapShotImageMemory for:aFilename.
    37     memory readHeader
    35     memory image:self.
    38 ! !
    36     memory readHeader! !
    39 
    37 
    40 !SnapShotImage methodsFor:'smalltalk protocol'!
    38 !SnapShotImage methodsFor:'smalltalk protocol'!
    41 
    39 
    42 allClassesDo:aBlock
    40 allClassesDo:aBlock
    43     self keysAndValuesDo:[:key :valRef |
    41     self keysAndValuesDo:[:key :valRef |
    53             ]
    51             ]
    54         ]
    52         ]
    55     ].
    53     ].
    56 !
    54 !
    57 
    55 
       
    56 allClassesInCategory:aCategory
       
    57     |coll|
       
    58 
       
    59     coll := OrderedCollection new.
       
    60     self allClassesInCategory:aCategory do:[:aClass |
       
    61         coll add:aClass
       
    62     ].
       
    63     ^ coll!
       
    64 
       
    65 allClassesInCategory:aCategory do:aBlock
       
    66     "evaluate the argument, aBlock for all classes in the aCategory;
       
    67      The order of the classes is not defined."
       
    68 
       
    69     aCategory notNil ifTrue:[
       
    70         self allClassesDo:[:aClass |
       
    71             aClass isMeta ifFalse:[
       
    72                 (aClass category = aCategory) ifTrue:[
       
    73                     aBlock value:aClass
       
    74                 ]
       
    75             ]
       
    76         ]
       
    77     ]!
       
    78 
    58 at:aKey
    79 at:aKey
    59     globals isNil ifTrue:[
    80     globals isNil ifTrue:[
    60         self fetchGlobals
    81         self fetchGlobals
    61     ].
    82     ].
    62     ^ globals at:aKey
    83     ^ globals at:aKey
    63 !
    84 !
       
    85 
       
    86 at:aKey ifAbsent:exceptionValue
       
    87     globals isNil ifTrue:[
       
    88         self fetchGlobals
       
    89     ].
       
    90     ^ globals at:aKey ifAbsent:exceptionValue!
    64 
    91 
    65 keysAndValuesDo:aTwoArgBlock
    92 keysAndValuesDo:aTwoArgBlock
    66     globals isNil ifTrue:[
    93     globals isNil ifTrue:[
    67         self fetchGlobals
    94         self fetchGlobals
    68     ].
    95     ].