"
COPYRIGHT (c) 2004 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
"
"{ Package: 'stx:libbasic' }"
Object subclass:#SharedPool
instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
category:'Kernel-Classes'
!
!SharedPool class methodsFor:'documentation'!
copyright
"
COPYRIGHT (c) 2004 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
"
!
documentation
"
A shared pool represents a set of bindings which are accessible to all classes
which import the pool in its 'pool dictionaries'.
SharedPool is NOT a dictionary but rather a name space.
Bindings are represented by 'class variables' - as long as we have no better way to represent
them at least.
"
! !
!SharedPool class methodsFor:'Compatibility-V''Age'!
declareConstant:constantName value:value
self == SharedPool ifTrue:[ self error ].
(self classVarNames includes:constantName) ifFalse:[
self addClassVarName:constantName
].
self classVarAt:constantName put:value.
! !
!SharedPool class methodsFor:'name lookup'!
bindingOf: varName
"Answer the binding of some variable resolved in the scope of the receiver"
| aSymbol binding |
self halt:'unfinished implementation'.
aSymbol := varName asSymbol.
"First look in classVar dictionary."
binding := self classPool bindingOf: aSymbol.
binding ifNotNil:[^binding].
"Next look in shared pools."
self sharedPools do:[:pool |
binding := pool bindingOf: aSymbol.
binding ifNotNil:[^binding].
].
"subclassing and environment are not preserved"
^nil
!
bindingsDo: aBlock
self halt:'unfinished implementation'.
^ self classPool bindingsDo: aBlock
!
classBindingOf: varName
"For initialization messages grant the regular scope"
self halt:'unfinished implementation'.
^super bindingOf: varName
!
includesKey:aSymbol
^ self keys includes:aSymbol
"
OpenGLConstants includesKey:#GL3Bytes
"
!
keys
^ self classVarNames
"
OpenGLConstants keys
"
! !
!SharedPool class methodsFor:'printing & storing'!
displayString
"return a printed represenation - here, a reminder is appended,
that this is not a regular class"
self == SharedPool ifTrue:[
^ super displayString
].
^ self name , ' (* SharedPool *)'
! !
!SharedPool class methodsFor:'queries'!
isSharedPool
^ self ~~ SharedPool
! !
!SharedPool class methodsFor:'documentation'!
version
^ '$Header: /cvs/stx/stx/libbasic/SharedPool.st,v 1.4 2006-02-03 16:32:35 cg Exp $'
! !