[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

api[sdk] definitions

Implementation for adapters to constamts
Object
	subclass: #SDKConstants
	instanceVariableNames: ''
	classVariableNames: #Names
	category: #sdk!

! SDKConstants class methodsFor: #accessing !
@ aKey
	" Return the value of constant at aKey (or nil). "

	Names isNil ifTrue: [ Names := PoolDictionary new ].
	^Names at: # aKey ifAbsentPut: [
		Smalltalk nativeObjectAt: (self validNameFor: aKey)
	]! !

! SDKConstants class methodsFor: #private !
validNameFor: aKey
	" Private - Ensure aKey is a valid name for constant. "

	(self validNames includes: aKey) ifFalse: [
		self error: 'Invalid name for constant'
	].
	^aKey! !

! SDKConstants class methodsFor: #private !
validNames
	" Private - Return valid names for constant. "

	^self subclassResponsibility: #validNames! !