Back: CInt-accessing Up: Base classes Forward: Class class-initialize   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

1.30 Class

Defined in namespace Smalltalk
Superclass: ClassDescription
Category: Language-Implementation
I am THE class object. My instances are the classes of the system. I provide information commonly attributed to classes: namely, the class name, class comment (you wouldn't be reading this if it weren't for me), a list of the instance variables of the class, and the class category.

1.30.1 Class class: initialize  (class)
1.30.2 Class: accessing instances and variables  (instance)
1.30.3 Class: filing  (instance)
1.30.4 Class: instance creation  (instance)
1.30.5 Class: instance creation - alternative  (instance)
1.30.6 Class: pragmas  (instance)
1.30.7 Class: printing  (instance)
1.30.8 Class: saving and loading  (instance)
1.30.9 Class: security  (instance)
1.30.10 Class: still unclassified  (instance)
1.30.11 Class: testing  (instance)
1.30.12 Class: testing functionality  (instance)


1.30.1 Class class: initialize

initialize
Perform the special initialization of root classes.


1.30.2 Class: accessing instances and variables

addClassVarName: aString
Add a class variable with the given name to the class pool dictionary.

addClassVarName: aString value: valueBlock
Add a class variable with the given name to the class pool dictionary, and evaluate valueBlock as its initializer.

addSharedPool: aDictionary
Add the given shared pool to the list of the class' pool dictionaries

allClassVarNames
Answer the names of the variables in the receiver's class pool dictionary and in each of the superclasses' class pool dictionaries

bindingFor: aString
Answer the variable binding for the class variable with the given name

category
Answer the class category

category: aString
Change the class category to aString

classPool
Answer the class pool dictionary

classPragmas
Return the pragmas that are written in the file-out of this class.

classVarNames
Answer the names of the variables in the class pool dictionary

comment
Answer the class comment

comment: aString
Change the class name

environment
Answer `environment'.

environment: aNamespace
Set the receiver's environment to aNamespace and recompile everything

initialize
redefined in children (?)

initializeAsRootClass
Perform special initialization reserved to root classes.

name
Answer the class name

removeClassVarName: aString
Removes the class variable from the class, error if not present, or still in use.

removeSharedPool: aDictionary
Remove the given dictionary to the list of the class' pool dictionaries

sharedPools
Return the names of the shared pools defined by the class

superclass: aClass
Set the receiver's superclass.


1.30.3 Class: filing

fileOutDeclarationOn: aFileStream
File out class definition to aFileStream. Requires package Parser.

fileOutOn: aFileStream
File out complete class description: class definition, class and instance methods. Requires package Parser.


1.30.4 Class: instance creation

extend
Redefine a version of the receiver in the current namespace. Note: this method can bite you in various ways when sent to system classes; read the section on namespaces in the manual for some examples of the problems you can encounter.

inheritShape
Answer whether subclasses will have by default the same shape as this class. The default is false.

subclass: classNameString
Define a subclass of the receiver with the given name. If the class is already defined, don't modify its instance or class variables but still, if necessary, recompile everything needed.

subclass: classNameString environment: aNamespace
Define a subclass of the receiver with the given name within aNamespace. If the class is already defined, don't modify its instance or class variables but still, if necessary, recompile everything needed.

subclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryNameString
Define a fixed subclass of the receiver with the given name, instance variables, class variables, pool dictionaries and category. If the class is already defined, if necessary, recompile everything needed.

variable: shape subclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryNameString
Define a variable subclass of the receiver with the given name, shape, instance variables, class variables, pool dictionaries and category. If the class is already defined, if necessary, recompile everything needed. The shape can be one of #byte #int8 #character #short #ushort #int #uint #int64 #uint64 #utf32 #float #double or #pointer.

variableByteSubclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryNameString
Define a byte variable subclass of the receiver with the given name, instance variables (must be "), class variables, pool dictionaries and category. If the class is already defined, if necessary, recompile everything needed.

variableSubclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryNameString
Define a variable pointer subclass of the receiver with the given name, instance variables, class variables, pool dictionaries and category. If the class is already defined, if necessary, recompile everything needed.

variableWordSubclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryNameString
Define a word variable subclass of the receiver with the given name, instance variables (must be "), class variables, pool dictionaries and category. If the class is already defined, if necessary, recompile everything needed.


1.30.5 Class: instance creation - alternative

categoriesFor: method are: categories
Don't use this, it is only present to file in from IBM Smalltalk

subclass: classNameString classInstanceVariableNames: stringClassInstVarNames instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames
Don't use this, it is only present to file in from IBM Smalltalk

subclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames
Don't use this, it is only present to file in from IBM Smalltalk

variableByteSubclass: classNameString classInstanceVariableNames: stringClassInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames
Don't use this, it is only present to file in from IBM Smalltalk

variableByteSubclass: classNameString classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames
Don't use this, it is only present to file in from IBM Smalltalk

variableLongSubclass: classNameString classInstanceVariableNames: stringClassInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames
Don't use this, it is only present to file in from IBM Smalltalk

variableLongSubclass: classNameString classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames
Don't use this, it is only present to file in from IBM Smalltalk

variableSubclass: classNameString classInstanceVariableNames: stringClassInstVarNames instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames
Don't use this, it is only present to file in from IBM Smalltalk

variableSubclass: classNameString instanceVariableNames: stringInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames
Don't use this, it is only present to file in from IBM Smalltalk


1.30.6 Class: pragmas

pragmaHandlerFor: aSymbol
Answer the (possibly inherited) registered handler for pragma aSymbol, or nil if not found.

registerHandler: aBlock forPragma: pragma
While compiling methods, on every encounter of the pragma with the given name, call aBlock with the CompiledMethod and an array of pragma argument values.


1.30.7 Class: printing

article
Answer an article (`a' or `an') which is ok for the receiver's name

printOn: aStream
Print a representation of the receiver on aStream

storeOn: aStream
Store Smalltalk code compiling to the receiver on aStream


1.30.8 Class: saving and loading

binaryRepresentationVersion
Answer a number >= 0 which represents the current version of the object's representation. The default implementation answers zero.

convertFromVersion: version withFixedVariables: fixed indexedVariables: indexed for: anObjectDumper
This method is called if a VersionableObjectProxy is attached to a class. It receives the version number that was stored for the object (or nil if the object did not use a VersionableObjectProxy), the fixed instance variables, the indexed instance variables, and the ObjectDumper that has read the object. The default implementation ignores the version and simply fills in an instance of the receiver with the given fixed and indexed instance variables (nil if the class instances are of fixed size). If instance variables were removed from the class, extras are ignored; if the class is now fixed and used to be indexed, indexed is not used.

nonVersionedInstSize
Answer the number of instance variables that the class used to have when objects were stored without using a VersionableObjectProxy. The default implementation answers the current instSize.


1.30.9 Class: security

check: aPermission
Not commented.

securityPolicy
Answer `securityPolicy'.

securityPolicy: aSecurityPolicy
Not commented.


1.30.10 Class: still unclassified

allSharedPoolDictionariesDo: aBlock
Answer the shared pools visible from methods in the metaclass, in the correct search order.

allSharedPoolDictionariesDo: aBlock overrideEnvironment: aNamespace
Answer the shared pools visible from methods in the class, in the correct search order. The receiver's environment is temporarily replaced with aNamespace

fileOutHeaderOn: aFileStream
Not commented.


1.30.11 Class: testing

= aClass
Returns true if the two class objects are to be considered equal.


1.30.12 Class: testing functionality

asClass
Answer the receiver.

isClass
Answer `true'.



Back: Class-testing Up: Class Forward: ClassDescription   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on February, 22 2012 using texi2html