class ManagedBuffer<Value, Element>
Inheritance |
ManagedProtoBuffer, NonObjectiveCBase
View Protocol Hierarchy →
|
---|---|
Import | import Swift |
Instance Variables
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
.
Declaration
final class func create(minimumCapacity: Int, initialValue: (ManagedProtoBuffer<Value, Element>) -> Value) -> ManagedBuffer<Value, Element>
A class whose instances contain a property of type
Value
and raw storage for an array ofElement
, 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 onUnsafeMutablePointer<Element>
. Typical usage stores a count and capacity inValue
and destroys any live elements in thedeinit
of a subclass. Note: Subclasses must not have any stored properties; any storage needed should be included inValue
.