Skip to content

ClassDescriptor

tevelee edited this page Jul 25, 2026 · 5 revisions

ClassDescriptor

A class descriptor that descibes some class context.

public struct ClassDescriptor: TypeContextDescriptor, LayoutWrapper 

ABI Stability: Stable since the following

| macOS | iOS/tvOS | watchOS | Linux | Windows |
|-------|----------|---------|-------|---------|
| 10.14 | 12.2     | 5.2     | NA    | NA      |

Inheritance

TypeContextDescriptor, LayoutWrapper

Properties

ptr

Backing context descriptor pointer.

public let ptr: UnsafeRawPointer

superclass

The mangled type name for this class's superclass, if it has one.

public var superclass: UnsafeRawPointer 

negativeSize

The negative size of the metadata objects in this class.

public var negativeSize: Int 

positiveSize

The positive size of the metadata objects in this class.

public var positiveSize: Int 

numMembers

The number of members this class defines. This is both properties and methods.

public var numMembers: Int 

numFields

The number of properties this class declares (not including superclass) properties).

public var numFields: Int 

fieldOffsetVectorOffset

The number of words away the field offset vector is from canonical metadata pointer.

public var fieldOffsetVectorOffset: Int 

resilientSuperclass

A pointer to the resilient superclass. This pointer differs in type depending on what typeFlags.resilientSuperclassRefKind returns.

public var resilientSuperclass: UnsafeRawPointer? 

foreignMetadataInitialization

The foreign metadata initialization info for this class metadata, if it has any.

public var foreignMetadataInitialization: ForeignMetadataInitialization? 

singletonMetadataInitialization

The singleton metadata initialization info for this class metadata, if it has any.

public var singletonMetadataInitialization: SingletonMetadataInitialization? 

vtableHeader

The VTable header information for this class, if it has a vtable.

public var vtableHeader: VTableDescriptorHeader? 

methodDescriptors

An array of all of the method descriptors for this class for the entries in the vtable, if this class has a vtable.

public var methodDescriptors: [MethodDescriptor] 

overrideTableHeader

The override table header indicating how many method overrides there are for this class, if it has an override table.

public var overrideTableHeader: OverrideTableHeader? 

methodOverrideDescriptors

An array of all of the method override descriptors, if this class has an override table.

public var methodOverrideDescriptors: [MethodOverrideDescriptor] 

extraClassFlags

Extra class flags stored when this class has a resilient superclass.

public var extraClassFlags: ExtraClassDescriptorFlags? 

objcResilientClassStub

The Objective-C resilient class stub, if this descriptor records one.

public var objcResilientClassStub: UnsafeRawPointer? 

canonicalMetadataPrespecializations

Canonical metadata specializations emitted for this generic class.

public var canonicalMetadataPrespecializations: [Metadata] 

canonicalMetadataPrespecializationAccessors

Accessors corresponding to canonicalMetadataPrespecializations.

public var canonicalMetadataPrespecializationAccessors: [MetadataAccessFunction] 

canonicalMetadataPrespecializationCachingOnceToken

The runtime-owned once-token used to cache this generic class's canonical metadata prespecializations. This storage is exposed for inspection only and must not be mutated.

public var canonicalMetadataPrespecializationCachingOnceToken: UnsafeRawPointer? 

invertedProtocols

Capabilities this class's primary definition explicitly inverts.

public var invertedProtocols: InvertibleProtocolSet? 

singletonMetadata

The directly stored singleton metadata, when the compiler emitted one.

public var singletonMetadata: Metadata? 

defaultOverrideTableHeader

Header for default method overrides inherited by subclasses.

public var defaultOverrideTableHeader: DefaultOverrideTableHeader? 

defaultOverrideDescriptors

Default method override records emitted for this class.

public var defaultOverrideDescriptors: [MethodDefaultOverrideDescriptor] 
Types
Protocols
Global Typealiases
Global Variables
Global Functions

Clone this wiki locally