Next: , Previous: , Up: CCompound   [Index]


1.24.2 CCompound class: subclass creation

alignof

Answer 1, the alignment of an empty struct

classPragmas

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

compileSize: size align: alignment

Private - Compile sizeof and alignof methods

declaration

Return the description of the fields in the receiver class.

declaration: array

This method’s functionality should be implemented by subclasses of CCompound

declaration: array inject: startOffset into: aBlock

Compile methods that implement the declaration in array. To compute the offset after each field, the value of the old offset plus the new field’s size is passed to aBlock, together with the new field’s alignment requirements.

emitFieldNameTo: str for: name

Private - Emit onto the given stream the code for adding the given selector to the CCompound’s #examineOn: method.

newStruct: structName declaration: array

The old way to create a CStruct. Superseded by #subclass:declaration:...

sizeof

Answer 0, the size of an empty struct

subclass: structName declaration: array classVariableNames: cvn poolDictionaries: pd category: category

Create a new class with the given name that contains code to implement the given C struct. All the parameters except ‘array’ are the same as for a standard class creation message; see documentation for more information