class ManagedBuffer<Value, Element>

A class whose instances contain a property of type Value and raw storage for an array of Element, whose size is determined at instance creation.

Note that the Element array is suitably-aligned raw memory. You are expected to construct and---if necessary---destroy objects there yourself, using the APIs on UnsafeMutablePointer<Element>. Typical usage stores a count and capacity in Value and destroys any live elements in the deinit of a subclass. Note: Subclasses must not have any stored properties; any storage needed should be included in Value.

Inheritance ManagedProtoBuffer, NonObjectiveCBase View Protocol Hierarchy →
Import import Swift

Instance Variables

var value: Value

The stored Value instance.


var value: Value { get set }

Instance Methods

final class func create(_:initialValue:)

Create a new instance of the most-derived class, calling initializeValue on the partially-constructed object to generate an initial Value.


final class func create(minimumCapacity: Int, initialValue: (ManagedProtoBuffer<Value, Element>) -> Value) -> ManagedBuffer<Value, Element>