ManagedProtoBuffer

class ManagedProtoBuffer<Value, Element>

A base class of ManagedBuffer<Value,Element>, used during instance creation.

During instance creation, in particular during ManagedBuffer.create's call to initialize, ManagedBuffer's value property is as-yet uninitialized, and therefore ManagedProtoBuffer does not offer access to the as-yet uninitialized value property of ManagedBuffer.

Inheritance NonObjectiveCBase View Protocol Hierarchy →
Import import Swift

Instance Variables

var allocatedElementCount: Int

The actual number of elements that can be stored in this object.

This value may be nontrivial to compute; it is usually a good idea to store this information in the "value" area when an instance is created.

Declaration

var allocatedElementCount: Int { get }

Instance Methods

final func withUnsafeMutablePointerToElements(_:)

Call body with an UnsafeMutablePointer to the Element storage.

Note: This pointer is only valid for the duration of the call to body.

Declaration

final func withUnsafeMutablePointerToElements<R>(body: (UnsafeMutablePointer<Element>) -> R) -> R
final func withUnsafeMutablePointerToValue(_:)

Call body with an UnsafeMutablePointer to the stored Value.

Note: This pointer is only valid for the duration of the call to body.

Declaration

final func withUnsafeMutablePointerToValue<R>(body: (UnsafeMutablePointer<Value>) -> R) -> R
final func withUnsafeMutablePointers(_:)

Call body with UnsafeMutablePointers to the stored Value and raw Element storage.

Note: These pointers are only valid for the duration of the call to body.

Declaration

final func withUnsafeMutablePointers<R>(body: (UnsafeMutablePointer<Value>, UnsafeMutablePointer<Element>) -> R) -> R