mirror of
https://github.com/apple/swift-collections
synced 2026-11-24 04:27:53 +00:00
Also move Capacity, Bitmap under _NodeHeader. Start thematically organizing _Node members.
30 lines
805 B
Swift
30 lines
805 B
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the Swift Collections open source project
|
|
//
|
|
// Copyright (c) 2022 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
protocol _NodeProtocol: AnyObject {
|
|
associatedtype ReturnPayload
|
|
associatedtype ReturnBitmapIndexedNode: _NodeProtocol
|
|
|
|
var hasNodes: Bool { get }
|
|
|
|
var nodeArity: Int { get }
|
|
|
|
func getNode(_ index: Int) -> Self
|
|
|
|
var hasPayload: Bool { get }
|
|
|
|
var payloadArity: Int { get }
|
|
|
|
func getPayload(_ index: Int) -> ReturnPayload
|
|
|
|
var count: Int { get }
|
|
}
|