Skip to content

EnumDescriptor

Azoy edited this page May 6, 2021 · 2 revisions

EnumDescriptor

An enum descriptor that describes some enum context.

public struct EnumDescriptor: 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

numPayloadCases

The number of enum cases which have payloads (associated types). Ex. case number(Int)

public var numPayloadCases: Int 

payloadSizeOffset

The payload size offset is the number of words from the metadata pointer to the payload size, if any.

public var payloadSizeOffset: Int 

hasPayloadSizeOffset

Whether or not this enum has a payload size offset.

public var hasPayloadSizeOffset: Bool 

numEmptyCases

The number of enum cases that have no payload. Ex. case blue

public var numEmptyCases: Int 

numCases

The total number of cases this enum has.

public var numCases: Int 

foreignMetadataInitialization

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

public var foreignMetadataInitialization: ForeignMetadataInitialization? 

singletonMetadataInitialization

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

public var singletonMetadataInitialization: SingletonMetadataInitialization? 
Types
Protocols
Global Variables
Global Functions
Clone this wiki locally