'From Haver 6.0 [latest update: #5092] on 9 March 2022 at 9:50:37 pm'!
'Description Yet another try on some means of peristence.'!
!provides: 'PlanE' 1 47!
!requires: 'Cuis-Base' 50 4594 nil!
!requires: 'Transactions' 1 26 nil!
!requires: 'Collections-TwoAndEightByteArrays' 1 1 nil!
SystemOrganization addCategory: 'PlanE'!
SystemOrganization addCategory: 'PlanE-Records'!
SystemOrganization addCategory: 'PlanE-Proxies'!
!moduleCreation: PlanE!
Modules newEnvironment: #PlanE!
!interfacesOf: PlanE!
Modules environment: #PlanE ::
interface: #SPI exporting: #(#DoubleWordArrayRecord #AbstractMetaRecord #AbstractAtomicRecord #CompiledMethodProxy #ObjectRecord #AbstractProxy #LargeNegativeIntegerRecord #PositiveSmallIntegerRecord #FileStore #DoubleByteArrayRecord #StringRecord #RootsRecord #ModuleProxy #AbstractAtomicCollectionRecord #UninternedSymbolRecord #SetRecord #ByteArrayRecord #InternedSymbolRecord #TransactionManager #DictionaryRecord #AbstractLargeIntegerRecord #AbstractSmallIntegerRecord #Transaction #WordArrayRecord #AbstractStringLike #LargePositiveIntegerRecord #StoreRecord #AbstractSetRecord #PlanE #AbstractRecord #EnvironmentProxy #NegativeSmallIntegerRecord #AbstractStatelessProxy #AbstractClassRecord #CodePackageProxy #PlanEClassRecord #PersistentObject #LocalSymbolProxy #SmalltalkProxy #BaseClassRecord #ClassRecord #AbstractInstanceRecord ) ::
interface: #UTI exporting: #(#DoubleWordArrayRecord #AbstractMetaRecord #AbstractAtomicRecord #CompiledMethodProxy #ObjectRecord #AbstractProxy #LargeNegativeIntegerRecord #PositiveSmallIntegerRecord #FileStore #DoubleByteArrayRecord #StringRecord #RootsRecord #ModuleProxy #AbstractAtomicCollectionRecord #UninternedSymbolRecord #SetRecord #ByteArrayRecord #InternedSymbolRecord #TransactionManager #DictionaryRecord #AbstractLargeIntegerRecord #AbstractSmallIntegerRecord #Transaction #WordArrayRecord #AbstractStringLike #LargePositiveIntegerRecord #StoreRecord #AbstractSetRecord #PlanE #AbstractRecord #EnvironmentProxy #RunningWorldProxy #NegativeSmallIntegerRecord #AbstractStatelessProxy #AbstractClassRecord #CodePackageProxy #PlanEClassRecord #PersistentObject #LocalSymbolProxy #SmalltalkProxy #BaseClassRecord #ClassRecord #AbstractInstanceRecord ) ::
interface: #Store exporting: #(#(#Store #FileStore) ) ::
interface: #API exporting: #(#PlanE )!
!importsOf: PlanE!
Modules environment: #PlanE ::
import: #(#Transaction #ObjectTracker #TransactionManager ) from: #SPI of: Modules>>#Transactions!
!classDefinition: (Modules>>#PlanE>>#Transaction) category: 'PlanE'!
(Modules>>#Transactions>>#Transaction) subclass: #Transaction
instanceVariableNames: 'manager'
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#Transaction) class category: 'PlanE'!
(Modules>>#PlanE>>#Transaction) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#TransactionManager) category: 'PlanE'!
(Modules>>#Transactions>>#TransactionManager) subclass: #TransactionManager
instanceVariableNames: 'fileStore'
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#TransactionManager) class category: 'PlanE'!
(Modules>>#PlanE>>#TransactionManager) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#FileStore) category: 'PlanE'!
Object subclass: #FileStore
instanceVariableNames: 'stream positionsToObjects objectsToPositions proxies fixUps roots objectsToUpdate'
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#FileStore) class category: 'PlanE'!
(Modules>>#PlanE>>#FileStore) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#PersistentObject) category: 'PlanE'!
Object subclass: #PersistentObject
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#PersistentObject) class category: 'PlanE'!
(Modules>>#PlanE>>#PersistentObject) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#PlanE) category: 'PlanE'!
Object subclass: #PlanE
instanceVariableNames: 'fileStore transactionManager'
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#PlanE) class category: 'PlanE'!
(Modules>>#PlanE>>#PlanE) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#AbstractRecord) category: 'PlanE-Records'!
Object subclass: #AbstractRecord
instanceVariableNames: 'store position'
classVariableNames: 'MagicNumbersToClasses'
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#AbstractRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractRecord) class
instanceVariableNames: 'magicWords'!
!classDefinition: (Modules>>#PlanE>>#AbstractClassRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractRecord) subclass: #AbstractClassRecord
instanceVariableNames: 'className'
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#AbstractClassRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractClassRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#BaseClassRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractClassRecord) subclass: #BaseClassRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#BaseClassRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#BaseClassRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#ClassRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractClassRecord) subclass: #ClassRecord
instanceVariableNames: 'package environment'
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#ClassRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#ClassRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#PlanEClassRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractClassRecord) subclass: #PlanEClassRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#PlanEClassRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#PlanEClassRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#AbstractInstanceRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractRecord) subclass: #AbstractInstanceRecord
instanceVariableNames: 'object'
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#AbstractInstanceRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractInstanceRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#AbstractAtomicRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractInstanceRecord) subclass: #AbstractAtomicRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#AbstractAtomicRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractAtomicRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#AbstractAtomicCollectionRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractAtomicRecord) subclass: #AbstractAtomicCollectionRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#AbstractAtomicCollectionRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractAtomicCollectionRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#AbstractLargeIntegerRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractAtomicCollectionRecord) subclass: #AbstractLargeIntegerRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#AbstractLargeIntegerRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractLargeIntegerRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#LargeNegativeIntegerRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractLargeIntegerRecord) subclass: #LargeNegativeIntegerRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#LargeNegativeIntegerRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#LargeNegativeIntegerRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#LargePositiveIntegerRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractLargeIntegerRecord) subclass: #LargePositiveIntegerRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#LargePositiveIntegerRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#LargePositiveIntegerRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#AbstractStringLike) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractAtomicCollectionRecord) subclass: #AbstractStringLike
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#AbstractStringLike) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractStringLike) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#InternedSymbolRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractStringLike) subclass: #InternedSymbolRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#InternedSymbolRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#InternedSymbolRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#StringRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractStringLike) subclass: #StringRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#StringRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#StringRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#UninternedSymbolRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractStringLike) subclass: #UninternedSymbolRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#UninternedSymbolRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#UninternedSymbolRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#ByteArrayRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractAtomicCollectionRecord) subclass: #ByteArrayRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#ByteArrayRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#ByteArrayRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#DoubleByteArrayRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractAtomicCollectionRecord) subclass: #DoubleByteArrayRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#DoubleByteArrayRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#DoubleByteArrayRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#DoubleWordArrayRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractAtomicCollectionRecord) subclass: #DoubleWordArrayRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#DoubleWordArrayRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#DoubleWordArrayRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#WordArrayRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractAtomicCollectionRecord) subclass: #WordArrayRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#WordArrayRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#WordArrayRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#AbstractSmallIntegerRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractAtomicRecord) subclass: #AbstractSmallIntegerRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#AbstractSmallIntegerRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractSmallIntegerRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#NegativeSmallIntegerRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractSmallIntegerRecord) subclass: #NegativeSmallIntegerRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#NegativeSmallIntegerRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#NegativeSmallIntegerRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#PositiveSmallIntegerRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractSmallIntegerRecord) subclass: #PositiveSmallIntegerRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#PositiveSmallIntegerRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#PositiveSmallIntegerRecord) class
instanceVariableNames: ''!
!classDefinition: #FloatRecord category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractAtomicRecord) subclass: #FloatRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'!
!classDefinition: 'FloatRecord class' category: 'PlanE-Records'!
FloatRecord class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#AbstractSetRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractInstanceRecord) subclass: #AbstractSetRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#AbstractSetRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractSetRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#DictionaryRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractSetRecord) subclass: #DictionaryRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#DictionaryRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#DictionaryRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#SetRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractSetRecord) subclass: #SetRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#SetRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#SetRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#ObjectRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractInstanceRecord) subclass: #ObjectRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#ObjectRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#ObjectRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#AbstractMetaRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractRecord) subclass: #AbstractMetaRecord
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#AbstractMetaRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractMetaRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#RootsRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractMetaRecord) subclass: #RootsRecord
instanceVariableNames: 'roots'
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#RootsRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#RootsRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#StoreRecord) category: 'PlanE-Records'!
(Modules>>#PlanE>>#AbstractMetaRecord) subclass: #StoreRecord
instanceVariableNames: 'storedMagicString storedVersion'
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Records'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#StoreRecord) class category: 'PlanE-Records'!
(Modules>>#PlanE>>#StoreRecord) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#AbstractStatelessProxy) category: 'PlanE-Proxies'!
Object subclass: #AbstractStatelessProxy
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Proxies'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#AbstractStatelessProxy) class category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#AbstractStatelessProxy) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#AbstractProxy) category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#AbstractStatelessProxy) subclass: #AbstractProxy
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Proxies'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#AbstractProxy) class category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#AbstractProxy) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#ClosureProxy) category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#AbstractProxy) subclass: #ClosureProxy
instanceVariableNames: 'serializeable'
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Proxies'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#ClosureProxy) class category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#ClosureProxy) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#CodePackageProxy) category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#AbstractProxy) subclass: #CodePackageProxy
instanceVariableNames: 'feature fullFileName'
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Proxies'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#CodePackageProxy) class category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#CodePackageProxy) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#CompiledMethodProxy) category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#AbstractProxy) subclass: #CompiledMethodProxy
instanceVariableNames: 'methodClass methodSelector'
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Proxies'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#CompiledMethodProxy) class category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#CompiledMethodProxy) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#EnvironmentProxy) category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#AbstractProxy) subclass: #EnvironmentProxy
instanceVariableNames: 'managerName environmentName'
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Proxies'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#EnvironmentProxy) class category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#EnvironmentProxy) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#LocalSymbolProxy) category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#AbstractProxy) subclass: #LocalSymbolProxy
instanceVariableNames: 'symbolString environment'
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Proxies'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#LocalSymbolProxy) class category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#LocalSymbolProxy) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#ModuleProxy) category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#AbstractProxy) subclass: #ModuleProxy
instanceVariableNames: 'moduleName package'
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Proxies'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#ModuleProxy) class category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#ModuleProxy) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#WorldMorphProxy) category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#AbstractProxy) subclass: #WorldMorphProxy
instanceVariableNames: 'submorphs'
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Proxies'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#WorldMorphProxy) class category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#WorldMorphProxy) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#GenericProxy) category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#AbstractStatelessProxy) subclass: #GenericProxy
instanceVariableNames: 'principalClass principalState'
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Proxies'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#GenericProxy) class category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#GenericProxy) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#RunningWorldProxy) category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#AbstractStatelessProxy) subclass: #RunningWorldProxy
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Proxies'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#RunningWorldProxy) class category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#RunningWorldProxy) class
instanceVariableNames: ''!
!classDefinition: (Modules>>#PlanE>>#SmalltalkProxy) category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#AbstractStatelessProxy) subclass: #SmalltalkProxy
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PlanE-Proxies'
inModule: #PlanE!
!classDefinition: (Modules>>#PlanE>>#SmalltalkProxy) class category: 'PlanE-Proxies'!
(Modules>>#PlanE>>#SmalltalkProxy) class
instanceVariableNames: ''!
!(Modules>>#PlanE>>#Transaction) commentStamp: '<historical>' prior: 0!
I am the PlanE transaction.!
!(Modules>>#PlanE>>#TransactionManager) commentStamp: '<historical>' prior: 0!
I am the PlanE transaction manager.!
!(Modules>>#PlanE>>#FileStore) commentStamp: '<historical>' prior: 0!
I am a PlanE store, that stores everything into a file.!
!(Modules>>#PlanE>>#PersistentObject) commentStamp: '<historical>' prior: 0!
I am a super class for persistent objects.
I register automatically with my transaction manager.!
!(Modules>>#PlanE>>#PlanE) commentStamp: '<historical>' prior: 0!
I am PlanE's API.!
!(Modules>>#PlanE>>#AbstractRecord) commentStamp: '<historical>' prior: 0!
I am the abstract super class of a database record.!
!(Modules>>#PlanE>>#BaseClassRecord) commentStamp: '<historical>' prior: 0!
I am a record for a class in Cuis's base system.
I just have a class name, no package no environment.!
!(Modules>>#PlanE>>#ClassRecord) commentStamp: '<historical>' prior: 0!
I am a record for a class.!
!(Modules>>#PlanE>>#AbstractInstanceRecord) commentStamp: '<historical>' prior: 0!
I am the asbtract super class for all instance records.!
!(Modules>>#PlanE>>#AbstractAtomicRecord) commentStamp: '<historical>' prior: 0!
I a the abstract super class for all types that are treated as atomic.!
!(Modules>>#PlanE>>#AbstractAtomicCollectionRecord) commentStamp: '<historical>' prior: 0!
I am the abstract superclass for all atomic collections.!
!(Modules>>#PlanE>>#InternedSymbolRecord) commentStamp: '<historical>' prior: 0!
I am the record for interned symbols.!
!(Modules>>#PlanE>>#StringRecord) commentStamp: '<historical>' prior: 0!
I am the record for strings.!
!(Modules>>#PlanE>>#AbstractSetRecord) commentStamp: '<historical>' prior: 0!
I am the abstract super class for all set records.
I provide a space optimized representation
and I avoid rehashing the object after a load.!
!(Modules>>#PlanE>>#SetRecord) commentStamp: '<historical>' prior: 0!
I am the record for sets.
Persisting sets works with the standard mechanism,
but needs a rehash. Rehashing aSets creats a copy
by adding all elements to an empty set.
We can do the same in one go.!
!(Modules>>#PlanE>>#ObjectRecord) commentStamp: '<historical>' prior: 0!
I am the record for ordinary fixed instance size Smalltalk object!
!(Modules>>#PlanE>>#AbstractMetaRecord) commentStamp: '<historical>' prior: 0!
I am the abstract super class of all record objects that manage the database state.!
!(Modules>>#PlanE>>#RootsRecord) commentStamp: '<historical>' prior: 0!
I hold the database's root objects.
My number of root objects -- my size -- has utterly pragmatic reasons.
The pseudo positions for nil, true and false should be used by something sensible.!
!(Modules>>#PlanE>>#StoreRecord) commentStamp: '<historical>' prior: 0!
I am the record that describes the store itself.!
!(Modules>>#PlanE>>#AbstractProxy) commentStamp: '<historical>' prior: 0!
I am the abstract superclass of all classes with instances that are not directly stored in the database.!
!(Modules>>#PlanE>>#ClosureProxy) commentStamp: '<historical>' prior: 0!
I am a proxy for block closures.!
!(Modules>>#PlanE>>#CodePackageProxy) commentStamp: '<historical>' prior: 0!
I am the proxy for a code package.!
!(Modules>>#PlanE>>#CompiledMethodProxy) commentStamp: '<historical>' prior: 0!
I am the proxy for a compiled method.!
!(Modules>>#PlanE>>#EnvironmentProxy) commentStamp: '<historical>' prior: 0!
I am a proxy for an environment.!
!(Modules>>#PlanE>>#LocalSymbolProxy) commentStamp: '<historical>' prior: 0!
I am the proxy for symbols with an environment.!
!(Modules>>#PlanE>>#ModuleProxy) commentStamp: '<historical>' prior: 0!
I am the proxy for a module, I also store the package.!
!(Modules>>#PlanE>>#WorldMorphProxy) commentStamp: '<historical>' prior: 0!
I am the proxy for world moprhs. In most cases I am not used for the running world.!
!(Modules>>#PlanE>>#GenericProxy) commentStamp: '<historical>' prior: 0!
I am a generic proxy with getter and setter blocks and a state object which is persisted.!
!(Modules>>#PlanE>>#RunningWorldProxy) commentStamp: '<historical>' prior: 0!
I am the proxy for the running world.!
!(Modules>>#PlanE>>#SmalltalkProxy) commentStamp: '<historical>' prior: 0!
I am the proxy for Smalltalk.!
!(Modules>>#PlanE>>#StoreRecord) methodsFor: 'printing' stamp: 'KLG 5/14/2021 22:18:18'!
printOn: aStream
"Answer a decent string representation."
aStream
nextPutAll: self class name;
nextPut: $(.
storedMagicString
ifNil: [
aStream nextPutAll:
(storedVersion
ifNil: [ 'New' ]
ifNotNil: [ 'Inconsistent ' ]) ]
ifNotNil: [
aStream nextPutAll:
(self checkHeader
ifNil: [ 'OK' ]
ifNotNil: [ :errorString | errorString ] ) ].
aStream nextPut: $)! !
!(Modules>>#PlanE>>#Transaction) methodsFor: 'accessing' stamp: 'KLG 5/21/2021 17:01:06'!
manager
"Answer the value of manager"
self flagHaver: 'XXX: This might have concurrency issues!!'.
^ manager! !
!(Modules>>#PlanE>>#Transaction) methodsFor: 'accessing' stamp: 'KLG 5/21/2021 16:50:26'!
manager: anObject
"Set the value of manager"
manager _ anObject! !
!(Modules>>#PlanE>>#Transaction) methodsFor: 'accessing' stamp: 'KLG 5/21/2021 17:00:25'!
managerNoLocking
"Answer the value of manager"
^ manager! !
!(Modules>>#PlanE>>#Transaction) class methodsFor: 'instance creation' stamp: 'KLG 5/21/2021 16:51:23'!
forManager: aTransactionManger
"Create the transaction for aTransactionManager."
^ self new manager: aTransactionManger! !
!(Modules>>#PlanE>>#TransactionManager) methodsFor: 'initialization' stamp: 'KLG 5/21/2021 14:35:24'!
fileStore: aFileStore
"Set the fileStore."
self assert: fileStore isNil.
fileStore _ aFileStore ! !
!(Modules>>#PlanE>>#TransactionManager) methodsFor: 'transactions - private' stamp: 'KLG 5/21/2021 15:34:03'!
committed: aTransaction withInvolvedObjects: someInvolvedObjects
"aTransaction was commited with its involved objects."
someInvolvedObjects do: [ :invovedObject |
fileStore
markObjectForUpdate: invovedObject;
dumpObject: invovedObject ].
super committed: aTransaction withInvolvedObjects: someInvolvedObjects.! !
!(Modules>>#PlanE>>#TransactionManager) methodsFor: 'instance creation' stamp: 'KLG 5/21/2021 17:02:24'!
newTransaction
^ self transactionClass forManager: self! !
!(Modules>>#PlanE>>#TransactionManager) methodsFor: 'transactions' stamp: 'KLG 12/11/2021 21:14:44'!
begin
"Begin the active transaction."
| active |
active _ self active.
involvedObjects do: [ :involvedObject |
active register: involvedObject ].
^ super begin! !
!(Modules>>#PlanE>>#TransactionManager) class methodsFor: 'instance creation' stamp: 'KLG 5/21/2021 14:36:29'!
forFileStore: aFileStore
"Answer a new instance of mine for aFileStore."
^ self new fileStore: aFileStore! !
!(Modules>>#PlanE>>#TransactionManager) class methodsFor: 'instance creation' stamp: 'KLG 5/21/2021 16:50:06'!
newTransaction
^ self transactionClass forManager: self! !
!(Modules>>#PlanE>>#TransactionManager) class methodsFor: 'instance creation' stamp: 'KLG 5/21/2021 10:43:47'!
transactionClass
"Answer the transaction class for me."
^ Transaction ! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'testing' stamp: 'KLG 5/13/2021 19:37:49'!
isOpen
"Answer true if the store is open."
^ stream notNil! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'opening' stamp: 'KLG 5/20/2021 10:53:00'!
openOn: aFilename
"Open the store on aFilename"
| fileEntry didExist |
positionsToObjects _ WeakValueDictionary new.
objectsToPositions _ WeakIdentityKeyDictionary new.
proxies _ WeakIdentityKeyDictionary new.
self resetFixups.
self resetObjectsToUpdate.
fileEntry _ aFilename isString
ifTrue: [ aFilename asFileEntry ]
ifFalse: [ aFilename ].
didExist _ fileEntry exists.
stream _ fileEntry appendStream.
stream useBytes.
didExist
ifTrue: [ self checkHeader ]
ifFalse: [
self dumpHeader.
self dumpRoots ]
! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'opening' stamp: 'KLG 5/15/2021 20:45:10'!
resetFixups
^ fixUps _ IdentityDictionary new! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'opening' stamp: 'KLG 5/20/2021 10:52:36'!
resetObjectsToUpdate
^ objectsToUpdate _ WeakIdentitySet new! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'closing' stamp: 'KLG 5/20/2021 10:53:18'!
close
"Close the store."
self assert: self isOpen.
stream close.
stream _ positionsToObjects _ objectsToPositions _ fixUps _ objectsToUpdate _ nil! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'finalization' stamp: 'KLG 5/13/2021 19:35:47'!
finalize
"Finalize the store."
self isOpen ifTrue: [ self close ]! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'stream position' stamp: 'KLG 5/21/2021 19:48:28'!
fixStreamPosition
"Fix the stream position so that is a multiple of 16."
| position |
(position _ stream position) < 48 ::
ifTrue: [ stream position: 48 ]
ifFalse: [
position noMask: 2r1111 :: ifFalse: [
stream position: (position bitClear: 2r1111) + 16 ] ] ! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'stream position' stamp: 'KLG 5/15/2021 22:31:39'!
recordFixUpFor: anObject andOffset: anOffset
"Record the fact that we need to write anObject's position to the current stream position once we know it."
fixUps at: anObject ifAbsentPut: [
OrderedCollection new ] :: add: stream position + (anOffset << 3)! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'stream position' stamp: 'KLG 5/19/2021 10:45:35'!
recordPosition
"Answer the position to store in records."
^ stream position >> 4! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'stream position' stamp: 'KLG 5/15/2021 17:58:31'!
recordPosition: anInteger
"Set the stream to a position stored in records.."
^ stream position: anInteger << 4! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'stream position' stamp: 'KLG 5/15/2021 22:19:04'!
recordPositionOf: anObject
"Answer the record position of a object.
Answer the position of anObject if known.
If unknown answer 0 and remember the object and the stream position for later fixup."
^ self recordPositionOf: anObject andOffset: 0! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'stream position' stamp: 'KLG 5/21/2021 22:36:43'!
recordPositionOf: anObject andOffset: anOffset
"Answer the record position of a object.
Answer the position of anObject if known.
If unknown answer 0 and remember the object and the stream position for later fixup."
"D: Transcript cr; show: anObject; show:' recorded '; show: (positions at: anObject ifAbsent: [ 0 ])."
self pseudoPositionFor: anObject :: ifNotNil: [ :position | ^ position ].
^ objectsToPositions at: anObject ifAbsent: [
self recordFixUpFor: anObject andOffset: anOffset.
`1 << 63 - 1` ]! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'stream position' stamp: 'KLG 5/20/2021 10:47:13'!
registerObject: anObject at: aPosition
"Register a newly loaded object at a position.
This will terminate the recursive loading of (indirectly) self referencing object.s."
positionsToObjects at: aPosition put: anObject.
objectsToPositions at: anObject put: aPosition! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'stream position' stamp: 'KLG 5/15/2021 17:55:02'!
setToEnd
"Set the stream to its end.
Always use a multiple of 16."
stream setToEnd.
self fixStreamPosition
! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'stream position' stamp: 'KLG 5/15/2021 18:08:53'!
streamPosition: aPosition
"Set the stream to aPosition
Always use a multiple of 16."
stream position: aPosition.
self fixStreamPosition
! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'pseudo positions' stamp: 'KLG 5/16/2021 21:07:37'!
objectAtPseudoPosition: aPosition ifNot: aBlock
"Answer the smalltalk object at a pseudo position.
if not evaluate aBlock."
^ aPosition
caseOf: {
[ 2 ] -> [ nil ].
[ 3 ] -> [ true ].
[ 4 ] -> [ false ] }
otherwise: [ aBlock value ]! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'pseudo positions' stamp: 'KLG 5/16/2021 21:08:11'!
pseudoPositionFor: anObject
"Answer the pseudo position for nil, true and false.
If anObject is not a builtin constant answer nil."
^ anObject
caseOf: {
[ nil ] -> [ 2 ].
[ true ] -> [ 3 ].
[ false ] -> [ 4 ] }
otherwise: [ nil ]! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'persistence' stamp: 'KLG 5/20/2021 15:47:56'!
basicDumpObject: anObject
"Dump a object, do nothing if we already know the position of anObject.
Answer the object position."
self pseudoPositionFor: anObject :: ifNotNil: [ :pseudoPosition | ^ pseudoPosition ].
objectsToUpdate includes: anObject :: ifTrue: [
objectsToPositions
at: anObject
ifPresent: [ :position | | oldPosition newPosition |
oldPosition _ position.
objectsToUpdate remove: anObject.
newPosition _ self rawDumpObject: anObject.
self updateObjectAtPosition: oldPosition withNewPosition: newPosition.
^ newPosition ] ].
^ objectsToPositions
at: anObject
ifPresent: [ :position | position ]
ifAbsent: [ self rawDumpObject: anObject ]! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'persistence' stamp: 'KLG 5/16/2021 10:55:02'!
dumpAllMissingObjects
"Dump all missing objects."
| positionArray |
positionArray _ DoubleWordArray new: 1.
[ fixUps isEmpty ] whileFalse: [ | currentFixUps |
currentFixUps _ fixUps. ": No copy needed, we create a new dictionary."
self resetFixups.
currentFixUps keysAndValuesDo: [ :object :positionsToFix |
positionArray at: 1 put: (self basicDumpObject: object).
positionsToFix do: [ :positionToFix |
"D: Transcript
newLine;
show: 'Fixup: ';
show: object;
nextPut:$(;
show: object class;
nextPut: $);
show: ': ';
show: positionToFix;
show: ' <= ';
show: (positionArray at: 1 :: << 4)."
"These are unaligned!!"
"O: self streamPosition: positionToFix."
stream position: positionToFix.
stream nextPutAll: positionArray ] ] ]
! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 20:41:35'!
dumpObject: anObject
"Dump a object, do nothing if we already know the position of anObject.
Perform any fixups necessary.."
| answer |
answer _ self basicDumpObject: anObject.
self dumpAllMissingObjects.
^ answer
! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'persistence' stamp: 'KLG 5/21/2021 17:53:26'!
dumpRoots
"Dump the roots object."
self recordPosition: self rootsPosition.
roots ifNil: [
roots _ RootsRecord forStore: self position: self recordPosition ] ::
dumpOn: stream! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'persistence' stamp: 'KLG 2/22/2022 10:03:54'!
flush
"Flush the stream."
stream flush! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'persistence' stamp: 'KLG 5/20/2021 11:11:50'!
loadObjectAt: aPosition
"Load the object at a position.
Answer a chached copy if possible."
^ self objectAtPseudoPosition: aPosition ifNot: [
positionsToObjects at: aPosition
ifPresent: [ :object |
object ifNil: [ "That's the lost weak reference case:"
^ self rawLoadObjectAt: aPosition ].
object principalForPlanE ]
ifAbsent: [ self rawLoadObjectAt: aPosition ] ]! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'persistence' stamp: 'KLG 5/20/2021 10:56:10'!
markObjectForUpdate: anObject
"Mark an object for update.
It will be written to a new position and its old position
will be updated a dump operation touches it. "
objectsToUpdate add: anObject! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'persistence' stamp: 'KLG 7/7/2021 10:23:45'!
persist: anInstance usingAGetter: aGetter
"Persist the object answered by getter and restore it by uising setter."
^self objectRecordFor:
(self proxyForObject: anInstance ifAbsentPut: [
self genericProxyClass
forClass: anInstance class
andState: (aGetter
valueWithPossibleArgument: self and: anInstance) ])! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'persistence' stamp: 'KLG 7/7/2021 10:22:38'!
persist: anInstance withState: aState
"Persist the object answered by getter and restore it by uising setter."
^ self objectRecordFor:
(self proxyForObject: anInstance ifAbsentPut: [
self genericProxyClass
forClass: anInstance class
andState: aState ])
! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'persistence' stamp: 'KLG 5/21/2021 19:51:31'!
rawDumpObject: anObject
"Dump a new object, do not write any broken hearts.
Answer the object position."
| answer record |
self setToEnd.
answer _ self recordPosition.
self registerObject: anObject at: answer.
record _ anObject recordForPlanE: self.
record dumpOn: stream.
"D: Transcript
newLine;
show: anObject;
nextPut:$(;
show: anObject class;
nextPut: $);
show: ' @ ';
show: answer << 4;
show: ' ... ';
show: stream position."
^ answer ! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'persistence' stamp: 'KLG 5/20/2021 10:42:44'!
rawLoadObjectAt: aPosition
"Load the object at a position."
| record |
self recordPosition: aPosition.
record _ AbstractRecord loadFrom: stream forStore: self andPosition: self recordPosition.
^ record smalltalkObject! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'persistence' stamp: 'KLG 5/16/2021 12:11:32'!
root
"Answer the first root object.."
^ self rootAt: 1! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'persistence' stamp: 'KLG 5/16/2021 12:11:16'!
root: anObject
"Set the first root object."
^ self rootAt: 1 put: anObject! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'persistence' stamp: 'KLG 5/16/2021 12:09:00'!
rootAt: anIndex
"Answer the database root at an index."
^ self roots at: anIndex! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'persistence' stamp: 'KLG 5/16/2021 12:41:01'!
rootAt: anIndex put: anObject
"Put a root object at anIndex."
| answer |
answer _ self roots at: anIndex put: anObject.
self
dumpRoots;
dumpAllMissingObjects.
^ answer ! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'persistence' stamp: 'KLG 5/21/2021 17:33:14'!
roots
"Answer the roots object."
^ roots ifNil: [ roots _ self rawLoadObjectAt: self rootsPosition ]! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'persistence' stamp: 'KLG 5/21/2021 19:37:32'!
rootsPosition
^ 3! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'persistence' stamp: 'KLG 5/20/2021 15:45:59'!
updateObjectAtPosition: anOldPosition withNewPosition: aNewPosition
"Update the forwarder of the record at anOldPosition with aNewPosition."
self recordPosition: anOldPosition.
stream
skip: 2;
nextPutAll: (DoubleWordArray with: aNewPosition)
! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 6/21/2021 11:23:16'!
blockClosureRecordFor: aBlockClosure
"Answer a closure record record for aBlockClosure."
^ self objectRecordFor:
(self proxyForObject: aBlockClosure ifAbsentPut: [
ClosureProxy forObject: aBlockClosure ] )! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 5/19/2021 10:45:55'!
byteArrayRecordFor: anArray
"Answer a byte array record for anArray."
^ ByteArrayRecord forStore: self position: self recordPosition andObject: anArray! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 5/19/2021 10:46:30'!
classRecordFor: aClass
"Answer a class record for a class."
^ aClass package isNil and: [ aClass name environment isNil ] ::
ifTrue: [ BaseClassRecord ]
ifFalse: [ ClassRecord ] ::
forStore: self position: self recordPosition andObject: aClass! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 5/19/2021 10:46:39'!
classRecordForPlanEClass: aPlanEClass
"Answer a record for aPlanEClass."
^ PlanEClassRecord
forStore: self
position: self recordPosition andObject: aPlanEClass! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 5/17/2021 14:55:34'!
codePackageRecord: aCodePackage
"Answer a record for aCodePackage."
^ self objectRecordFor:
(self proxyForObject: aCodePackage ifAbsentPut: [
CodePackageProxy forObject: aCodePackage ] )! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 5/22/2021 17:54:16'!
compiledMethodRecord: aCompiledMethod
"Answer a record for aCompiledMethod."
^ self objectRecordFor:
(self proxyForObject: aCompiledMethod ifAbsentPut: [
CompiledMethodProxy forObject: aCompiledMethod ] )! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 5/19/2021 10:46:55'!
dictionaryRecordFor: aDictionary
"Answer a dictionary record for aDictionary."
^ DictionaryRecord forStore: self position: self recordPosition andObject: aDictionary ! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 5/19/2021 10:47:04'!
doubleByteArrayRecordFor: anArray
"Answer a double byte array record for anArray."
^ DoubleByteArrayRecord forStore: self position: self recordPosition andObject: anArray! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 5/19/2021 10:47:13'!
doubleWordArrayRecordFor: anArray
"Answer a double word array record for anArray."
^ DoubleWordArrayRecord forStore: self position: self recordPosition andObject: anArray! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 5/17/2021 22:21:56'!
environmentRecord: aModule
"Answer a record for aModule."
^ self objectRecordFor:
(self proxyForObject: aModule ifAbsentPut: [
EnvironmentProxy forObject: aModule ] )! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 5/19/2021 10:47:26'!
floatRecordFor: aFloat
"Answer a float record for aFloat."
^ FloatRecord forStore: self position: self recordPosition andObject: aFloat! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 5/19/2021 10:47:48'!
largeNegativeIntegerRecordFor: anInteger
"Answer a record for a large negative integer."
^ LargeNegativeIntegerRecord forStore: self position: self recordPosition andObject: anInteger! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 5/19/2021 10:47:58'!
largePositiveIntegerRecordFor: anInteger
"Answer a record for a large positive integer."
^ LargePositiveIntegerRecord forStore: self position: self recordPosition andObject: anInteger! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 5/18/2021 22:26:49'!
moduleRecordFor: anEnvironment
"Answer a record for aModule."
^ self objectRecordFor:
(self proxyForObject: anEnvironment ifAbsentPut: [
ModuleProxy forObject: anEnvironment ] )! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 5/19/2021 10:48:11'!
objectRecordFor: anObject
"Answer an object record for anObject."
^ ObjectRecord forStore: self position: self recordPosition andObject: anObject ! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 5/19/2021 10:48:21'!
setRecordFor: aSet
"Answer a set record for aSet."
^ SetRecord forStore: self position: self recordPosition andObject: aSet! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 5/19/2021 10:48:30'!
smallIntegerRecordFor: anInteger
"Answer a record for a large positive integer."
^ anInteger negative
ifTrue: [ NegativeSmallIntegerRecord ]
ifFalse: [ PositiveSmallIntegerRecord ] ::
forStore: self position: self recordPosition andObject: anInteger! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 5/19/2021 10:48:39'!
stringRecordFor: aString
"Answer a string record for a string."
^ StringRecord forStore: self position: self recordPosition andObject: aString! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 5/19/2021 14:46:23'!
symbolRecordFor: aSymbol
"Answer a string record for a string."
Symbol hasInterned: aSymbol ifTrue: [ :symbol |
^ InternedSymbolRecord forStore: self position: self recordPosition andObject: symbol ].
aSymbol environment ifNil: [
^ UninternedSymbolRecord forStore: self position: self recordPosition andObject: aSymbol ].
^ self objectRecordFor:
(self proxyForObject: aSymbol ifAbsentPut: [
LocalSymbolProxy forObject: aSymbol ] )! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 5/18/2021 22:25:27'!
systemDictionaryRecordFor: aSystemDictionary
"Answer a record for aSystemDictionary."
^ aSystemDictionary == Smalltalk
ifTrue:
[ self objectRecordFor:
(self
proxyForObject: aSystemDictionary
ifAbsentPut: [ SmalltalkProxy new ]) ]
ifFalse:
[ self dictionaryRecordFor: aSystemDictionary ]! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 5/19/2021 10:48:53'!
wordArrayRecordFor: anArray
"Answer a word array record for anArray."
^ WordArrayRecord forStore: self position: self recordPosition andObject: anArray! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'records' stamp: 'KLG 7/7/2021 22:12:27'!
worldMorphRecord: aWorldMorph
"Answer a record for aWorldMorph."
^ self objectRecordFor:
(self proxyForObject: aWorldMorph ifAbsentPut: [
aWorldMorph == self runningWorld
ifTrue: [
RunningWorldProxy new ]
ifFalse: [
WorldMorphProxy forObject: aWorldMorph ] ])! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'version' stamp: 'KLG 5/14/2021 21:53:10'!
checkHeader
"Dump the data base header"
self rawLoadObjectAt: 0 :: checkHeader ifNotNil: [ :error | self error: error ]! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'version' stamp: 'KLG 5/19/2021 10:54:15'!
dumpHeader
"Dump the data base header"
stream position: 0.
StoreRecord forStore: self position: self recordPosition :: dumpOn: stream! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'version' stamp: 'KLG 5/14/2021 21:34:51'!
storeVersion
"Answer the store version."
^ self class storeVersion! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'proxies' stamp: 'KLG 5/17/2021 14:50:53'!
proxyForObject: anObject ifAbsentPut: aBlock
"Answer a Proxy for anObject.
Memorize and answer the value of aBlock."
^ proxies at: anObject ifAbsentPut: aBlock ! !
!(Modules>>#PlanE>>#FileStore) methodsFor: 'instance creation' stamp: 'KLG 7/6/2021 19:14:17'!
genericProxyClass
"Answer the class for generic proxies."
^ self class genericProxyClass! !
!(Modules>>#PlanE>>#FileStore) class methodsFor: 'instance creation' stamp: 'KLG 7/6/2021 19:14:30'!
genericProxyClass
"Answer the class for generic proxies."
^ GenericProxy! !
!(Modules>>#PlanE>>#FileStore) class methodsFor: 'instance creation' stamp: 'KLG 5/13/2021 19:29:46'!
openOn: aFilename
"Open of a file name."
^ self new openOn: aFilename ! !
!(Modules>>#PlanE>>#FileStore) class methodsFor: 'version' stamp: 'KLG 5/14/2021 21:34:29'!
storeVersion
"Answer the store version."
^ 0 ! !
!(Modules>>#PlanE>>#PersistentObject) methodsFor: 'transactions' stamp: 'KLG 5/21/2021 16:23:45'!
registerWithTransaction
"Register me with the current transaction."
planE ifNotNil: [ planE register: self ]! !
!(Modules>>#PlanE>>#PersistentObject) class methodsFor: 'instance creation' stamp: 'KLG 5/21/2021 17:12:57'!
forPlanE: aPlanE
"Create instance of mine for a aPlane."
| answer |
answer _ self basicNew.
aPlanE register: answer.
answer initialize.
^ answer ! !
!(Modules>>#PlanE>>#PlanE) methodsFor: 'root' stamp: 'KLG 2/24/2022 20:02:06'!
root
"Answer the root object."
fileStore root ifNotNil: [ :root |
self register: root.
^ root ].
^ nil! !
!(Modules>>#PlanE>>#PlanE) methodsFor: 'root' stamp: 'KLG 6/19/2021 13:13:20'!
root: anObject
"Set the root object."
self register: anObject.
^ fileStore root: anObject ! !
!(Modules>>#PlanE>>#PlanE) methodsFor: 'instance creation' stamp: 'KLG 5/21/2021 10:44:24'!
fileStoreClass
"Answer the file store class to use."
^ self class fileStoreClass! !
!(Modules>>#PlanE>>#PlanE) methodsFor: 'instance creation' stamp: 'KLG 5/21/2021 10:44:42'!
transactionManagerClass
"Answer the transaction manager classto use."
^ self class transactionManagerClass! !
!(Modules>>#PlanE>>#PlanE) methodsFor: 'testing' stamp: 'KLG 5/21/2021 16:14:23'!
isOpen
"Answer true, if I am open."
^ fileStore notNil and: [ fileStore isOpen]! !
!(Modules>>#PlanE>>#PlanE) methodsFor: 'testing' stamp: 'KLG 5/21/2021 15:24:39'!
isRegistered: anObject
"Answer if anObject is registered."
^ transactionManager isRegistered: anObject
! !
!(Modules>>#PlanE>>#PlanE) methodsFor: 'opening' stamp: 'KLG 5/21/2021 16:13:37'!
openOn: aFilename
"Open the interface on aFilename"
fileStore _ self fileStoreClass new.
transactionManager _ self transactionManagerClass forFileStore: fileStore.
fileStore openOn: aFilename! !
!(Modules>>#PlanE>>#PlanE) methodsFor: 'closing' stamp: 'KLG 5/21/2021 16:13:56'!
close
"Close the the interface"
fileStore close.
fileStore _ transactionManager _ nil! !
!(Modules>>#PlanE>>#PlanE) methodsFor: 'transactions' stamp: 'KLG 5/21/2021 15:24:39'!
abort
"Abort the current transaction."
^ transactionManager abort! !
!(Modules>>#PlanE>>#PlanE) methodsFor: 'transactions' stamp: 'KLG 5/21/2021 15:24:39'!
active
"Answer the transaction for this process."
^ transactionManager active! !
!(Modules>>#PlanE>>#PlanE) methodsFor: 'transactions' stamp: 'KLG 5/21/2021 15:24:39'!
begin
"Begin the active transaction."
^ transactionManager begin! !
!(Modules>>#PlanE>>#PlanE) methodsFor: 'transactions' stamp: 'KLG 5/21/2021 15:24:39'!
begin: anId
"Begin the active transaction give it an id."
^ transactionManager begin: anId! !
!(Modules>>#PlanE>>#PlanE) methodsFor: 'transactions' stamp: 'KLG 2/22/2022 11:00:03'!
commit
"Commit the current transaction."
| answer |
answer _ transactionManager commit.
fileStore flush.
^ answer! !
!(Modules>>#PlanE>>#PlanE) methodsFor: 'transactions' stamp: 'KLG 5/21/2021 15:24:39'!
do: aBlock inMyTransaction: anObject
"Evaluate a block while anObject transaction is the active one for this process."
^ transactionManager do: aBlock inMyTransaction: anObject! !
!(Modules>>#PlanE>>#PlanE) methodsFor: 'transactions' stamp: 'KLG 5/21/2021 15:24:39'!
register: anObject
"Register anObject and answer its transaction."
^ transactionManager register: anObject! !
!(Modules>>#PlanE>>#PlanE) class methodsFor: 'instance creation' stamp: 'KLG 5/21/2021 10:42:42'!
fileStoreClass
"Answer the file store class to use."
^ FileStore! !
!(Modules>>#PlanE>>#PlanE) class methodsFor: 'instance creation' stamp: 'KLG 5/21/2021 15:48:02'!
openOn: aFilename
"Create a new PlanE interface that is open on a Filename."
^ self new openOn: aFilename! !
!(Modules>>#PlanE>>#PlanE) class methodsFor: 'instance creation' stamp: 'KLG 5/21/2021 10:43:16'!
transactionManagerClass
"Answer the transaction manager classto use."
^ TransactionManager! !
!(Modules>>#PlanE>>#AbstractRecord) methodsFor: 'magic' stamp: 'KLG 5/13/2021 20:24:39'!
magicWords
"Answer the magic bytes."
^ self class magicWords! !
!(Modules>>#PlanE>>#AbstractRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 20:09:50'!
dumpDataOn: aStream
"Dump the data an aStream."
self subclassResponsibility! !
!(Modules>>#PlanE>>#AbstractRecord) methodsFor: 'persistence' stamp: 'KLG 5/16/2021 21:19:14'!
dumpHeaderOn: aStream
"Dump the header on a stream"
aStream
nextPutAll: self magicWords;
nextPutAll: self metaHeader.
self header ifNotNil: [ :header | aStream nextPutAll: header ]! !
!(Modules>>#PlanE>>#AbstractRecord) methodsFor: 'persistence' stamp: 'KLG 5/16/2021 20:24:18'!
dumpOn: aStream
"Dump the class on a stream."
self
dumpHeaderOn:aStream;
dumpDataOn: aStream! !
!(Modules>>#PlanE>>#AbstractRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 21:31:17'!
header
"Answer the header"
| headerArray |
headerArray _ self headerArrayClass ifNil: [ ^ nil ] ifNotNil: [ :headerArrayClass |
headerArrayClass new: self headerSize ].
self storeHeaderIn: headerArray.
^ headerArray ! !
!(Modules>>#PlanE>>#AbstractRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 18:25:05'!
headerArrayClass
"Answer the header array class.
If we answer nil, there is no header."
^ nil! !
!(Modules>>#PlanE>>#AbstractRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 18:22:16'!
headerSize
"Answer the header size.
If we answer nil, there is no header."
^ nil! !
!(Modules>>#PlanE>>#AbstractRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 12:11:56'!
loadDataFrom: aStream
"Creat an instance of mine and load it from aStream."
^ self loadDataFrom: aStream header: (self loadHeaderFrom: aStream) ! !
!(Modules>>#PlanE>>#AbstractRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 12:08:15'!
loadDataFrom: aStream header: aHeader
"Creat an instance of mine and load it from aStream."
^ self subclassResponsibility! !
!(Modules>>#PlanE>>#AbstractRecord) methodsFor: 'persistence' stamp: 'KLG 5/16/2021 20:41:14'!
loadHeaderFrom: aStream
"Load the header form aStream and answer it."
| header headerSize "F: metaHeader" |
"F: metaHeader _ DoubleWordArray new: 1.
aStream nextInto: metaHeader."
(headerSize _ self headerSize) ifNil: [ ^ nil ].
header _ self headerArrayClass new: headerSize.
aStream next: headerSize into: header startingAt: 1..
^ header! !
!(Modules>>#PlanE>>#AbstractRecord) methodsFor: 'persistence' stamp: 'KLG 5/16/2021 20:34:18'!
metaHeader
"Answer the metaHeader.
Essentially this space for one position pointing to meta information
like a new version of the object or transaction. If the magicWords least significat bit
is set in contains 2 positions pointing to a transaction and a never version of the object."
^ `DoubleWordArray new: 1`! !
!(Modules>>#PlanE>>#AbstractRecord) methodsFor: 'persistence' stamp: 'KLG 5/20/2021 10:47:50'!
registerPositionFor: anObject
"Regster the position for a newly loaded object.
This will terminate the loading of (indirectly) self referencing objects."
store registerObject: anObject at: position! !
!(Modules>>#PlanE>>#AbstractRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 11:42:40'!
smalltalkObject
"Answer the reals smalltlak object."
^ self subclassResponsibility ! !
!(Modules>>#PlanE>>#AbstractRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 18:29:01'!
storeHeaderIn: aHeaderArray
"Store the header data in aHeaderArray"
self subclassResponsibility! !
!(Modules>>#PlanE>>#AbstractRecord) methodsFor: 'accessing' stamp: 'KLG 5/14/2021 20:51:04'!
store: anObject
"Set the value of store"
self assert: store isNil.
store _ anObject! !
!(Modules>>#PlanE>>#AbstractRecord) methodsFor: 'accessing' stamp: 'KLG 5/19/2021 10:39:01'!
store: anObject position: aPosition
"Set the value of store"
self assert: store isNil.
store _ anObject.
position _ aPosition! !
!(Modules>>#PlanE>>#AbstractRecord) class methodsFor: 'magic' stamp: 'KLG 5/13/2021 20:23:02'!
magicNumber
"Answer the magic number."
^ self subclassResponsibility! !
!(Modules>>#PlanE>>#AbstractRecord) class methodsFor: 'magic' stamp: 'KLG 5/13/2021 21:07:42'!
magicNumbersToClasses
"Answer the dictionary that maps magic nubers to classes."
^ MagicNumbersToClasses! !
!(Modules>>#PlanE>>#AbstractRecord) class methodsFor: 'magic' stamp: 'KLG 5/16/2021 20:27:14'!
magicWords
"Answer the magic bytes."
^ magicWords ifNil: [ magicWords _ DoubleByteArray with: self magicNumber << 1]! !
!(Modules>>#PlanE>>#AbstractRecord) class methodsFor: 'magic' stamp: 'KLG 5/15/2021 22:42:56'!
recordClassForMagicNumbers: anInteger
"Answer the right class for someMagic words."
^ self magicNumbersToClasses at: anInteger ifAbsent: [
self error: 'Unkown database record number: ', anInteger asString]! !
!(Modules>>#PlanE>>#AbstractRecord) class methodsFor: 'persistence' stamp: 'KLG 1/19/2022 12:24:59'!
loadFrom: aStream forStore: aStore andPosition: aPosition
"Load the right subclass from aStream"
| magic recordClass updatedPosition headerPosition |
updatedPosition _ aPosition.
magic _ self loadMagicWordsFrom: aStream.
[ (headerPosition _ self loadMetaHeaderFrom: aStream) = 0] whileFalse: [
aStore recordPosition: headerPosition.
magic _ self loadMagicWordsFrom: aStream.
updatedPosition _ headerPosition ].
"D: aPosition = updatedPosition ifFalse: [
Transcript newLine; show: 'LOAD: '; show: aPosition; show: ' => '; show: updatedPosition ]."
recordClass _ self recordClassForMagicNumbers: (magic at: 1) >> 1.
^ recordClass forStore: aStore position: updatedPosition :: loadDataFrom: aStream! !
!(Modules>>#PlanE>>#AbstractRecord) class methodsFor: 'persistence' stamp: 'KLG 5/13/2021 21:03:11'!
loadMagicWordsFrom: aStream
"Load the magic words from aStream"
| words |
words _ DoubleByteArray new: 1.
aStream readInto: words startingAt: 1 count: 1.
^ words! !
!(Modules>>#PlanE>>#AbstractRecord) class methodsFor: 'persistence' stamp: 'KLG 5/19/2021 16:36:54'!
loadMetaHeaderFrom: aStream
"Load the meta header and answer the position it points to."
| metaHeader |
aStream nextInto: (metaHeader _ DoubleWordArray new: 1).
^ metaHeader at: 1! !
!(Modules>>#PlanE>>#AbstractRecord) class methodsFor: 'class initialization' stamp: 'KLG 5/14/2021 23:33:21'!
initialize
"Initialize the magic numbers mapping"
MagicNumbersToClasses _ Dictionary new.
self allSubclassesDo: [ :subclass | | found |
found _ subclass ~~ self.
[ Transcript cr; show: subclass; show: ' => '; show: subclass magicWords. ] on: Exception do: [].
subclass resetMagicWords.
subclass class compiledMethodAt: #magicNumber ifAbsent: [ found _ false ].
"D: Transcript newLine; show: subclass; show: ' --> '; show: found."
found ifTrue: [ | magicNumber |
MagicNumbersToClasses
at: (magicNumber _ subclass magicNumber) ifPresent: [ :class |
self error: 'Duplicate magic number: ', magicNumber asString, ' -> ', class name ].
MagicNumbersToClasses at: magicNumber put: subclass ] ]! !
!(Modules>>#PlanE>>#AbstractRecord) class methodsFor: 'class initialization' stamp: 'KLG 5/14/2021 23:25:08'!
resetMagicWords
"Reset the changed magic words."
magicWords _ nil! !
!(Modules>>#PlanE>>#AbstractRecord) class methodsFor: 'instance creation' stamp: 'KLG 5/19/2021 10:40:01'!
forStore: aStore position: aPosition
"Answer a new record foraStore."
^ self new store: aStore position: aPosition ! !
!(Modules>>#PlanE>>#AbstractRecord) class methodsFor: 'instance creation' stamp: 'KLG 5/19/2021 10:42:54'!
forStore: aStore position: aPosition andObject: anObject
"Answer a new record foraStore and anObject."
^ self subclassResponsibility ! !
!(Modules>>#PlanE>>#AbstractClassRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 22:03:31'!
dumpDataOn: aStream
"Dump the data an aStream."
aStream nextPutAll: className! !
!(Modules>>#PlanE>>#AbstractClassRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 18:39:38'!
header
"Answer the header"
^ self headerArrayClass with: className size! !
!(Modules>>#PlanE>>#AbstractClassRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 18:39:38'!
headerArrayClass
^ DoubleByteArray! !
!(Modules>>#PlanE>>#AbstractClassRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 23:13:07'!
headerSize
^ 1! !
!(Modules>>#PlanE>>#AbstractClassRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 23:16:37'!
loadDataFrom: aStream header: aHeader
"Creat an instance of mine and load it from aStream."
aStream nextInto: (className _ String new: (aHeader at: 1))! !
!(Modules>>#PlanE>>#AbstractClassRecord) methodsFor: 'initialization' stamp: 'KLG 5/15/2021 21:38:43'!
className: aClassName
"Initalize me from my class."
className _ aClassName! !
!(Modules>>#PlanE>>#AbstractClassRecord) class methodsFor: 'instance creation' stamp: 'KLG 5/19/2021 11:02:10'!
forStore: aStore position: aPosition andObject: aClass
"Create a new class record for a class."
^ self forStore: aStore position: aPosition :: className: aClass name asString! !
!(Modules>>#PlanE>>#BaseClassRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 11:51:36'!
smalltalkObject
"Answer the realsmalltlak object."
^ Smalltalk at: className asSymbol ! !
!(Modules>>#PlanE>>#BaseClassRecord) class methodsFor: 'magic' stamp: 'KLG 5/16/2021 12:12:46'!
magicNumber
"Answer the magic number."
^ 4! !
!(Modules>>#PlanE>>#ClassRecord) methodsFor: 'persistence' stamp: 'KLG 5/17/2021 22:02:15'!
dumpDataOn: aStream
"Dump the data an aStream."
super dumpDataOn: aStream.
aStream nextPutAll: (
DoubleWordArray
with: (store recordPositionOf: package)
with: (store recordPositionOf: environment andOffset: 1))
! !
!(Modules>>#PlanE>>#ClassRecord) methodsFor: 'persistence' stamp: 'KLG 5/17/2021 22:02:44'!
loadDataFrom: aStream header: aHeader
"Load our data from aStream using aHeader."
| dataArray |
super
loadDataFrom: aStream
header: aHeader.
aStream nextInto: (dataArray _ DoubleWordArray new: 2).
package _ store loadObjectAt: dataArray first.
environment _ store loadObjectAt: dataArray second! !
!(Modules>>#PlanE>>#ClassRecord) methodsFor: 'persistence' stamp: 'KLG 5/19/2021 11:21:15'!
smalltalkObject
"Answer the real Smalltalk object."
^ environment ifNil: [ Smalltalk ] :: at: className asSymbol ! !
!(Modules>>#PlanE>>#ClassRecord) methodsFor: 'initialization' stamp: 'KLG 5/17/2021 22:02:15'!
className: aClassName environment: anEnvironmentOrNil package: aPackageOrNil
"Initalize me from my class."
className _ aClassName.
environment _ anEnvironmentOrNil.
package _ aPackageOrNil! !
!(Modules>>#PlanE>>#ClassRecord) class methodsFor: 'magic' stamp: 'KLG 5/17/2021 15:10:09'!
magicNumber
"Answer my magic number."
^ 6.! !
!(Modules>>#PlanE>>#ClassRecord) class methodsFor: 'instance creation' stamp: 'KLG 5/19/2021 11:01:15'!
forStore: aStore position: aPosition andObject: aClass
"Create a new class record for a class."
^ self forStore: aStore position: aPosition ::
className: aClass name asString
environment: aClass name environment
package: aClass package! !
!(Modules>>#PlanE>>#PlanEClassRecord) methodsFor: 'instance creation' stamp: 'KLG 5/17/2021 22:29:21'!
className: aClassName
"Initialize me from aClassName and aModule"
className _ aClassName! !
!(Modules>>#PlanE>>#PlanEClassRecord) methodsFor: 'persistence' stamp: 'KLG 5/17/2021 22:30:07'!
smalltalkObject
"Answer the class in the module."
^ `Modules >> #PlanE` at: className asSymbol.! !
!(Modules>>#PlanE>>#PlanEClassRecord) class methodsFor: 'instance creation' stamp: 'KLG 5/19/2021 11:01:43'!
forStore: aStream position: aPosition andObject: aPlanEClass
"Answer a new instance of mine or aStore and aPlanEClass."
^ (self forStore: aStream position: aPosition)
className: aPlanEClass name asString! !
!(Modules>>#PlanE>>#PlanEClassRecord) class methodsFor: 'magic' stamp: 'KLG 5/17/2021 15:03:33'!
magicNumber
"Answer the magic number."
^ 5.! !
!(Modules>>#PlanE>>#AbstractInstanceRecord) methodsFor: 'accessing' stamp: 'KLG 5/14/2021 22:46:42'!
object
"Answer the value of object"
^ object! !
!(Modules>>#PlanE>>#AbstractInstanceRecord) methodsFor: 'accessing' stamp: 'KLG 5/14/2021 22:46:42'!
object: anObject
"Set the value of object"
object _ anObject! !
!(Modules>>#PlanE>>#AbstractInstanceRecord) methodsFor: 'persistence' stamp: 'KLG 5/19/2021 11:16:47'!
registerPosition
"Regster the position for a newly loaded object.
This will terminate the loading of (indirectly) self referencing objects."
self registerPositionFor: object! !
!(Modules>>#PlanE>>#AbstractInstanceRecord) methodsFor: 'persistence' stamp: 'KLG 5/17/2021 10:58:35'!
smalltalkObject
"Answer the smalltalk object."
^ self object principalForPlanE! !
!(Modules>>#PlanE>>#AbstractInstanceRecord) class methodsFor: 'instance creation' stamp: 'KLG 5/19/2021 11:00:44'!
forStore: aStore position: aPosition andObject: anObject
"Answer an instance record for a store an anObject."
^ self forStore: aStore position: aPosition :: object: anObject! !
!(Modules>>#PlanE>>#AbstractAtomicCollectionRecord) methodsFor: 'persistence' stamp: 'KLG 5/16/2021 21:52:55'!
dumpDataOn: aStream
"Dump the data an aStream."
aStream nextPutAll: object! !
!(Modules>>#PlanE>>#AbstractAtomicCollectionRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 18:35:56'!
header
"Answer the header"
^ self headerArrayClass with: object size! !
!(Modules>>#PlanE>>#AbstractAtomicCollectionRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 18:34:37'!
headerArrayClass
^ DoubleWordArray! !
!(Modules>>#PlanE>>#AbstractAtomicCollectionRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 18:35:37'!
headerSize
^ 1! !
!(Modules>>#PlanE>>#AbstractAtomicCollectionRecord) methodsFor: 'persistence' stamp: 'KLG 5/19/2021 11:18:07'!
loadDataFrom: aStream header: aHeader
"Load the data for aStream"
object _ self smalltalkCollectionClass new: (aHeader at: 1).
self registerPosition.
aStream nextInto: object.
! !
!(Modules>>#PlanE>>#AbstractAtomicCollectionRecord) methodsFor: 'persistence' stamp: 'KLG 5/14/2021 22:50:26'!
smalltalkCollectionClass
"Answer the collection class to use."
^ self class smalltalkCollectionClass! !
!(Modules>>#PlanE>>#AbstractAtomicCollectionRecord) class methodsFor: 'persistence' stamp: 'KLG 5/14/2021 22:50:54'!
smalltalkCollectionClass
"Answer the collection class to use."
^ self subclassResponsibility! !
!(Modules>>#PlanE>>#LargeNegativeIntegerRecord) class methodsFor: 'persistence' stamp: 'KLG 5/16/2021 21:54:40'!
smalltalkCollectionClass
"Answer the collection class to use."
^ LargeNegativeInteger! !
!(Modules>>#PlanE>>#LargeNegativeIntegerRecord) class methodsFor: 'magic' stamp: 'KLG 5/16/2021 21:56:46'!
magicNumber
"Answer my magic number"
^ 20! !
!(Modules>>#PlanE>>#LargePositiveIntegerRecord) class methodsFor: 'persistence' stamp: 'KLG 5/16/2021 21:54:56'!
smalltalkCollectionClass
"Answer the collection class to use."
^ LargePositiveInteger ! !
!(Modules>>#PlanE>>#LargePositiveIntegerRecord) class methodsFor: 'magic' stamp: 'KLG 5/16/2021 21:56:32'!
magicNumber
"Answer my magic number"
^ 19! !
!(Modules>>#PlanE>>#AbstractStringLike) class methodsFor: 'persistence' stamp: 'KLG 5/15/2021 22:37:56'!
smalltalkCollectionClass
"Answer the collection class to use."
^ String! !
!(Modules>>#PlanE>>#InternedSymbolRecord) methodsFor: 'persistence' stamp: 'KLG 5/19/2021 14:01:13'!
loadDataFrom: aStream header: aHeader
"Load the data for aStream"
object _ self smalltalkCollectionClass new: (aHeader at: 1).
aStream nextInto: object.
object _ object asSymbol.
"Now that we know the object, we can register it."
self registerPosition
! !
!(Modules>>#PlanE>>#InternedSymbolRecord) class methodsFor: 'magic' stamp: 'KLG 5/15/2021 22:38:56'!
magicNumber
"Answer my magic number"
^ 18! !
!(Modules>>#PlanE>>#StringRecord) class methodsFor: 'magic' stamp: 'KLG 5/15/2021 21:28:41'!
magicNumber
"Answer my magic number"
^ 17! !
!(Modules>>#PlanE>>#UninternedSymbolRecord) methodsFor: 'persistence' stamp: 'KLG 5/19/2021 14:13:05'!
loadDataFrom: aStream header: aHeader
"Load the data for aStream"
| size |
object _ self smalltalkCollectionClass new: (size _ aHeader at: 1).
aStream nextInto: object.
object _ Symbol new: size :: string: object.
"Now that we know the object, we can register it."
self registerPosition
! !
!(Modules>>#PlanE>>#UninternedSymbolRecord) class methodsFor: 'magic' stamp: 'KLG 5/19/2021 14:17:05'!
magicNumber
"Answer my magic number"
^ 30! !
!(Modules>>#PlanE>>#ByteArrayRecord) class methodsFor: 'magic' stamp: 'KLG 5/18/2021 14:18:57'!
magicNumber
"Answer my magic number"
^ 24! !
!(Modules>>#PlanE>>#ByteArrayRecord) class methodsFor: 'persistence' stamp: 'KLG 5/18/2021 14:14:03'!
smalltalkCollectionClass
"Answer the collection class to use."
^ ByteArray! !
!(Modules>>#PlanE>>#DoubleByteArrayRecord) class methodsFor: 'magic' stamp: 'KLG 5/18/2021 14:33:07'!
magicNumber
"Answer my magic number"
^ 27! !
!(Modules>>#PlanE>>#DoubleByteArrayRecord) class methodsFor: 'persistence' stamp: 'KLG 5/18/2021 14:34:00'!
smalltalkCollectionClass
"Answer the collection class to use."
^ DoubleByteArray! !
!(Modules>>#PlanE>>#DoubleWordArrayRecord) class methodsFor: 'magic' stamp: 'KLG 5/18/2021 14:32:39'!
magicNumber
"Answer my magic number"
^ 26! !
!(Modules>>#PlanE>>#DoubleWordArrayRecord) class methodsFor: 'persistence' stamp: 'KLG 5/18/2021 14:33:36'!
smalltalkCollectionClass
"Answer the collection class to use."
^ DoubleWordArray! !
!(Modules>>#PlanE>>#WordArrayRecord) class methodsFor: 'magic' stamp: 'KLG 5/18/2021 14:27:15'!
magicNumber
"Answer my magic number"
^ 25! !
!(Modules>>#PlanE>>#WordArrayRecord) class methodsFor: 'persistence' stamp: 'KLG 5/18/2021 14:26:57'!
smalltalkCollectionClass
"Answer the collection class to use."
^WordArray! !
!(Modules>>#PlanE>>#AbstractSmallIntegerRecord) methodsFor: 'persistence' stamp: 'KLG 5/16/2021 22:55:42'!
dumpDataOn: aStream
"Dump the data an aStream."
aStream nextPutAll: (DoubleWordArray with: object)! !
!(Modules>>#PlanE>>#AbstractSmallIntegerRecord) methodsFor: 'persistence' stamp: 'KLG 5/19/2021 11:18:41'!
loadDataFrom: aStream
"Creat an instance of mine and load it from aStream."
| dataArray |
aStream nextInto: (dataArray _ DoubleWordArray new: 1).
object _ dataArray at: 1.
self registerPosition! !
!(Modules>>#PlanE>>#NegativeSmallIntegerRecord) methodsFor: 'accessing' stamp: 'KLG 5/16/2021 22:45:23'!
object
"Answer the object"
^ object negated! !
!(Modules>>#PlanE>>#NegativeSmallIntegerRecord) methodsFor: 'accessing' stamp: 'KLG 5/16/2021 22:54:35'!
object: anInteger
"Set the object"
object _ anInteger negated! !
!(Modules>>#PlanE>>#NegativeSmallIntegerRecord) class methodsFor: 'as yet unclassified' stamp: 'KLG 5/16/2021 22:42:12'!
magicNumber
"Answer my magic number"
^ 22! !
!(Modules>>#PlanE>>#PositiveSmallIntegerRecord) class methodsFor: 'magic' stamp: 'KLG 5/16/2021 22:23:13'!
magicNumber
"Answer my magic number"
^ 21! !
!FloatRecord methodsFor: 'persistence' stamp: 'KLG 5/17/2021 20:41:24'!
dumpDataOn: aStream
"Dump the data an aStream."
aStream nextPutAll: (DoubleWordArray with: (object at: 1) with: (object at: 2))! !
!FloatRecord methodsFor: 'persistence' stamp: 'KLG 5/19/2021 11:18:55'!
loadDataFrom: aStream
"Creat an instance of mine and load it from aStream."
| dataArray |
object _ Float new.
self registerPosition.
aStream nextInto: (dataArray _ DoubleWordArray new: 2).
object at: 1 put: (dataArray at: 1).
object at: 2 put: (dataArray at: 2)! !
!FloatRecord class methodsFor: 'magic' stamp: 'KLG 5/17/2021 20:34:30'!
magicNumber
"Answer my magic number"
^ 23! !
!(Modules>>#PlanE>>#AbstractSetRecord) methodsFor: 'persistence' stamp: 'KLG 5/18/2021 19:42:12'!
headerArrayClass
"Answer the header array class.
If we answer nil, there is no header."
^ DoubleWordArray ! !
!(Modules>>#PlanE>>#AbstractSetRecord) methodsFor: 'persistence' stamp: 'KLG 5/18/2021 19:40:53'!
headerSize
"Answer the header size.
If we answer nil, there is no header."
^ 1! !
!(Modules>>#PlanE>>#DictionaryRecord) methodsFor: 'persistence' stamp: 'KLG 5/18/2021 21:19:03'!
dumpDataOn: aStream
"Dump the data an aStream."
| dataArray arrayIndex |
dataArray _ DoubleWordArray new: object size * 2 + 1.
dataArray at: 1 put: (store recordPositionOf: object class).
arrayIndex _ 2.
object keysAndValuesDo: [ :key :value |
dataArray
at: arrayIndex
put: (store recordPositionOf: key andOffset: arrayIndex - 1).
arrayIndex _ arrayIndex + 1.
dataArray
at: arrayIndex put: (store recordPositionOf: value andOffset: arrayIndex - 1).
arrayIndex _ arrayIndex + 1 ].
aStream nextPutAll: dataArray! !
!(Modules>>#PlanE>>#DictionaryRecord) methodsFor: 'persistence' stamp: 'KLG 5/19/2021 11:19:16'!
loadDataFrom: aStream header: aHeader
"Creat an instance of mine and load it from aStream."
| dataArray size |
aStream nextInto: (dataArray _ DoubleWordArray new: (size _ aHeader at: 1)).
object _ (store loadObjectAt: (dataArray at: 1)) new: (size - 1) / 2.
self registerPosition.
2 to: size by: 2 do: [ :index |
object
at: (store loadObjectAt: (dataArray at: index))
put: (store loadObjectAt: (dataArray at: index + 1)) ]! !
!(Modules>>#PlanE>>#DictionaryRecord) methodsFor: 'persistence' stamp: 'KLG 5/18/2021 21:16:01'!
storeHeaderIn: aHeaderArray
"Store the header data in aHeaderArray"
aHeaderArray at:1 put: object size * 2 + 1! !
!(Modules>>#PlanE>>#DictionaryRecord) class methodsFor: 'magic' stamp: 'KLG 5/18/2021 19:51:20'!
magicNumber
"Answer my magic number"
^ 28! !
!(Modules>>#PlanE>>#SetRecord) methodsFor: 'persistence' stamp: 'KLG 5/18/2021 21:19:19'!
dumpDataOn: aStream
"Dump the data an aStream."
| dataArray index |
dataArray _ DoubleWordArray new: object size + 1.
dataArray at: 1 put: (store recordPositionOf: object class).
index _ 1.
object do: [ :element |
dataArray
at: index + 1
put: (store recordPositionOf: element andOffset: index).
index _ index + 1 ].
aStream nextPutAll: dataArray! !
!(Modules>>#PlanE>>#SetRecord) methodsFor: 'persistence' stamp: 'KLG 5/19/2021 11:19:29'!
loadDataFrom: aStream header: aHeader
"Creat an instance of mine and load it from aStream."
| dataArray size |
aStream nextInto: (dataArray _ DoubleWordArray new: (size _ aHeader at: 1)).
object _ (store loadObjectAt: (dataArray at: 1)) new: size - 1.
self registerPosition.
2 to: size do: [ :index |
object add: (store loadObjectAt: (dataArray at: index)) ]! !
!(Modules>>#PlanE>>#SetRecord) methodsFor: 'persistence' stamp: 'KLG 5/18/2021 21:14:35'!
storeHeaderIn: aHeaderArray
"Store the header data in aHeaderArray"
aHeaderArray at:1 put: object size + 1! !
!(Modules>>#PlanE>>#SetRecord) class methodsFor: 'magic' stamp: 'KLG 5/18/2021 19:50:23'!
magicNumber
"Answer my magic number"
^ 29! !
!(Modules>>#PlanE>>#ObjectRecord) methodsFor: 'persistence' stamp: 'KLG 5/21/2021 22:55:47'!
dumpDataOn: aStream
"Dump the data an aStream."
| dataArray class instSize collectionIndex |
dataArray _ DoubleWordArray new: ((instSize _ (class _ object class) instSize)) + object basicSize + 1.
dataArray at: 1 put: (store recordPositionOf: class).
1 to: instSize do: [ :index |
dataArray
at: index + 1
put: (store recordPositionOf: (object instVarAt: index) andOffset: index) ].
collectionIndex _ instSize + 1.
1 to: object basicSize do: [ :index |
dataArray
at: collectionIndex + 1
put: (store recordPositionOf: (object basicAt: index) andOffset: collectionIndex).
collectionIndex _ collectionIndex + 1 ].
aStream nextPutAll: dataArray
! !
!(Modules>>#PlanE>>#ObjectRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 20:14:17'!
headerArrayClass
"Answer the header array class.
If we answer nil, there is no header."
^ DoubleWordArray ! !
!(Modules>>#PlanE>>#ObjectRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 20:13:55'!
headerSize
"Answer the header size.
If we answer nil, there is no header."
^ 1! !
!(Modules>>#PlanE>>#ObjectRecord) methodsFor: 'persistence' stamp: 'KLG 5/21/2021 18:51:44'!
loadDataFrom: aStream header: aHeader
"Creat an instance of mine and load it from aStream."
| dataArray class collectionIndex variableSize |
dataArray _ DoubleWordArray new: (aHeader at: 1) + 1.
aStream nextInto: dataArray.
class _ store loadObjectAt: (dataArray at: 1).
object _
(variableSize _ dataArray size - class instSize - 1) positive
ifTrue: [ class basicNew: variableSize ]
ifFalse: [ class basicNew ].
self registerPosition.
1 to: class instSize do: [ :index |
object instVarAt: index put: (store loadObjectAt: (dataArray at: index + 1)) ].
collectionIndex _ class instSize + 2.
1 to: object basicSize do: [ :index |
object basicAt: index put: (store loadObjectAt: (dataArray at: collectionIndex)).
collectionIndex _ collectionIndex + 1 ].
! !
!(Modules>>#PlanE>>#ObjectRecord) methodsFor: 'persistence' stamp: 'KLG 5/17/2021 16:22:19'!
storeHeaderIn: aHeaderArray
"Store the header data in aHeaderArray"
aHeaderArray at: 1 put: object class instSize + object basicSize! !
!(Modules>>#PlanE>>#ObjectRecord) class methodsFor: 'magic' stamp: 'KLG 5/15/2021 21:28:50'!
magicNumber
"Answer my magic number"
^ 16! !
!(Modules>>#PlanE>>#AbstractMetaRecord) methodsFor: 'persistence' stamp: 'KLG 5/16/2021 11:28:55'!
smalltalkObject
"Answer the smalltalk object."
^ self
! !
!(Modules>>#PlanE>>#RootsRecord) methodsFor: 'persistence' stamp: 'KLG 5/21/2021 22:40:58'!
dumpDataOn: aStream
"Dump the data an aStream."
| dataArray |
dataArray _ DoubleWordArray new: self rootArraySize.
1 to: self rootArraySize do: [ :index |
dataArray at: index put: (store recordPositionOf: (roots at: index) andOffset: index - 1) ].
aStream nextPutAll: dataArray! !
!(Modules>>#PlanE>>#RootsRecord) methodsFor: 'persistence' stamp: 'KLG 5/16/2021 13:09:09'!
loadDataFrom: aStream
"Dump the data an aStream."
| dataArray |
dataArray _ DoubleWordArray new: self rootArraySize.
aStream nextInto: dataArray.
1 to: self rootArraySize do: [ :index |
roots at: index put: (store loadObjectAt: (dataArray at: index)) ]! !
!(Modules>>#PlanE>>#RootsRecord) methodsFor: 'persistence' stamp: 'KLG 5/21/2021 19:37:11'!
rootArraySize
^ 3! !
!(Modules>>#PlanE>>#RootsRecord) methodsFor: 'accessing' stamp: 'KLG 5/16/2021 13:08:40'!
at: anIndex
"Answer the root at an index."
^ roots at: anIndex! !
!(Modules>>#PlanE>>#RootsRecord) methodsFor: 'accessing' stamp: 'KLG 5/16/2021 13:08:45'!
at: anIndex put: anObject
^ roots at: anIndex put: anObject ! !
!(Modules>>#PlanE>>#RootsRecord) methodsFor: 'initialization' stamp: 'KLG 5/16/2021 13:08:19'!
initialize
"Create the array of root objects."
super initialize.
roots _ Array new: self rootArraySize! !
!(Modules>>#PlanE>>#RootsRecord) class methodsFor: 'magic' stamp: 'KLG 5/16/2021 12:12:02'!
magicNumber
"Answer the magic number."
^ 2! !
!(Modules>>#PlanE>>#StoreRecord) methodsFor: 'magic' stamp: 'KLG 5/14/2021 22:35:34'!
checkHeader
"Answer the result of the header check.
nil means ok,
aString is an error diagnosi."
^ String streamContents: [ :stream | | ok |
ok _ true.
storedMagicString = self magicString ifFalse: [
ok _ false.
stream
nextPutAll: 'Invalid magic string: ''';
nextPutAll: storedMagicString;
nextPut: $' ].
storedVersion = store storeVersion ifFalse: [
ok ifFalse: [ stream nextPutAll: ' - '].
ok _ false.
stream
nextPutAll: 'Wrong database version: ';
nextPutAll: storedVersion asString ].
ok ifTrue: [ ^ nil ] ]! !
!(Modules>>#PlanE>>#StoreRecord) methodsFor: 'magic' stamp: 'KLG 5/21/2021 20:02:17'!
magicString
"Answer the magic string for databases"
^ 'Haver PlanE'! !
!(Modules>>#PlanE>>#StoreRecord) methodsFor: 'persistence' stamp: 'KLG 5/14/2021 21:59:20'!
dumpDataOn: aStream
"Dump the data an aStream."
aStream nextPutAll: self magicString
! !
!(Modules>>#PlanE>>#StoreRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 18:31:44'!
header
"Answer the header"
^ self headerArrayClass
with: store storeVersion
with: self magicString size! !
!(Modules>>#PlanE>>#StoreRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 18:31:44'!
headerArrayClass
^ DoubleByteArray! !
!(Modules>>#PlanE>>#StoreRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 18:32:07'!
headerSize
"Answer the header size"
^ 2! !
!(Modules>>#PlanE>>#StoreRecord) methodsFor: 'persistence' stamp: 'KLG 5/15/2021 18:33:36'!
loadDataFrom: aStream header: aHeader
"Creat an instance of mine and load it from aStream."
| versionStringSize |
storedVersion _ aHeader at: 1.
storedMagicString _ String new: (versionStringSize _ aHeader at: 2).
aStream next: versionStringSize into: storedMagicString startingAt: 1
! !
!(Modules>>#PlanE>>#StoreRecord) class methodsFor: 'magic' stamp: 'KLG 5/14/2021 21:10:25'!
magicNumber
"Answer the magic number."
^ 1! !
!(Modules>>#PlanE>>#AbstractStatelessProxy) class methodsFor: 'persistence' stamp: 'KLG 5/18/2021 22:17:24'!
recordForPlanE: aStore
"Answer a record for me."
^ aStore classRecordForPlanEClass: self.! !
!(Modules>>#PlanE>>#AbstractProxy) methodsFor: 'proxies' stamp: 'KLG 5/17/2021 10:58:35'!
principalForPlanE
"Answer the object we are acting as proxy."
^ self subclassResponsibility! !
!(Modules>>#PlanE>>#AbstractProxy) class methodsFor: 'instance creation' stamp: 'KLG 5/17/2021 10:37:07'!
forObject: anObject
"Answer the proxy for an object."
^ self subclassResponsibility! !
!(Modules>>#PlanE>>#ClosureProxy) methodsFor: 'accessing' stamp: 'KLG 6/21/2021 11:31:53'!
principalForPlanE
"Answer the orginal closure."
self serializeable asEvaluable! !
!(Modules>>#PlanE>>#ClosureProxy) methodsFor: 'accessing' stamp: 'KLG 6/21/2021 11:27:09'!
serializeable
"Answer the value of serializeable"
^ serializeable! !
!(Modules>>#PlanE>>#ClosureProxy) methodsFor: 'accessing' stamp: 'KLG 6/21/2021 11:27:09'!
serializeable: anObject
"Set the value of serializeable"
serializeable _ anObject! !
!(Modules>>#PlanE>>#ClosureProxy) class methodsFor: 'instance creation' stamp: 'KLG 6/21/2021 11:27:41'!
forObject: aBlock
"Answer the proxy for a block"
^ self new serializeable: (SerializableBlockClosure onBlockClosure: aBlock)
! !
!(Modules>>#PlanE>>#CodePackageProxy) methodsFor: 'accessing' stamp: 'KLG 5/17/2021 10:35:22'!
feature
"Answer the value of feature"
^ feature! !
!(Modules>>#PlanE>>#CodePackageProxy) methodsFor: 'accessing' stamp: 'KLG 5/17/2021 10:35:22'!
feature: anObject
"Set the value of feature"
feature _ anObject! !
!(Modules>>#PlanE>>#CodePackageProxy) methodsFor: 'accessing' stamp: 'KLG 5/17/2021 11:06:50'!
fullFileName
"Answer the value of fullFileName"
^ fullFileName! !
!(Modules>>#PlanE>>#CodePackageProxy) methodsFor: 'accessing' stamp: 'KLG 5/17/2021 11:06:50'!
fullFileName: anObject
"Set the value of fullFileName"
fullFileName _ anObject! !
!(Modules>>#PlanE>>#CodePackageProxy) methodsFor: 'accessing' stamp: 'KLG 5/17/2021 11:10:22'!
principalForPlanE
"Answer the object we are acting as proxy."
fullFileName ifNil: [ false ] ifNotNil: [ :filename | filename asFileEntry exists ] ::
ifTrue: [ Feature require: fullFileName ]
ifFalse: [
Feature
require: feature name
version: feature version
revision: feature revision ].
^ CodePackage
named: feature name
createIfAbsent: false
registerIfNew: false! !
!(Modules>>#PlanE>>#CodePackageProxy) class methodsFor: 'instance creation' stamp: 'KLG 5/17/2021 11:06:07'!
forObject: aCodePackage
"Answer the proxy for a code package."
^ self new
feature: aCodePackage provides;
fullFileName: aCodePackage fullFileName ! !
!(Modules>>#PlanE>>#CompiledMethodProxy) methodsFor: 'accessing' stamp: 'KLG 5/22/2021 17:54:00'!
methodClass
"Answer the value of methodClass"
^ methodClass! !
!(Modules>>#PlanE>>#CompiledMethodProxy) methodsFor: 'accessing' stamp: 'KLG 5/22/2021 17:54:00'!
methodClass: anObject
"Set the value of methodClass"
methodClass _ anObject! !
!(Modules>>#PlanE>>#CompiledMethodProxy) methodsFor: 'accessing' stamp: 'KLG 5/22/2021 17:54:00'!
methodSelector
"Answer the value of methodSelector"
^ methodSelector! !
!(Modules>>#PlanE>>#CompiledMethodProxy) methodsFor: 'accessing' stamp: 'KLG 5/22/2021 17:54:00'!
methodSelector: anObject
"Set the value of methodSelector"
methodSelector _ anObject! !
!(Modules>>#PlanE>>#CompiledMethodProxy) methodsFor: 'proxies' stamp: 'KLG 5/30/2021 23:11:17'!
principalForPlanE
"Answer the object we represent."
^ methodClass >> methodSelector ! !
!(Modules>>#PlanE>>#CompiledMethodProxy) class methodsFor: 'instance creation' stamp: 'KLG 5/22/2021 18:09:05'!
forObject: aCompiledMethod
"Create a an instance of mine."
^ self new
methodSelector: aCompiledMethod selector;
methodClass: aCompiledMethod methodClass! !
!(Modules>>#PlanE>>#EnvironmentProxy) methodsFor: 'proxies' stamp: 'KLG 5/17/2021 21:04:42'!
principalForPlanE
"Answer the object we are acting as proxy."
^ (EnvironmentImplementations at: managerName) >> environmentName! !
!(Modules>>#PlanE>>#EnvironmentProxy) methodsFor: 'accessing' stamp: 'KLG 5/17/2021 20:56:19'!
environmentName
"Answer the value of environmentName"
^ environmentName! !
!(Modules>>#PlanE>>#EnvironmentProxy) methodsFor: 'accessing' stamp: 'KLG 5/17/2021 20:56:19'!
environmentName: anObject
"Set the value of environmentName"
environmentName _ anObject! !
!(Modules>>#PlanE>>#EnvironmentProxy) methodsFor: 'accessing' stamp: 'KLG 5/17/2021 20:56:19'!
managerName
"Answer the value of managerName"
^ managerName! !
!(Modules>>#PlanE>>#EnvironmentProxy) methodsFor: 'accessing' stamp: 'KLG 5/17/2021 20:56:19'!
managerName: anObject
"Set the value of managerName"
managerName _ anObject! !
!(Modules>>#PlanE>>#EnvironmentProxy) class methodsFor: 'instance creation' stamp: 'KLG 5/17/2021 20:56:05'!
forObject: anEnvironment
"Answer the proxy for a code package."
^ self new
managerName: anEnvironment managerClass environmentImplementationName;
environmentName: anEnvironment name! !
!(Modules>>#PlanE>>#LocalSymbolProxy) methodsFor: 'accessing' stamp: 'KLG 5/19/2021 14:38:11'!
environment: anObject
"Set the value of environment"
environment _ anObject! !
!(Modules>>#PlanE>>#LocalSymbolProxy) methodsFor: 'accessing' stamp: 'KLG 5/19/2021 14:48:11'!
principalForPlanE
"Answer the object we are acting as proxy."
^ (Symbol new: symbolString size :: string: symbolString) forEnvironment: environment! !
!(Modules>>#PlanE>>#LocalSymbolProxy) methodsFor: 'accessing' stamp: 'KLG 5/19/2021 14:47:25'!
symbol: aSynbol
"Set the value of symbol"
symbolString _ aSynbol asString! !
!(Modules>>#PlanE>>#LocalSymbolProxy) class methodsFor: 'instance creation' stamp: 'KLG 5/19/2021 14:38:24'!
forObject: aSymbol
"Answer the proxy for an object."
^ self new symbol: aSymbol; environment: aSymbol environment! !
!(Modules>>#PlanE>>#ModuleProxy) methodsFor: 'accessing' stamp: 'KLG 5/17/2021 22:32:07'!
module: aModule
"Set from a module"
moduleName _ aModule name.
aModule hasPackage ifTrue: [
package _
CodePackage
named: aModule packageName
createIfAbsent: false
registerIfNew: false ].! !
!(Modules>>#PlanE>>#ModuleProxy) methodsFor: 'proxies' stamp: 'KLG 5/17/2021 22:32:07'!
principalForPlanE
"Answer the object we are acting as proxy."
^ Modules >> moduleName! !
!(Modules>>#PlanE>>#ModuleProxy) class methodsFor: 'instance creation' stamp: 'KLG 5/17/2021 22:32:07'!
forObject: aModule
"Create an instance of mine for a module."
^ self new module: aModule! !
!(Modules>>#PlanE>>#WorldMorphProxy) methodsFor: 'accessing' stamp: 'KLG 7/7/2021 21:57:11'!
submorphs
"Answer the value of submorphs"
^ submorphs! !
!(Modules>>#PlanE>>#WorldMorphProxy) methodsFor: 'accessing' stamp: 'KLG 7/7/2021 21:57:11'!
submorphs: anObject
"Set the value of submorphs"
submorphs _ anObject! !
!(Modules>>#PlanE>>#WorldMorphProxy) methodsFor: 'proxies' stamp: 'KLG 7/7/2021 22:00:09'!
principalForPlanE
"Answer the object we are acting as proxy."
| answer |
answer _ WorldMorph newWorld.
submorphs do: [ :subSmurph |
answer addMorph: subSmurph ].
^ answer ! !
!(Modules>>#PlanE>>#WorldMorphProxy) class methodsFor: 'instance creation' stamp: 'KLG 7/7/2021 22:00:36'!
forObject: aWorldMorph
"Answer the proxy for a block"
^ self new submorphs: aWorldMorph submorphs asArray
! !
!(Modules>>#PlanE>>#GenericProxy) methodsFor: 'proxies' stamp: 'KLG 7/7/2021 10:02:36'!
principalForPlanE
"Answer the object we are acting as proxy."
^ principalClass basicNew initializeFromPlanEProxyState: principalState ! !
!(Modules>>#PlanE>>#GenericProxy) methodsFor: 'accessing' stamp: 'KLG 7/7/2021 10:05:22'!
principalClass
"Answer the value of principalClass"
^ principalClass! !
!(Modules>>#PlanE>>#GenericProxy) methodsFor: 'accessing' stamp: 'KLG 7/7/2021 10:05:22'!
principalClass: anObject
"Set the value of principalClass"
principalClass _ anObject! !
!(Modules>>#PlanE>>#GenericProxy) methodsFor: 'accessing' stamp: 'KLG 7/7/2021 10:05:22'!
principalState
"Answer the value of principalState"
^ principalState! !
!(Modules>>#PlanE>>#GenericProxy) methodsFor: 'accessing' stamp: 'KLG 7/7/2021 10:05:22'!
principalState: anObject
"Set the value of principalState"
principalState _ anObject! !
!(Modules>>#PlanE>>#GenericProxy) class methodsFor: 'as yet unclassified' stamp: 'KLG 7/7/2021 10:22:01'!
forClass: aPrincipalClass andState: aPrincipalState
"Create a new instanc eof mine for a class and a state."
^ self new
principalClass: aPrincipalClass;
principalState: aPrincipalState;
yourself! !
!(Modules>>#PlanE>>#RunningWorldProxy) methodsFor: 'proxies' stamp: 'KLG 7/7/2021 22:04:01'!
principalForPlanE
"Answer the object we are acting as proxy."
^ self runningWorld! !
!(Modules>>#PlanE>>#SmalltalkProxy) methodsFor: 'proxies' stamp: 'KLG 5/18/2021 22:26:11'!
principalForPlanE
"Answer the object we are acting as proxy."
^ Smalltalk! !
!Object methodsFor: '*PlanE' stamp: 'KLG 5/17/2021 10:58:35'!
principalForPlanE
"Answer the object we are acting as proxy.
Answer self, because we are no proxy."! !
!Object methodsFor: '*PlanE' stamp: 'KLG 5/15/2021 21:28:00'!
recordForPlanE: aStore
"Answer a record for the PlanE database."
^ aStore objectRecordFor: self! !
!Class methodsFor: '*PlanE' stamp: 'KLG 5/14/2021 20:34:48'!
recordForPlanE: aFileStore
"Answer the PlanE record for a class."
^ aFileStore classRecordFor: self! !
!Float methodsFor: '*PlanE' stamp: 'KLG 5/17/2021 20:47:09'!
recordForPlanE: aStore
"Answer the PlanE record for a aFloat"
^ aStore floatRecordFor: self! !
!LargePositiveInteger methodsFor: '*PlanE' stamp: 'KLG 5/16/2021 22:00:24'!
recordForPlanE: aStore
"Answer the PlanE record for a string"
^ aStore largePositiveIntegerRecordFor: self! !
!LargeNegativeInteger methodsFor: '*PlanE' stamp: 'KLG 5/16/2021 22:00:12'!
recordForPlanE: aStore
"Answer the PlanE record for a string"
^ aStore largeNegativeIntegerRecordFor: self! !
!SmallInteger methodsFor: '*PlanE' stamp: 'KLG 5/16/2021 22:39:12'!
recordForPlanE: aStore
"Answer a record for the PlanE database."
^ aStore smallIntegerRecordFor: self! !
!BlockClosure methodsFor: '*PlanE' stamp: 'KLG 6/21/2021 11:18:44'!
recordForPlanE: aStore
"Answer a persistent record for PlanE."
^ aStore blockClosureRecordFor: self! !
!String methodsFor: '*PlanE' stamp: 'KLG 5/14/2021 22:57:06'!
recordForPlanE: aStore
"Answer the PlanE record for a string"
^ aStore stringRecordFor: self! !
!Symbol methodsFor: '*PlanE' stamp: 'KLG 5/19/2021 14:09:04'!
recordForPlanE: aStore
"Answer the PlanE record for a string"
^ aStore symbolRecordFor: self! !
!ByteArray methodsFor: '*PlanE' stamp: 'KLG 5/18/2021 14:17:13'!
recordForPlanE: aStore
"Answer the PlanE record for a string"
^ aStore byteArrayRecordFor: self! !
!CompiledMethod methodsFor: '*PlanE' stamp: 'KLG 5/22/2021 17:55:44'!
recordForPlanE: aStore
"Answer a record for me."
^ aStore compiledMethodRecord: self.! !
!WordArray methodsFor: '*PlanE' stamp: 'KLG 5/18/2021 14:29:26'!
recordForPlanE: aStore
"Answer the PlanE record for a string"
^ aStore wordArrayRecordFor: self! !
!DoubleByteArray methodsFor: '*PlanE' stamp: 'KLG 5/18/2021 14:41:07'!
recordForPlanE: aStore
"Answer the PlanE record for a string"
^ aStore doubleByteArrayRecordFor: self! !
!DoubleWordArray methodsFor: '*PlanE' stamp: 'KLG 5/18/2021 14:41:52'!
recordForPlanE: aStore
"Answer the PlanE record for a string"
^ aStore doubleWordArrayRecordFor: self! !
!Set methodsFor: '*PlanE' stamp: 'KLG 5/18/2021 20:11:28'!
recordForPlanE: aStore
"Answer a record for the PlanE database."
^ aStore setRecordFor: self! !
!Dictionary methodsFor: '*PlanE' stamp: 'KLG 5/18/2021 20:11:47'!
recordForPlanE: aStore
"Answer a record for the PlanE database."
^ aStore dictionaryRecordFor: self! !
!SystemDictionary methodsFor: '*PlanE' stamp: 'KLG 5/18/2021 22:40:34'!
recordForPlanE: aStore
"Answer a record for the PlanE database."
^ aStore systemDictionaryRecordFor: self! !
!CodePackage methodsFor: '*PlanE' stamp: 'KLG 5/17/2021 11:02:03'!
recordForPlanE: aStore
"Answer a persistent record for PlanE."
^ aStore codePackageRecord: self! !
!WorldMorph methodsFor: '*PlanE' stamp: 'KLG 7/7/2021 22:15:05'!
recordForPlanE: aStore
"Answer a record for the PlanE database."
^ aStore worldMorphRecord: self! !
!SimpleEnvironment methodsFor: '*PlanE' stamp: 'KLG 5/17/2021 21:01:10'!
recordForPlanE: aStore
"Answer a persistent record for PlanE."
^ aStore environmentRecord: self! !
!(Environments>>#Modules>>#Module) methodsFor: '*PlanE' stamp: 'KLG 5/18/2021 22:26:49'!
recordForPlanE: aStore
"Answer a persistent record for PlanE."
^ aStore moduleRecordFor: self! !
(Modules>>#PlanE>>#AbstractRecord) initialize!