diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGAttributeType.h b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGAttributeType.h index 4229ac2..0579f04 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGAttributeType.h +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGAttributeType.h @@ -1,6 +1,6 @@ // // AGAttributeType.h -// +// // // Created by Kyle on 2024/2/17. // @@ -8,15 +8,35 @@ #ifndef AGAttributeType_h #define AGAttributeType_h +#include "AGAttributeTypeFlags.h" #include "AGBase.h" #include "AGTypeID.h" AG_ASSUME_NONNULL_BEGIN +typedef struct AGClosureStorage { + void *function; + void *context; +} AGClosureStorage; + +typedef struct AGAttributeVTable { +} AGAttributeVTable; + typedef struct AGAttributeType { AGTypeID typeID; AGTypeID valueTypeID; - // TODO + + AGClosureStorage updateClosure; + + AGAttributeVTable *_Nullable callbacks; + AGAttributeTypeFlags flags; + + // set after construction + uint32_t offset; + const unsigned char *_Nullable layout; + + AGTypeID initialTypeID; + void *initialBodyTypeID; } AGAttributeType; AG_ASSUME_NONNULL_END diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGCompareValues.h b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGCompareValues.h index 2fc6604..398c60b 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGCompareValues.h +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGCompareValues.h @@ -12,9 +12,15 @@ #include "AGComparisonMode.h" AG_EXTERN_C_BEGIN + AG_EXPORT AG_REFINED_FOR_SWIFT bool AGCompareValues(const void *lhs, const void *rhs, const void *type, const AGComparisonMode comparisonMode); + +AG_EXPORT +AG_REFINED_FOR_SWIFT +const unsigned char *_Nullable AGPrefetchCompareValues(AGTypeID type, AGComparisonOptions options, uint32_t priority); + AG_EXTERN_C_END #endif /* AGCompareValues_h */ diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGComparisonMode.h b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGComparisonMode.h index b4a5b9f..ec83f07 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGComparisonMode.h +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGComparisonMode.h @@ -10,19 +10,19 @@ #include "AGBase.h" -typedef AG_OPTIONS(uint32_t, AGComparisonMode) { - AGComparisonMode_0 = 0, - AGComparisonMode_1 = 1 << 0, - AGComparisonMode_2 = 1 << 1, - AGComparisonMode_3 = AGComparisonMode_1 | AGComparisonMode_2, +typedef AG_ENUM(uint8_t, AGComparisonMode){ + AGComparisonModeBitwise = 0, + AGComparisonModeIndirect = 1, + AGComparisonModeEquatableUnlessPOD = 2, + AGComparisonModeEquatableAlways = 3, }; -typedef AG_OPTIONS(uint32_t, AGComparisonOptions) { - AGComparisonOptions_0 = 0, - AGComparisonOptions_1 = 1 << 0, - AGComparisonOptions_2 = 1 << 1, - AGComparisonOptions_3 = AGComparisonOptions_1 | AGComparisonOptions_2, +typedef AG_OPTIONS(uint32_t, AGComparisonOptions){ + AGComparisonOptionsComparisonModeMask = 0xff, + + AGComparisonOptionsCopyOnWrite = 1 << 8, + AGComparisonOptionsFetchLayoutsSynchronously = 1 << 9, + AGComparisonOptionsReportFailures = 1ul << 31, // -1 signed int }; #endif /* AGComparisonMode_h */ - diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGCounterQueryType.h b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGCounterQueryType.h deleted file mode 100644 index 2a60455..0000000 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGCounterQueryType.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// AGCounterQueryType.h -// -// -// Created by Kyle on 2024/3/8. -// - -#ifndef AGCounterQueryType_h -#define AGCounterQueryType_h - -#include "AGBase.h" - -typedef AG_ENUM(uint32_t, AGCounterQueryType) { - AGCounterQueryType_0, - AGCounterQueryType_1, - AGCounterQueryType_2, - AGCounterQueryType_3, - AGCounterQueryType_4, - AGCounterQueryType_5, - AGCounterQueryType_6, - AGCounterQueryType_7, - AGCounterQueryType_8, - AGCounterQueryType_9, - AGCounterQueryType_10, -}; - -#endif /* AGCounterQueryType_h */ diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraph.h b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraph.h index 1bd7674..65eedf4 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraph.h +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraph.h @@ -10,17 +10,19 @@ #include "AGBase.h" #include "CFRuntime.h" -#include "AGCounterQueryType.h" +#include "AGGraphCounterQuery.h" // Note: Place all structure declaration in a single place to avoid header cycle dependency typedef struct AG_BRIDGED_TYPE(id) AGGraphStorage * AGGraphRef; -typedef struct AG_BRIDGED_TYPE(id) AGGraphContextStorage * AGGraphContextRef; typedef struct AG_BRIDGED_TYPE(id) AGSubgraphStorage * AGSubgraphRef; +typedef void * AGUnownedGraphRef; +typedef struct AGGraphContextStorage * AGUnownedGraphContextRef; + struct AGGraphStorage; -struct AGGraphContextStorage; struct AGSubgraphStorage; +struct AGGraphContextStorage; typedef uint32_t AGAttribute AG_SWIFT_STRUCT AG_SWIFT_NAME(AnyAttribute); @@ -68,7 +70,7 @@ void AGGraphSetContext(AGGraphRef graph, const void * _Nullable context) AG_SWIF AG_EXPORT AG_REFINED_FOR_SWIFT -AGGraphContextRef AGGraphGetGraphContext(AGGraphRef graph) AG_SWIFT_NAME(getter:AGGraphRef.graphContext(self:)); +AGUnownedGraphRef AGGraphGetGraphContext(AGGraphRef graph) AG_SWIFT_NAME(getter:AGGraphRef.graphContext(self:)); AG_EXPORT AG_REFINED_FOR_SWIFT @@ -92,7 +94,7 @@ void AGGraphSetUpdateCallback(AGGraphRef graph, AG_EXPORT AG_REFINED_FOR_SWIFT -uint64_t AGGraphGetCounter(AGGraphRef graph, AGCounterQueryType query) AG_SWIFT_NAME(AGGraphRef.counter(self:for:)); +uint64_t AGGraphGetCounter(AGGraphRef graph, AGGraphCounterQuery query) AG_SWIFT_NAME(AGGraphRef.counter(self:for:)); AG_EXPORT AG_REFINED_FOR_SWIFT diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraphContext.h b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraphContext.h index eee32d0..4d6e84f 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraphContext.h +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraphContext.h @@ -19,7 +19,7 @@ AG_EXTERN_C_BEGIN AG_EXPORT AG_REFINED_FOR_SWIFT -AGGraphRef AGGraphContextGetGraph(AGGraphContextRef context) AG_SWIFT_NAME(getter:AGGraphContextRef.graph(self:)); +AGGraphRef AGGraphContextGetGraph(AGUnownedGraphContextRef context) AG_SWIFT_NAME(getter:AGUnownedGraphContextRef.graph(self:)); AG_EXTERN_C_END diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraphCounterQuery.h b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraphCounterQuery.h new file mode 100644 index 0000000..6fd06d3 --- /dev/null +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraphCounterQuery.h @@ -0,0 +1,30 @@ +// +// AGCounterQueryType.h +// +// +// Created by Kyle on 2024/3/8. +// + +#ifndef AGGraphCounterQuery_h +#define AGGraphCounterQuery_h + +#include "AGBase.h" + +typedef AG_ENUM(uint32_t, AGGraphCounterQuery){ + AGGraphCounterQueryNodeCount, + AGGraphCounterQueryTransactionCount, + AGGraphCounterQueryUpdateCount, + AGGraphCounterQueryChangeCount, + AGGraphCounterQueryContextID, + AGGraphCounterQueryGraphID, + AGGraphCounterQueryContextThreadUpdating, + AGGraphCounterQueryThreadUpdating, + AGGraphCounterQueryContextNeedsUpdate, + AGGraphCounterQueryNeedsUpdate, + AGGraphCounterQueryMainThreadUpdateCount, + AGGraphCounterQueryNodeTotalCount, + AGGraphCounterQuerySubgraphCount, + AGGraphCounterQuerySubgraphTotalCount, +}; + +#endif /* AGGraphCounterQuery_h */ diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGSubgraph.h b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGSubgraph.h index 8cf9f2c..461a8b2 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGSubgraph.h +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGSubgraph.h @@ -43,7 +43,7 @@ void AGSubgraphSetCurrent(_Nullable AGSubgraphRef cf_subgraph) AG_SWIFT_NAME(set AG_EXPORT AG_REFINED_FOR_SWIFT -_Nullable AGGraphContextRef AGSubgraphGetCurrentGraphContext(void) AG_SWIFT_NAME(getter:AGSubgraphRef.currentGraphContext()); +_Nullable AGUnownedGraphRef AGSubgraphGetCurrentGraphContext(void) AG_SWIFT_NAME(getter:AGSubgraphRef.currentGraphContext()); AG_EXPORT AG_REFINED_FOR_SWIFT diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGTypeID.h b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGTypeID.h index 002b5f4..585248c 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGTypeID.h +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGTypeID.h @@ -10,10 +10,7 @@ AG_ASSUME_NONNULL_BEGIN -typedef struct AG_SWIFT_NAME(_Metadata) AGSwiftMetadata { -} AGSwiftMetadata; - -typedef const AGSwiftMetadata *AGTypeID AG_SWIFT_STRUCT AG_SWIFT_NAME(Metadata); +typedef const struct AGSwiftMetadata *AGTypeID AG_SWIFT_STRUCT AG_SWIFT_NAME(Metadata); #if ATTRIBUTEGRAPH_RELEASE >= ATTRIBUTEGRAPH_RELEASE_2024 @@ -35,11 +32,11 @@ typedef AG_CLOSED_ENUM(uint32_t, AGTypeKind) { AGTypeKindMetatype, } AG_SWIFT_NAME(Metadata.Kind); -typedef AG_OPTIONS(uint32_t, AGTypeApplyOptions) { - AGTypeApplyOptions_0 = 0, - AGTypeApplyOptions_1 = 1 << 0, - AGTypeApplyOptions_2 = 1 << 1, - AGTypeApplyOptions_4 = 1 << 2, +typedef AG_OPTIONS(uint32_t, AGTypeApplyOptions){ + AGTypeApplyOptionsEnumerateStructFields = 0, + AGTypeApplyOptionsEnumerateClassFields = 1 << 0, + AGTypeApplyOptionsContinueAfterUnknownField = 1 << 1, + AGTypeApplyOptionsEnumerateEnumCases = 1 << 2, }; AG_EXTERN_C_BEGIN diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h index 5341208..eea48a1 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h @@ -8,10 +8,10 @@ #include "AGChangedValueFlags.h" #include "AGCompareValues.h" #include "AGComparisonMode.h" -#include "AGCounterQueryType.h" #include "AGDebugServer.h" #include "AGGraph.h" #include "AGGraphContext.h" +#include "AGGraphCounterQuery.h" #include "AGGraphDescription.h" #include "AGInputOptions.h" #include "AGSearchOptions.h" diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios.swiftinterface b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios.swiftinterface index 168aa6d..c42a5ca 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios.swiftinterface +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios.swiftinterface @@ -1,6 +1,6 @@ // swift-interface-format-version: 1.0 -// swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) -// swift-module-flags: -target arm64e-apple-ios11.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name AttributeGraph +// swift-compiler-version: Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3) +// swift-module-flags: -target arm64e-apple-ios11.0 -enable-objc-interop -enable-library-evolution -swift-version 6 -enforce-exclusivity=checked -O -module-name AttributeGraph // swift-module-flags-ignorable: -enable-bare-slash-regex @_exported import AttributeGraph import Foundation @@ -13,27 +13,27 @@ import _StringProcessing // MARK: - AnyAttribute extension AttributeGraph.AnyAttribute { - public init(_ attribute: AttributeGraph.Attribute) - public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute - public static var current: AnyAttribute? { get } - public func unsafeOffset(at offset: Int) -> AnyAttribute - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - public func visitBody(_ visitor: inout Visitor); - public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> ()) - public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var _bodyType: Any.Type { get } - public var _bodyPointer: UnsafeRawPointer { get } - public var valueType: Any.Type { get } - public var indirectDependency: AnyAttribute? { - get - nonmutating set - } + public init(_ attribute: AttributeGraph.Attribute) + public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute + public static var current: AnyAttribute? { get } + public func unsafeOffset(at offset: Int) -> AnyAttribute + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + public func visitBody(_ visitor: inout Visitor) + public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + public var _bodyType: Any.Type { get } + public var _bodyPointer: UnsafeRawPointer { get } + public var valueType: Any.Type { get } + public var indirectDependency: AnyAttribute? { + get + nonmutating set + } } extension AttributeGraph.AnyAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } public typealias AttributeUpdateBlock = () -> ((Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void) @@ -48,66 +48,74 @@ public struct Attribute { public init(identifier: AnyAttribute) public init(_ attribute: AttributeGraph.Attribute) - public init(value: Value) - public init(type: Value.Type) - public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: AGAttributeTypeFlags, update: AttributeUpdateBlock) - public var wrappedValue: Value { - unsafeAddress - nonmutating set - } - public var projectedValue: AttributeGraph.Attribute { get set } - + public init(value: Value) + public init(type: Value.Type) + public init( + body: Swift.UnsafePointer, + value: Swift.UnsafePointer?, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) + public var wrappedValue: Value { + unsafeAddress + nonmutating set + } + public var projectedValue: AttributeGraph.Attribute { get set } + public subscript(dynamicMember _: Swift.KeyPath) -> AttributeGraph.Attribute { get } public subscript(keyPath _: Swift.KeyPath) -> AttributeGraph.Attribute { get } - public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) -> AttributeGraph.Attribute { get } - - public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute - public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute - public func applying(offset: AttributeGraph.PointerOffset) -> AttributeGraph.Attribute - public func visitBody(_ visitor: inout Body) - public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) - public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - - public var graph: AGGraph { get } - public var subgraph: AGSubgraph { get } - - public var value: Value { - unsafeAddress - nonmutating set - } - public var valueState: AGValueState { get } - public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public func setValue(_ value: Value) -> Bool - public var hasValue: Bool { get } - public func updateValue() - public func prefetchValue() - public func invalidateValue() - public func validate() - - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - - public var flags: AGAttributeFlags { - get - nonmutating set - } - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + { get } + + public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute + public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute + public func applying(offset: AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + public func visitBody(_ visitor: inout Body) + public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + + public var graph: AGGraph { get } + public var subgraph: AGSubgraph { get } + + public var value: Value { + unsafeAddress + nonmutating set + } + public var valueState: AGValueState { get } + public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public func setValue(_ value: Value) -> Bool + public var hasValue: Bool { get } + public func updateValue() + public func prefetchValue() + public func invalidateValue() + public func validate() + + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + + public var flags: AGAttributeFlags { + get + nonmutating set + } + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) } extension AttributeGraph.Attribute: Swift.Hashable { public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool + public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool public var hashValue: Swift.Int { get } } extension AttributeGraph.Attribute: Swift.CustomStringConvertible { - public var description: String { get } + public var description: String { get } } extension AttributeGraph.Attribute { - public init(_ rule: R) where R.Value == Value - public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value } // MARK: - AnyWeakAttribute @@ -115,140 +123,144 @@ extension AttributeGraph.Attribute { public typealias AnyWeakAttribute = AGWeakAttribute extension AttributeGraph.AnyWeakAttribute { - @_alwaysEmitIntoClient - public init(_ attribute: AnyAttribute?) { - self = __AGCreateWeakAttribute(attribute ?? .nil) - } - - @_alwaysEmitIntoClient - public init(_ weakAttribute: AttributeGraph.WeakAttribute) { - self = weakAttribute.base - } - - @_alwaysEmitIntoClient - public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { - WeakAttribute(base: self) - } - - @_alwaysEmitIntoClient - public var attribute: AnyAttribute? { - get { - let attribute = __AGWeakAttributeGetAttribute(self) - return attribute == .nil ? nil : attribute - } - set { - self = AnyWeakAttribute(newValue) - } - } + @_alwaysEmitIntoClient + public init(_ attribute: AnyAttribute?) { + self = __AGCreateWeakAttribute(attribute ?? .nil) + } + + @_alwaysEmitIntoClient + public init(_ weakAttribute: AttributeGraph.WeakAttribute) { + self = weakAttribute.base + } + + @_alwaysEmitIntoClient + public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { + WeakAttribute(base: self) + } + + @_alwaysEmitIntoClient + public var attribute: AnyAttribute? { + get { + let attribute = __AGWeakAttributeGetAttribute(self) + return attribute == .nil ? nil : attribute + } + set { + self = AnyWeakAttribute(newValue) + } + } } extension AttributeGraph.AnyWeakAttribute: Hashable { - @_alwaysEmitIntoClient - public func hash(into hasher: inout Swift.Hasher) { - hasher.combine(raw_attribute) - hasher.combine(subgraph_id) - } + @_alwaysEmitIntoClient + public func hash(into hasher: inout Swift.Hasher) { + hasher.combine(raw_attribute) + hasher.combine(subgraph_id) + } - @_alwaysEmitIntoClient - public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { - lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id - } + @_alwaysEmitIntoClient + public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { + lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id + } - @_alwaysEmitIntoClient - public var hashValue: Int { - _hashValue(for: self) - } + @_alwaysEmitIntoClient + public var hashValue: Int { + _hashValue(for: self) + } } extension AttributeGraph.AnyWeakAttribute: CustomStringConvertible { - @_alwaysEmitIntoClient - public var description: String { - attribute?.description ?? "nil" - } + @_alwaysEmitIntoClient + public var description: String { + attribute?.description ?? "nil" + } } - // MARK: - WeakAttribute @frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - @usableFromInline - internal var base: AnyWeakAttribute - @_alwaysEmitIntoClient - public init(base: AnyWeakAttribute) { self.base = base } - public init() - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public var wrappedValue: Value? { get } - public var projectedValue: AttributeGraph.Attribute?{ get set } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { get } - public var attribute: AttributeGraph.Attribute? { get set _modify } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? + @usableFromInline + internal var base: AnyWeakAttribute + @_alwaysEmitIntoClient + public init(base: AnyWeakAttribute) { self.base = base } + public init() + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public var wrappedValue: Value? { get } + public var projectedValue: AttributeGraph.Attribute? { get set } + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { + get + } + public var attribute: AttributeGraph.Attribute? { get set _modify } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? } extension AttributeGraph.WeakAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.WeakAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - OptionalAttribute @frozen public struct AnyOptionalAttribute { - public init() - public init(_ attribute: AnyAttribute) - public init(_ attribute: AnyAttribute?) - public init(_ attribute: AttributeGraph.OptionalAttribute) - public var identifier: AnyAttribute - public static var current: AttributeGraph.AnyOptionalAttribute { get } - public var attribute: AnyAttribute? { get set } - public func map(_ body: (AnyAttribute) -> Value) -> Value? - public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute + public init() + public init(_ attribute: AnyAttribute) + public init(_ attribute: AnyAttribute?) + public init(_ attribute: AttributeGraph.OptionalAttribute) + public var identifier: AnyAttribute + public static var current: AttributeGraph.AnyOptionalAttribute { get } + public var attribute: AnyAttribute? { get set } + public func map(_ body: (AnyAttribute) -> Value) -> Value? + public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute } extension AttributeGraph.AnyOptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.AnyOptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } @frozen @propertyWrapper @dynamicMemberLookup public struct OptionalAttribute { - public var base: AttributeGraph.AnyOptionalAttribute - public init() - public init(base: AttributeGraph.AnyOptionalAttribute) - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public var attribute: AttributeGraph.Attribute? { get set } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? - public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? - public var wrappedValue: Value? { get } - public var projectedValue: Attribute? { get set _modify } - public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } + public var base: AttributeGraph.AnyOptionalAttribute + public init() + public init(base: AttributeGraph.AnyOptionalAttribute) + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public init(_ weakAttribute: AttributeGraph.WeakAttribute) + public var attribute: AttributeGraph.Attribute? { get set } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? + public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? + public var wrappedValue: Value? { get } + public var projectedValue: Attribute? { get set _modify } + public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } } extension AttributeGraph.OptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - IndirectAttribute @@ -257,36 +269,37 @@ extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { - public let identifier: AnyAttribute - public init(source: AttributeGraph.Attribute) - public var source: AttributeGraph.Attribute { - get - nonmutating set - nonmutating _modify - } - public var dependency: AnyAttribute? { - get - nonmutating set - } - public var value: Value { - get - nonmutating set - nonmutating _modify - } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public var wrappedValue: Value { - get - nonmutating set - nonmutating _modify - } - public var projectedValue: AttributeGraph.Attribute { get } - public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } + public let identifier: AnyAttribute + public init(source: AttributeGraph.Attribute) + public var source: AttributeGraph.Attribute { + get + nonmutating set + nonmutating _modify + } + public var dependency: AnyAttribute? { + get + nonmutating set + } + public var value: Value { + get + nonmutating set + nonmutating _modify + } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public var wrappedValue: Value { + get + nonmutating set + nonmutating _modify + } + public var projectedValue: AttributeGraph.Attribute { get } + public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } } extension AttributeGraph.IndirectAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } // MARK: - _AttributeBody @@ -317,17 +330,17 @@ public protocol AttributeBodyVisitor { @frozen public struct External { - public init() + public init() } extension AttributeGraph.External: AttributeGraph._AttributeBody { - public static var comparisonMode: AGComparisonMode { get } - public static var flags: AGAttributeTypeFlags { get } - public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static var comparisonMode: AGComparisonMode { get } + public static var flags: AGAttributeTypeFlags { get } + public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) } extension AttributeGraph.External: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - Focus @@ -336,28 +349,28 @@ extension AttributeGraph.External: Swift.CustomStringConvertible { public struct Focus { public var root: Attribute public var keyPath: KeyPath - + public init(root: Attribute, keyPath: KeyPath) } extension AttributeGraph.Focus: AttributeGraph.Rule { - public var value: Self.Value { get } - public static var flags: AGAttributeTypeFlags { get } + public var value: Self.Value { get } + public static var flags: AGAttributeTypeFlags { get } } extension AttributeGraph.Focus: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - ObservedAttribute public protocol ObservedAttribute: AttributeGraph._AttributeBody { - func destroy() + func destroy() } extension AttributeGraph.ObservedAttribute { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { get } + public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) + public static var _hasDestroySelf: Swift.Bool { get } } // MARK: - Graph Related @@ -365,65 +378,69 @@ extension AttributeGraph.ObservedAttribute { // MARK: - AGGraph extension AttributeGraph.AGGraph { - public static func typeIndex( - ctx: AGGraphContext, - body: AttributeGraph._AttributeBody.Type, - valueType: Metadata, - flags: AGAttributeTypeFlags, - update: AttributeUpdateBlock - ) -> Int + public static func typeIndex( + ctx: AGUnownedGraphRef, + body: AttributeGraph._AttributeBody.Type, + valueType: Metadata, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) -> Int } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphStartProfiling") - public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStartProfiling") + public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) - @_silgen_name("AGGraphStopProfiling") - public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStopProfiling") + public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphSetInvalidationCallback") - public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) + @_silgen_name("AGGraphSetInvalidationCallback") + public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) - @_silgen_name("AGGraphSetUpdateCallback") - public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) + @_silgen_name("AGGraphSetUpdateCallback") + public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) } extension AttributeGraph.AGGraph { - @_transparent - @inline(__always) - public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: ._10)) } + @_transparent + @inline(__always) + public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: .mainThreadUpdateCount)) } } extension AttributeGraph.AGGraph { - public static func withoutUpdate(_ body: () -> Value) -> Value + public static func withoutUpdate(_ body: () -> Value) -> Value } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphGetOutputValue") - @inline(__always) - @inlinable - public static func outputValue() -> Swift.UnsafePointer? + @_silgen_name("AGGraphGetOutputValue") + @inline(__always) + @inlinable + public static func outputValue() -> Swift.UnsafePointer? - @_silgen_name("AGGraphSetOutputValue") - @inline(__always) - @inlinable - public static func setOutputValue(_ value: Swift.UnsafePointer) + @_silgen_name("AGGraphSetOutputValue") + @inline(__always) + @inlinable + public static func setOutputValue(_ value: Swift.UnsafePointer) } // MARK: - AGSubgraph extension AttributeGraph.AGSubgraph { - public func addObserver(_ observer: () -> Void) -> Swift.Int - public func apply(_ body: () -> Value) -> Value - public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) + public func addObserver(_ observer: () -> Void) -> Swift.Int + public func apply(_ body: () -> Value) -> Value + public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) } extension AttributeGraph.AGSubgraph { - public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) - public static func endTreeElement(value: AttributeGraph.Attribute) - public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) + public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) + public static func endTreeElement(value: AttributeGraph.Attribute) + public static func addTreeValue( + _ value: AttributeGraph.Attribute, + forKey key: Swift.UnsafePointer, + flags: Swift.UInt32 + ) } // MARK: - Rule Related @@ -438,97 +455,114 @@ public protocol Rule: AttributeGraph._AttributeBody { extension AttributeGraph.Rule { public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.Rule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } } extension AttributeGraph.Rule where Self: Swift.Hashable { - public func cachedValueIfExists( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value? + public func cachedValueIfExists( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value? - public func cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value + public func cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value - public static func _cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute?, - hashValue: Swift.Int, - bodyPtr: Swift.UnsafeRawPointer, - update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> () - ) -> Swift.UnsafePointer + public static func _cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute?, + hashValue: Swift.Int, + bodyPtr: Swift.UnsafeRawPointer, + update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void + ) -> Swift.UnsafePointer } // MARK: - StateRule public protocol StatefulRule: AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Value? { get } - mutating func updateValue() + associatedtype Value + static var initialValue: Value? { get } + mutating func updateValue() } extension AttributeGraph.StatefulRule { - public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static var initialValue: Self.Value? { get } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.StatefulRule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool { get } } // MARK: - RuleContext @frozen public struct RuleContext { - public var attribute: AttributeGraph.Attribute - public init(attribute: AttributeGraph.Attribute) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) + public var attribute: AttributeGraph.Attribute + public init(attribute: AttributeGraph.Attribute) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) } // MARK: - AnyRuleContext @frozen public struct AnyRuleContext { - public var attribute: AnyAttribute - public init(attribute: AnyAttribute) - public init(_ context: AttributeGraph.RuleContext) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) - public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext + public var attribute: AnyAttribute + public init(attribute: AnyAttribute) + public init(_ context: AttributeGraph.RuleContext) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) + public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext } // MARK: - Runtime Related // MARK: - CompareValues -public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = ._3) -> Swift.Bool +extension AGComparisonOptions { + public init(mode: AGComparisonMode) +} + +public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = .equatableAlways) -> Swift.Bool public func compareValues(_ lhs: A, _ rhs: A, options: AGComparisonOptions) -> Swift.Bool // MARK: - Metadata +public func forEachField( + of type: Any.Type, + do body: (UnsafePointer, Int, Any.Type) -> Void +) + extension Metadata: Swift.CustomStringConvertible { public init(_ type: Any.Type) public var type: Any.Type { get } @@ -539,83 +573,97 @@ extension Metadata: Swift.CustomStringConvertible { ) -> Bool } +// MARK: - Signature + +extension Signature: Swift.Equatable {} + // MARK: - TupleType extension TupleType { - @_transparent + @_transparent public init(_ types: [Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) } - - @_transparent + + @_transparent public init(_ type: Any.Type) { - self.init(rawValue: unsafeBitCast(type, to: UnsafePointer<_Metadata>.self)) + self.init(rawValue: unsafeBitCast(type, to: OpaquePointer.self)) } - - @_transparent + + @_transparent public var isEmpty: Bool { count == 0 } - @_transparent - public var indices: Range { 0 ..< count } - - @_transparent + @_transparent + public var indices: Range { 0.. Any.Type { elementType(at: index).type } - - @_transparent + + @_transparent public func offset(at index: Int, as type: T.Type) -> Int { elementOffset(at: index, type: Metadata(type)) } - - @_transparent - public func setElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, from srcValue: UnsafePointer, options: CopyOptions) { + + @_transparent + public func setElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + from srcValue: UnsafePointer, + options: CopyOptions + ) { __AGTupleSetElement(self, tupleValue, index, srcValue, Metadata(T.self), options) } - - @_transparent - public func getElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, to dstValue: UnsafeMutablePointer, options: CopyOptions) { + + @_transparent + public func getElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + to dstValue: UnsafeMutablePointer, + options: CopyOptions + ) { __AGTupleGetElement(self, tupleValue, index, dstValue, Metadata(T.self), options) } } @_silgen_name("AGTupleWithBuffer") -public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> ()) +public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> Void) // MARK: - UnsafeTuple extension UnsafeTuple { - @_transparent + @_transparent public var count: Int { type.count } - - @_transparent - public var isEmpty: Bool { type.isEmpty } - - @_transparent - public var indices: Range { type.indices } - - @_transparent + + @_transparent + public var isEmpty: Bool { type.isEmpty } + + @_transparent + public var indices: Range { type.indices } + + @_transparent public func address(as _: T.Type = T.self) -> UnsafePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { address(of: index, as: T.self) } } @@ -630,61 +678,61 @@ extension UnsafeTuple { /*private*/ public func slowDealloc(_ ptr: UnsafeMutableRawPointer, _ size: Int, _ alignMask: Int) extension UnsafeMutableTuple { - @_transparent + @_transparent public init(with tupleType: TupleType) { self.init(type: tupleType, value: slowAlloc(tupleType.size, -1)) } - @_transparent + @_transparent public func initialize(at index: Int, to element: T) { withUnsafePointer(to: element) { elementPointer in type.setElement(in: value, at: index, from: elementPointer, options: .initCopy) } } - @_transparent + @_transparent public func deinitialize() { type.destroy(value) } - @_transparent + @_transparent public func deinitialize(at index: Int) { type.destroy(value, at: index) } - @_transparent + @_transparent public func deallocate(initialized: Bool) { if initialized { deinitialize() } slowDealloc(value, -1, -1) - } - @_transparent + } + @_transparent public var count: Int { type.count } - @_transparent + @_transparent public var isEmpty: Bool { type.isEmpty } - @_transparent + @_transparent public var indices: Range { type.indices } - - @_transparent + + @_transparent public func address(as _: T.Type = T.self) -> UnsafeMutablePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafeMutablePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { UnsafePointer(address(as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { UnsafePointer(address(of: index, as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(of: index, as: T.self) } @@ -724,30 +772,41 @@ public func AGTypeApplyFields2( @frozen public struct PointerOffset { - public var byteOffset: Swift.Int - public init(byteOffset: Swift.Int) + public var byteOffset: Swift.Int + public init(byteOffset: Swift.Int) } extension AttributeGraph.PointerOffset { - public static func + (_ lhs: AttributeGraph.PointerOffset, _ rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset + public static func + ( + _ lhs: AttributeGraph.PointerOffset, + _ rhs: AttributeGraph.PointerOffset + ) -> AttributeGraph.PointerOffset } extension AttributeGraph.PointerOffset { - public static func invalidScenePointer() -> Swift.UnsafeMutablePointer - public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset - public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset + public static func invalidScenePointer() -> Swift.UnsafeMutablePointer + public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset + public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset< + Base, Member + > } extension AttributeGraph.PointerOffset where Base == Member { - public init() + public init() } extension Swift.UnsafePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - } - public static func + (_ lhs: Swift.UnsafePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + } + public static func + ( + _ lhs: Swift.UnsafePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafePointer } extension Swift.UnsafeMutablePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - nonmutating unsafeMutableAddress - } - public static func + (_ lhs: Swift.UnsafeMutablePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + nonmutating unsafeMutableAddress + } + public static func + ( + _ lhs: Swift.UnsafeMutablePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafeMutablePointer } diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64e-apple-ios.swiftinterface b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64e-apple-ios.swiftinterface index 168aa6d..c42a5ca 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64e-apple-ios.swiftinterface +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64e-apple-ios.swiftinterface @@ -1,6 +1,6 @@ // swift-interface-format-version: 1.0 -// swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) -// swift-module-flags: -target arm64e-apple-ios11.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name AttributeGraph +// swift-compiler-version: Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3) +// swift-module-flags: -target arm64e-apple-ios11.0 -enable-objc-interop -enable-library-evolution -swift-version 6 -enforce-exclusivity=checked -O -module-name AttributeGraph // swift-module-flags-ignorable: -enable-bare-slash-regex @_exported import AttributeGraph import Foundation @@ -13,27 +13,27 @@ import _StringProcessing // MARK: - AnyAttribute extension AttributeGraph.AnyAttribute { - public init(_ attribute: AttributeGraph.Attribute) - public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute - public static var current: AnyAttribute? { get } - public func unsafeOffset(at offset: Int) -> AnyAttribute - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - public func visitBody(_ visitor: inout Visitor); - public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> ()) - public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var _bodyType: Any.Type { get } - public var _bodyPointer: UnsafeRawPointer { get } - public var valueType: Any.Type { get } - public var indirectDependency: AnyAttribute? { - get - nonmutating set - } + public init(_ attribute: AttributeGraph.Attribute) + public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute + public static var current: AnyAttribute? { get } + public func unsafeOffset(at offset: Int) -> AnyAttribute + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + public func visitBody(_ visitor: inout Visitor) + public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + public var _bodyType: Any.Type { get } + public var _bodyPointer: UnsafeRawPointer { get } + public var valueType: Any.Type { get } + public var indirectDependency: AnyAttribute? { + get + nonmutating set + } } extension AttributeGraph.AnyAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } public typealias AttributeUpdateBlock = () -> ((Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void) @@ -48,66 +48,74 @@ public struct Attribute { public init(identifier: AnyAttribute) public init(_ attribute: AttributeGraph.Attribute) - public init(value: Value) - public init(type: Value.Type) - public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: AGAttributeTypeFlags, update: AttributeUpdateBlock) - public var wrappedValue: Value { - unsafeAddress - nonmutating set - } - public var projectedValue: AttributeGraph.Attribute { get set } - + public init(value: Value) + public init(type: Value.Type) + public init( + body: Swift.UnsafePointer, + value: Swift.UnsafePointer?, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) + public var wrappedValue: Value { + unsafeAddress + nonmutating set + } + public var projectedValue: AttributeGraph.Attribute { get set } + public subscript(dynamicMember _: Swift.KeyPath) -> AttributeGraph.Attribute { get } public subscript(keyPath _: Swift.KeyPath) -> AttributeGraph.Attribute { get } - public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) -> AttributeGraph.Attribute { get } - - public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute - public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute - public func applying(offset: AttributeGraph.PointerOffset) -> AttributeGraph.Attribute - public func visitBody(_ visitor: inout Body) - public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) - public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - - public var graph: AGGraph { get } - public var subgraph: AGSubgraph { get } - - public var value: Value { - unsafeAddress - nonmutating set - } - public var valueState: AGValueState { get } - public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public func setValue(_ value: Value) -> Bool - public var hasValue: Bool { get } - public func updateValue() - public func prefetchValue() - public func invalidateValue() - public func validate() - - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - - public var flags: AGAttributeFlags { - get - nonmutating set - } - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + { get } + + public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute + public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute + public func applying(offset: AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + public func visitBody(_ visitor: inout Body) + public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + + public var graph: AGGraph { get } + public var subgraph: AGSubgraph { get } + + public var value: Value { + unsafeAddress + nonmutating set + } + public var valueState: AGValueState { get } + public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public func setValue(_ value: Value) -> Bool + public var hasValue: Bool { get } + public func updateValue() + public func prefetchValue() + public func invalidateValue() + public func validate() + + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + + public var flags: AGAttributeFlags { + get + nonmutating set + } + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) } extension AttributeGraph.Attribute: Swift.Hashable { public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool + public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool public var hashValue: Swift.Int { get } } extension AttributeGraph.Attribute: Swift.CustomStringConvertible { - public var description: String { get } + public var description: String { get } } extension AttributeGraph.Attribute { - public init(_ rule: R) where R.Value == Value - public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value } // MARK: - AnyWeakAttribute @@ -115,140 +123,144 @@ extension AttributeGraph.Attribute { public typealias AnyWeakAttribute = AGWeakAttribute extension AttributeGraph.AnyWeakAttribute { - @_alwaysEmitIntoClient - public init(_ attribute: AnyAttribute?) { - self = __AGCreateWeakAttribute(attribute ?? .nil) - } - - @_alwaysEmitIntoClient - public init(_ weakAttribute: AttributeGraph.WeakAttribute) { - self = weakAttribute.base - } - - @_alwaysEmitIntoClient - public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { - WeakAttribute(base: self) - } - - @_alwaysEmitIntoClient - public var attribute: AnyAttribute? { - get { - let attribute = __AGWeakAttributeGetAttribute(self) - return attribute == .nil ? nil : attribute - } - set { - self = AnyWeakAttribute(newValue) - } - } + @_alwaysEmitIntoClient + public init(_ attribute: AnyAttribute?) { + self = __AGCreateWeakAttribute(attribute ?? .nil) + } + + @_alwaysEmitIntoClient + public init(_ weakAttribute: AttributeGraph.WeakAttribute) { + self = weakAttribute.base + } + + @_alwaysEmitIntoClient + public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { + WeakAttribute(base: self) + } + + @_alwaysEmitIntoClient + public var attribute: AnyAttribute? { + get { + let attribute = __AGWeakAttributeGetAttribute(self) + return attribute == .nil ? nil : attribute + } + set { + self = AnyWeakAttribute(newValue) + } + } } extension AttributeGraph.AnyWeakAttribute: Hashable { - @_alwaysEmitIntoClient - public func hash(into hasher: inout Swift.Hasher) { - hasher.combine(raw_attribute) - hasher.combine(subgraph_id) - } + @_alwaysEmitIntoClient + public func hash(into hasher: inout Swift.Hasher) { + hasher.combine(raw_attribute) + hasher.combine(subgraph_id) + } - @_alwaysEmitIntoClient - public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { - lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id - } + @_alwaysEmitIntoClient + public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { + lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id + } - @_alwaysEmitIntoClient - public var hashValue: Int { - _hashValue(for: self) - } + @_alwaysEmitIntoClient + public var hashValue: Int { + _hashValue(for: self) + } } extension AttributeGraph.AnyWeakAttribute: CustomStringConvertible { - @_alwaysEmitIntoClient - public var description: String { - attribute?.description ?? "nil" - } + @_alwaysEmitIntoClient + public var description: String { + attribute?.description ?? "nil" + } } - // MARK: - WeakAttribute @frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - @usableFromInline - internal var base: AnyWeakAttribute - @_alwaysEmitIntoClient - public init(base: AnyWeakAttribute) { self.base = base } - public init() - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public var wrappedValue: Value? { get } - public var projectedValue: AttributeGraph.Attribute?{ get set } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { get } - public var attribute: AttributeGraph.Attribute? { get set _modify } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? + @usableFromInline + internal var base: AnyWeakAttribute + @_alwaysEmitIntoClient + public init(base: AnyWeakAttribute) { self.base = base } + public init() + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public var wrappedValue: Value? { get } + public var projectedValue: AttributeGraph.Attribute? { get set } + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { + get + } + public var attribute: AttributeGraph.Attribute? { get set _modify } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? } extension AttributeGraph.WeakAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.WeakAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - OptionalAttribute @frozen public struct AnyOptionalAttribute { - public init() - public init(_ attribute: AnyAttribute) - public init(_ attribute: AnyAttribute?) - public init(_ attribute: AttributeGraph.OptionalAttribute) - public var identifier: AnyAttribute - public static var current: AttributeGraph.AnyOptionalAttribute { get } - public var attribute: AnyAttribute? { get set } - public func map(_ body: (AnyAttribute) -> Value) -> Value? - public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute + public init() + public init(_ attribute: AnyAttribute) + public init(_ attribute: AnyAttribute?) + public init(_ attribute: AttributeGraph.OptionalAttribute) + public var identifier: AnyAttribute + public static var current: AttributeGraph.AnyOptionalAttribute { get } + public var attribute: AnyAttribute? { get set } + public func map(_ body: (AnyAttribute) -> Value) -> Value? + public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute } extension AttributeGraph.AnyOptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.AnyOptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } @frozen @propertyWrapper @dynamicMemberLookup public struct OptionalAttribute { - public var base: AttributeGraph.AnyOptionalAttribute - public init() - public init(base: AttributeGraph.AnyOptionalAttribute) - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public var attribute: AttributeGraph.Attribute? { get set } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? - public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? - public var wrappedValue: Value? { get } - public var projectedValue: Attribute? { get set _modify } - public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } + public var base: AttributeGraph.AnyOptionalAttribute + public init() + public init(base: AttributeGraph.AnyOptionalAttribute) + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public init(_ weakAttribute: AttributeGraph.WeakAttribute) + public var attribute: AttributeGraph.Attribute? { get set } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? + public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? + public var wrappedValue: Value? { get } + public var projectedValue: Attribute? { get set _modify } + public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } } extension AttributeGraph.OptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - IndirectAttribute @@ -257,36 +269,37 @@ extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { - public let identifier: AnyAttribute - public init(source: AttributeGraph.Attribute) - public var source: AttributeGraph.Attribute { - get - nonmutating set - nonmutating _modify - } - public var dependency: AnyAttribute? { - get - nonmutating set - } - public var value: Value { - get - nonmutating set - nonmutating _modify - } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public var wrappedValue: Value { - get - nonmutating set - nonmutating _modify - } - public var projectedValue: AttributeGraph.Attribute { get } - public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } + public let identifier: AnyAttribute + public init(source: AttributeGraph.Attribute) + public var source: AttributeGraph.Attribute { + get + nonmutating set + nonmutating _modify + } + public var dependency: AnyAttribute? { + get + nonmutating set + } + public var value: Value { + get + nonmutating set + nonmutating _modify + } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public var wrappedValue: Value { + get + nonmutating set + nonmutating _modify + } + public var projectedValue: AttributeGraph.Attribute { get } + public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } } extension AttributeGraph.IndirectAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } // MARK: - _AttributeBody @@ -317,17 +330,17 @@ public protocol AttributeBodyVisitor { @frozen public struct External { - public init() + public init() } extension AttributeGraph.External: AttributeGraph._AttributeBody { - public static var comparisonMode: AGComparisonMode { get } - public static var flags: AGAttributeTypeFlags { get } - public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static var comparisonMode: AGComparisonMode { get } + public static var flags: AGAttributeTypeFlags { get } + public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) } extension AttributeGraph.External: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - Focus @@ -336,28 +349,28 @@ extension AttributeGraph.External: Swift.CustomStringConvertible { public struct Focus { public var root: Attribute public var keyPath: KeyPath - + public init(root: Attribute, keyPath: KeyPath) } extension AttributeGraph.Focus: AttributeGraph.Rule { - public var value: Self.Value { get } - public static var flags: AGAttributeTypeFlags { get } + public var value: Self.Value { get } + public static var flags: AGAttributeTypeFlags { get } } extension AttributeGraph.Focus: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - ObservedAttribute public protocol ObservedAttribute: AttributeGraph._AttributeBody { - func destroy() + func destroy() } extension AttributeGraph.ObservedAttribute { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { get } + public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) + public static var _hasDestroySelf: Swift.Bool { get } } // MARK: - Graph Related @@ -365,65 +378,69 @@ extension AttributeGraph.ObservedAttribute { // MARK: - AGGraph extension AttributeGraph.AGGraph { - public static func typeIndex( - ctx: AGGraphContext, - body: AttributeGraph._AttributeBody.Type, - valueType: Metadata, - flags: AGAttributeTypeFlags, - update: AttributeUpdateBlock - ) -> Int + public static func typeIndex( + ctx: AGUnownedGraphRef, + body: AttributeGraph._AttributeBody.Type, + valueType: Metadata, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) -> Int } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphStartProfiling") - public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStartProfiling") + public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) - @_silgen_name("AGGraphStopProfiling") - public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStopProfiling") + public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphSetInvalidationCallback") - public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) + @_silgen_name("AGGraphSetInvalidationCallback") + public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) - @_silgen_name("AGGraphSetUpdateCallback") - public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) + @_silgen_name("AGGraphSetUpdateCallback") + public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) } extension AttributeGraph.AGGraph { - @_transparent - @inline(__always) - public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: ._10)) } + @_transparent + @inline(__always) + public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: .mainThreadUpdateCount)) } } extension AttributeGraph.AGGraph { - public static func withoutUpdate(_ body: () -> Value) -> Value + public static func withoutUpdate(_ body: () -> Value) -> Value } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphGetOutputValue") - @inline(__always) - @inlinable - public static func outputValue() -> Swift.UnsafePointer? + @_silgen_name("AGGraphGetOutputValue") + @inline(__always) + @inlinable + public static func outputValue() -> Swift.UnsafePointer? - @_silgen_name("AGGraphSetOutputValue") - @inline(__always) - @inlinable - public static func setOutputValue(_ value: Swift.UnsafePointer) + @_silgen_name("AGGraphSetOutputValue") + @inline(__always) + @inlinable + public static func setOutputValue(_ value: Swift.UnsafePointer) } // MARK: - AGSubgraph extension AttributeGraph.AGSubgraph { - public func addObserver(_ observer: () -> Void) -> Swift.Int - public func apply(_ body: () -> Value) -> Value - public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) + public func addObserver(_ observer: () -> Void) -> Swift.Int + public func apply(_ body: () -> Value) -> Value + public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) } extension AttributeGraph.AGSubgraph { - public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) - public static func endTreeElement(value: AttributeGraph.Attribute) - public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) + public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) + public static func endTreeElement(value: AttributeGraph.Attribute) + public static func addTreeValue( + _ value: AttributeGraph.Attribute, + forKey key: Swift.UnsafePointer, + flags: Swift.UInt32 + ) } // MARK: - Rule Related @@ -438,97 +455,114 @@ public protocol Rule: AttributeGraph._AttributeBody { extension AttributeGraph.Rule { public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.Rule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } } extension AttributeGraph.Rule where Self: Swift.Hashable { - public func cachedValueIfExists( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value? + public func cachedValueIfExists( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value? - public func cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value + public func cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value - public static func _cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute?, - hashValue: Swift.Int, - bodyPtr: Swift.UnsafeRawPointer, - update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> () - ) -> Swift.UnsafePointer + public static func _cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute?, + hashValue: Swift.Int, + bodyPtr: Swift.UnsafeRawPointer, + update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void + ) -> Swift.UnsafePointer } // MARK: - StateRule public protocol StatefulRule: AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Value? { get } - mutating func updateValue() + associatedtype Value + static var initialValue: Value? { get } + mutating func updateValue() } extension AttributeGraph.StatefulRule { - public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static var initialValue: Self.Value? { get } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.StatefulRule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool { get } } // MARK: - RuleContext @frozen public struct RuleContext { - public var attribute: AttributeGraph.Attribute - public init(attribute: AttributeGraph.Attribute) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) + public var attribute: AttributeGraph.Attribute + public init(attribute: AttributeGraph.Attribute) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) } // MARK: - AnyRuleContext @frozen public struct AnyRuleContext { - public var attribute: AnyAttribute - public init(attribute: AnyAttribute) - public init(_ context: AttributeGraph.RuleContext) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) - public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext + public var attribute: AnyAttribute + public init(attribute: AnyAttribute) + public init(_ context: AttributeGraph.RuleContext) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) + public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext } // MARK: - Runtime Related // MARK: - CompareValues -public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = ._3) -> Swift.Bool +extension AGComparisonOptions { + public init(mode: AGComparisonMode) +} + +public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = .equatableAlways) -> Swift.Bool public func compareValues(_ lhs: A, _ rhs: A, options: AGComparisonOptions) -> Swift.Bool // MARK: - Metadata +public func forEachField( + of type: Any.Type, + do body: (UnsafePointer, Int, Any.Type) -> Void +) + extension Metadata: Swift.CustomStringConvertible { public init(_ type: Any.Type) public var type: Any.Type { get } @@ -539,83 +573,97 @@ extension Metadata: Swift.CustomStringConvertible { ) -> Bool } +// MARK: - Signature + +extension Signature: Swift.Equatable {} + // MARK: - TupleType extension TupleType { - @_transparent + @_transparent public init(_ types: [Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) } - - @_transparent + + @_transparent public init(_ type: Any.Type) { - self.init(rawValue: unsafeBitCast(type, to: UnsafePointer<_Metadata>.self)) + self.init(rawValue: unsafeBitCast(type, to: OpaquePointer.self)) } - - @_transparent + + @_transparent public var isEmpty: Bool { count == 0 } - @_transparent - public var indices: Range { 0 ..< count } - - @_transparent + @_transparent + public var indices: Range { 0.. Any.Type { elementType(at: index).type } - - @_transparent + + @_transparent public func offset(at index: Int, as type: T.Type) -> Int { elementOffset(at: index, type: Metadata(type)) } - - @_transparent - public func setElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, from srcValue: UnsafePointer, options: CopyOptions) { + + @_transparent + public func setElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + from srcValue: UnsafePointer, + options: CopyOptions + ) { __AGTupleSetElement(self, tupleValue, index, srcValue, Metadata(T.self), options) } - - @_transparent - public func getElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, to dstValue: UnsafeMutablePointer, options: CopyOptions) { + + @_transparent + public func getElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + to dstValue: UnsafeMutablePointer, + options: CopyOptions + ) { __AGTupleGetElement(self, tupleValue, index, dstValue, Metadata(T.self), options) } } @_silgen_name("AGTupleWithBuffer") -public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> ()) +public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> Void) // MARK: - UnsafeTuple extension UnsafeTuple { - @_transparent + @_transparent public var count: Int { type.count } - - @_transparent - public var isEmpty: Bool { type.isEmpty } - - @_transparent - public var indices: Range { type.indices } - - @_transparent + + @_transparent + public var isEmpty: Bool { type.isEmpty } + + @_transparent + public var indices: Range { type.indices } + + @_transparent public func address(as _: T.Type = T.self) -> UnsafePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { address(of: index, as: T.self) } } @@ -630,61 +678,61 @@ extension UnsafeTuple { /*private*/ public func slowDealloc(_ ptr: UnsafeMutableRawPointer, _ size: Int, _ alignMask: Int) extension UnsafeMutableTuple { - @_transparent + @_transparent public init(with tupleType: TupleType) { self.init(type: tupleType, value: slowAlloc(tupleType.size, -1)) } - @_transparent + @_transparent public func initialize(at index: Int, to element: T) { withUnsafePointer(to: element) { elementPointer in type.setElement(in: value, at: index, from: elementPointer, options: .initCopy) } } - @_transparent + @_transparent public func deinitialize() { type.destroy(value) } - @_transparent + @_transparent public func deinitialize(at index: Int) { type.destroy(value, at: index) } - @_transparent + @_transparent public func deallocate(initialized: Bool) { if initialized { deinitialize() } slowDealloc(value, -1, -1) - } - @_transparent + } + @_transparent public var count: Int { type.count } - @_transparent + @_transparent public var isEmpty: Bool { type.isEmpty } - @_transparent + @_transparent public var indices: Range { type.indices } - - @_transparent + + @_transparent public func address(as _: T.Type = T.self) -> UnsafeMutablePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafeMutablePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { UnsafePointer(address(as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { UnsafePointer(address(of: index, as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(of: index, as: T.self) } @@ -724,30 +772,41 @@ public func AGTypeApplyFields2( @frozen public struct PointerOffset { - public var byteOffset: Swift.Int - public init(byteOffset: Swift.Int) + public var byteOffset: Swift.Int + public init(byteOffset: Swift.Int) } extension AttributeGraph.PointerOffset { - public static func + (_ lhs: AttributeGraph.PointerOffset, _ rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset + public static func + ( + _ lhs: AttributeGraph.PointerOffset, + _ rhs: AttributeGraph.PointerOffset + ) -> AttributeGraph.PointerOffset } extension AttributeGraph.PointerOffset { - public static func invalidScenePointer() -> Swift.UnsafeMutablePointer - public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset - public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset + public static func invalidScenePointer() -> Swift.UnsafeMutablePointer + public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset + public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset< + Base, Member + > } extension AttributeGraph.PointerOffset where Base == Member { - public init() + public init() } extension Swift.UnsafePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - } - public static func + (_ lhs: Swift.UnsafePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + } + public static func + ( + _ lhs: Swift.UnsafePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafePointer } extension Swift.UnsafeMutablePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - nonmutating unsafeMutableAddress - } - public static func + (_ lhs: Swift.UnsafeMutablePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + nonmutating unsafeMutableAddress + } + public static func + ( + _ lhs: Swift.UnsafeMutablePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafeMutablePointer } diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGAttributeType.h b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGAttributeType.h index 4229ac2..0579f04 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGAttributeType.h +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGAttributeType.h @@ -1,6 +1,6 @@ // // AGAttributeType.h -// +// // // Created by Kyle on 2024/2/17. // @@ -8,15 +8,35 @@ #ifndef AGAttributeType_h #define AGAttributeType_h +#include "AGAttributeTypeFlags.h" #include "AGBase.h" #include "AGTypeID.h" AG_ASSUME_NONNULL_BEGIN +typedef struct AGClosureStorage { + void *function; + void *context; +} AGClosureStorage; + +typedef struct AGAttributeVTable { +} AGAttributeVTable; + typedef struct AGAttributeType { AGTypeID typeID; AGTypeID valueTypeID; - // TODO + + AGClosureStorage updateClosure; + + AGAttributeVTable *_Nullable callbacks; + AGAttributeTypeFlags flags; + + // set after construction + uint32_t offset; + const unsigned char *_Nullable layout; + + AGTypeID initialTypeID; + void *initialBodyTypeID; } AGAttributeType; AG_ASSUME_NONNULL_END diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGCompareValues.h b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGCompareValues.h index 2fc6604..398c60b 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGCompareValues.h +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGCompareValues.h @@ -12,9 +12,15 @@ #include "AGComparisonMode.h" AG_EXTERN_C_BEGIN + AG_EXPORT AG_REFINED_FOR_SWIFT bool AGCompareValues(const void *lhs, const void *rhs, const void *type, const AGComparisonMode comparisonMode); + +AG_EXPORT +AG_REFINED_FOR_SWIFT +const unsigned char *_Nullable AGPrefetchCompareValues(AGTypeID type, AGComparisonOptions options, uint32_t priority); + AG_EXTERN_C_END #endif /* AGCompareValues_h */ diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGComparisonMode.h b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGComparisonMode.h index b4a5b9f..ec83f07 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGComparisonMode.h +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGComparisonMode.h @@ -10,19 +10,19 @@ #include "AGBase.h" -typedef AG_OPTIONS(uint32_t, AGComparisonMode) { - AGComparisonMode_0 = 0, - AGComparisonMode_1 = 1 << 0, - AGComparisonMode_2 = 1 << 1, - AGComparisonMode_3 = AGComparisonMode_1 | AGComparisonMode_2, +typedef AG_ENUM(uint8_t, AGComparisonMode){ + AGComparisonModeBitwise = 0, + AGComparisonModeIndirect = 1, + AGComparisonModeEquatableUnlessPOD = 2, + AGComparisonModeEquatableAlways = 3, }; -typedef AG_OPTIONS(uint32_t, AGComparisonOptions) { - AGComparisonOptions_0 = 0, - AGComparisonOptions_1 = 1 << 0, - AGComparisonOptions_2 = 1 << 1, - AGComparisonOptions_3 = AGComparisonOptions_1 | AGComparisonOptions_2, +typedef AG_OPTIONS(uint32_t, AGComparisonOptions){ + AGComparisonOptionsComparisonModeMask = 0xff, + + AGComparisonOptionsCopyOnWrite = 1 << 8, + AGComparisonOptionsFetchLayoutsSynchronously = 1 << 9, + AGComparisonOptionsReportFailures = 1ul << 31, // -1 signed int }; #endif /* AGComparisonMode_h */ - diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGCounterQueryType.h b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGCounterQueryType.h deleted file mode 100644 index 2a60455..0000000 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGCounterQueryType.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// AGCounterQueryType.h -// -// -// Created by Kyle on 2024/3/8. -// - -#ifndef AGCounterQueryType_h -#define AGCounterQueryType_h - -#include "AGBase.h" - -typedef AG_ENUM(uint32_t, AGCounterQueryType) { - AGCounterQueryType_0, - AGCounterQueryType_1, - AGCounterQueryType_2, - AGCounterQueryType_3, - AGCounterQueryType_4, - AGCounterQueryType_5, - AGCounterQueryType_6, - AGCounterQueryType_7, - AGCounterQueryType_8, - AGCounterQueryType_9, - AGCounterQueryType_10, -}; - -#endif /* AGCounterQueryType_h */ diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraph.h b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraph.h index 1bd7674..65eedf4 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraph.h +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraph.h @@ -10,17 +10,19 @@ #include "AGBase.h" #include "CFRuntime.h" -#include "AGCounterQueryType.h" +#include "AGGraphCounterQuery.h" // Note: Place all structure declaration in a single place to avoid header cycle dependency typedef struct AG_BRIDGED_TYPE(id) AGGraphStorage * AGGraphRef; -typedef struct AG_BRIDGED_TYPE(id) AGGraphContextStorage * AGGraphContextRef; typedef struct AG_BRIDGED_TYPE(id) AGSubgraphStorage * AGSubgraphRef; +typedef void * AGUnownedGraphRef; +typedef struct AGGraphContextStorage * AGUnownedGraphContextRef; + struct AGGraphStorage; -struct AGGraphContextStorage; struct AGSubgraphStorage; +struct AGGraphContextStorage; typedef uint32_t AGAttribute AG_SWIFT_STRUCT AG_SWIFT_NAME(AnyAttribute); @@ -68,7 +70,7 @@ void AGGraphSetContext(AGGraphRef graph, const void * _Nullable context) AG_SWIF AG_EXPORT AG_REFINED_FOR_SWIFT -AGGraphContextRef AGGraphGetGraphContext(AGGraphRef graph) AG_SWIFT_NAME(getter:AGGraphRef.graphContext(self:)); +AGUnownedGraphRef AGGraphGetGraphContext(AGGraphRef graph) AG_SWIFT_NAME(getter:AGGraphRef.graphContext(self:)); AG_EXPORT AG_REFINED_FOR_SWIFT @@ -92,7 +94,7 @@ void AGGraphSetUpdateCallback(AGGraphRef graph, AG_EXPORT AG_REFINED_FOR_SWIFT -uint64_t AGGraphGetCounter(AGGraphRef graph, AGCounterQueryType query) AG_SWIFT_NAME(AGGraphRef.counter(self:for:)); +uint64_t AGGraphGetCounter(AGGraphRef graph, AGGraphCounterQuery query) AG_SWIFT_NAME(AGGraphRef.counter(self:for:)); AG_EXPORT AG_REFINED_FOR_SWIFT diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraphContext.h b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraphContext.h index eee32d0..4d6e84f 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraphContext.h +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraphContext.h @@ -19,7 +19,7 @@ AG_EXTERN_C_BEGIN AG_EXPORT AG_REFINED_FOR_SWIFT -AGGraphRef AGGraphContextGetGraph(AGGraphContextRef context) AG_SWIFT_NAME(getter:AGGraphContextRef.graph(self:)); +AGGraphRef AGGraphContextGetGraph(AGUnownedGraphContextRef context) AG_SWIFT_NAME(getter:AGUnownedGraphContextRef.graph(self:)); AG_EXTERN_C_END diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraphCounterQuery.h b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraphCounterQuery.h new file mode 100644 index 0000000..6fd06d3 --- /dev/null +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraphCounterQuery.h @@ -0,0 +1,30 @@ +// +// AGCounterQueryType.h +// +// +// Created by Kyle on 2024/3/8. +// + +#ifndef AGGraphCounterQuery_h +#define AGGraphCounterQuery_h + +#include "AGBase.h" + +typedef AG_ENUM(uint32_t, AGGraphCounterQuery){ + AGGraphCounterQueryNodeCount, + AGGraphCounterQueryTransactionCount, + AGGraphCounterQueryUpdateCount, + AGGraphCounterQueryChangeCount, + AGGraphCounterQueryContextID, + AGGraphCounterQueryGraphID, + AGGraphCounterQueryContextThreadUpdating, + AGGraphCounterQueryThreadUpdating, + AGGraphCounterQueryContextNeedsUpdate, + AGGraphCounterQueryNeedsUpdate, + AGGraphCounterQueryMainThreadUpdateCount, + AGGraphCounterQueryNodeTotalCount, + AGGraphCounterQuerySubgraphCount, + AGGraphCounterQuerySubgraphTotalCount, +}; + +#endif /* AGGraphCounterQuery_h */ diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGSubgraph.h b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGSubgraph.h index 8cf9f2c..461a8b2 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGSubgraph.h +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGSubgraph.h @@ -43,7 +43,7 @@ void AGSubgraphSetCurrent(_Nullable AGSubgraphRef cf_subgraph) AG_SWIFT_NAME(set AG_EXPORT AG_REFINED_FOR_SWIFT -_Nullable AGGraphContextRef AGSubgraphGetCurrentGraphContext(void) AG_SWIFT_NAME(getter:AGSubgraphRef.currentGraphContext()); +_Nullable AGUnownedGraphRef AGSubgraphGetCurrentGraphContext(void) AG_SWIFT_NAME(getter:AGSubgraphRef.currentGraphContext()); AG_EXPORT AG_REFINED_FOR_SWIFT diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGTypeID.h b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGTypeID.h index 002b5f4..585248c 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGTypeID.h +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGTypeID.h @@ -10,10 +10,7 @@ AG_ASSUME_NONNULL_BEGIN -typedef struct AG_SWIFT_NAME(_Metadata) AGSwiftMetadata { -} AGSwiftMetadata; - -typedef const AGSwiftMetadata *AGTypeID AG_SWIFT_STRUCT AG_SWIFT_NAME(Metadata); +typedef const struct AGSwiftMetadata *AGTypeID AG_SWIFT_STRUCT AG_SWIFT_NAME(Metadata); #if ATTRIBUTEGRAPH_RELEASE >= ATTRIBUTEGRAPH_RELEASE_2024 @@ -35,11 +32,11 @@ typedef AG_CLOSED_ENUM(uint32_t, AGTypeKind) { AGTypeKindMetatype, } AG_SWIFT_NAME(Metadata.Kind); -typedef AG_OPTIONS(uint32_t, AGTypeApplyOptions) { - AGTypeApplyOptions_0 = 0, - AGTypeApplyOptions_1 = 1 << 0, - AGTypeApplyOptions_2 = 1 << 1, - AGTypeApplyOptions_4 = 1 << 2, +typedef AG_OPTIONS(uint32_t, AGTypeApplyOptions){ + AGTypeApplyOptionsEnumerateStructFields = 0, + AGTypeApplyOptionsEnumerateClassFields = 1 << 0, + AGTypeApplyOptionsContinueAfterUnknownField = 1 << 1, + AGTypeApplyOptionsEnumerateEnumCases = 1 << 2, }; AG_EXTERN_C_BEGIN diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h index 5341208..eea48a1 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h @@ -8,10 +8,10 @@ #include "AGChangedValueFlags.h" #include "AGCompareValues.h" #include "AGComparisonMode.h" -#include "AGCounterQueryType.h" #include "AGDebugServer.h" #include "AGGraph.h" #include "AGGraphContext.h" +#include "AGGraphCounterQuery.h" #include "AGGraphDescription.h" #include "AGInputOptions.h" #include "AGSearchOptions.h" diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios-simulator.swiftinterface b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios-simulator.swiftinterface index 189718d..331e455 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios-simulator.swiftinterface +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios-simulator.swiftinterface @@ -1,6 +1,6 @@ // swift-interface-format-version: 1.0 -// swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) -// swift-module-flags: -target arm64-apple-ios11.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name AttributeGraph +// swift-compiler-version: Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3) +// swift-module-flags: -target arm64-apple-ios11.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 6 -enforce-exclusivity=checked -O -module-name AttributeGraph // swift-module-flags-ignorable: -enable-bare-slash-regex @_exported import AttributeGraph import Foundation @@ -13,27 +13,27 @@ import _StringProcessing // MARK: - AnyAttribute extension AttributeGraph.AnyAttribute { - public init(_ attribute: AttributeGraph.Attribute) - public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute - public static var current: AnyAttribute? { get } - public func unsafeOffset(at offset: Int) -> AnyAttribute - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - public func visitBody(_ visitor: inout Visitor); - public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> ()) - public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var _bodyType: Any.Type { get } - public var _bodyPointer: UnsafeRawPointer { get } - public var valueType: Any.Type { get } - public var indirectDependency: AnyAttribute? { - get - nonmutating set - } + public init(_ attribute: AttributeGraph.Attribute) + public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute + public static var current: AnyAttribute? { get } + public func unsafeOffset(at offset: Int) -> AnyAttribute + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + public func visitBody(_ visitor: inout Visitor) + public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + public var _bodyType: Any.Type { get } + public var _bodyPointer: UnsafeRawPointer { get } + public var valueType: Any.Type { get } + public var indirectDependency: AnyAttribute? { + get + nonmutating set + } } extension AttributeGraph.AnyAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } public typealias AttributeUpdateBlock = () -> ((Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void) @@ -48,66 +48,74 @@ public struct Attribute { public init(identifier: AnyAttribute) public init(_ attribute: AttributeGraph.Attribute) - public init(value: Value) - public init(type: Value.Type) - public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: AGAttributeTypeFlags, update: AttributeUpdateBlock) - public var wrappedValue: Value { - unsafeAddress - nonmutating set - } - public var projectedValue: AttributeGraph.Attribute { get set } - + public init(value: Value) + public init(type: Value.Type) + public init( + body: Swift.UnsafePointer, + value: Swift.UnsafePointer?, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) + public var wrappedValue: Value { + unsafeAddress + nonmutating set + } + public var projectedValue: AttributeGraph.Attribute { get set } + public subscript(dynamicMember _: Swift.KeyPath) -> AttributeGraph.Attribute { get } public subscript(keyPath _: Swift.KeyPath) -> AttributeGraph.Attribute { get } - public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) -> AttributeGraph.Attribute { get } - - public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute - public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute - public func applying(offset: AttributeGraph.PointerOffset) -> AttributeGraph.Attribute - public func visitBody(_ visitor: inout Body) - public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) - public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - - public var graph: AGGraph { get } - public var subgraph: AGSubgraph { get } - - public var value: Value { - unsafeAddress - nonmutating set - } - public var valueState: AGValueState { get } - public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public func setValue(_ value: Value) -> Bool - public var hasValue: Bool { get } - public func updateValue() - public func prefetchValue() - public func invalidateValue() - public func validate() - - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - - public var flags: AGAttributeFlags { - get - nonmutating set - } - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + { get } + + public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute + public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute + public func applying(offset: AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + public func visitBody(_ visitor: inout Body) + public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + + public var graph: AGGraph { get } + public var subgraph: AGSubgraph { get } + + public var value: Value { + unsafeAddress + nonmutating set + } + public var valueState: AGValueState { get } + public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public func setValue(_ value: Value) -> Bool + public var hasValue: Bool { get } + public func updateValue() + public func prefetchValue() + public func invalidateValue() + public func validate() + + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + + public var flags: AGAttributeFlags { + get + nonmutating set + } + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) } extension AttributeGraph.Attribute: Swift.Hashable { public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool + public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool public var hashValue: Swift.Int { get } } extension AttributeGraph.Attribute: Swift.CustomStringConvertible { - public var description: String { get } + public var description: String { get } } extension AttributeGraph.Attribute { - public init(_ rule: R) where R.Value == Value - public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value } // MARK: - AnyWeakAttribute @@ -115,140 +123,144 @@ extension AttributeGraph.Attribute { public typealias AnyWeakAttribute = AGWeakAttribute extension AttributeGraph.AnyWeakAttribute { - @_alwaysEmitIntoClient - public init(_ attribute: AnyAttribute?) { - self = __AGCreateWeakAttribute(attribute ?? .nil) - } - - @_alwaysEmitIntoClient - public init(_ weakAttribute: AttributeGraph.WeakAttribute) { - self = weakAttribute.base - } - - @_alwaysEmitIntoClient - public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { - WeakAttribute(base: self) - } - - @_alwaysEmitIntoClient - public var attribute: AnyAttribute? { - get { - let attribute = __AGWeakAttributeGetAttribute(self) - return attribute == .nil ? nil : attribute - } - set { - self = AnyWeakAttribute(newValue) - } - } + @_alwaysEmitIntoClient + public init(_ attribute: AnyAttribute?) { + self = __AGCreateWeakAttribute(attribute ?? .nil) + } + + @_alwaysEmitIntoClient + public init(_ weakAttribute: AttributeGraph.WeakAttribute) { + self = weakAttribute.base + } + + @_alwaysEmitIntoClient + public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { + WeakAttribute(base: self) + } + + @_alwaysEmitIntoClient + public var attribute: AnyAttribute? { + get { + let attribute = __AGWeakAttributeGetAttribute(self) + return attribute == .nil ? nil : attribute + } + set { + self = AnyWeakAttribute(newValue) + } + } } extension AttributeGraph.AnyWeakAttribute: Hashable { - @_alwaysEmitIntoClient - public func hash(into hasher: inout Swift.Hasher) { - hasher.combine(raw_attribute) - hasher.combine(subgraph_id) - } + @_alwaysEmitIntoClient + public func hash(into hasher: inout Swift.Hasher) { + hasher.combine(raw_attribute) + hasher.combine(subgraph_id) + } - @_alwaysEmitIntoClient - public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { - lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id - } + @_alwaysEmitIntoClient + public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { + lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id + } - @_alwaysEmitIntoClient - public var hashValue: Int { - _hashValue(for: self) - } + @_alwaysEmitIntoClient + public var hashValue: Int { + _hashValue(for: self) + } } extension AttributeGraph.AnyWeakAttribute: CustomStringConvertible { - @_alwaysEmitIntoClient - public var description: String { - attribute?.description ?? "nil" - } + @_alwaysEmitIntoClient + public var description: String { + attribute?.description ?? "nil" + } } - // MARK: - WeakAttribute @frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - @usableFromInline - internal var base: AnyWeakAttribute - @_alwaysEmitIntoClient - public init(base: AnyWeakAttribute) { self.base = base } - public init() - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public var wrappedValue: Value? { get } - public var projectedValue: AttributeGraph.Attribute?{ get set } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { get } - public var attribute: AttributeGraph.Attribute? { get set _modify } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? + @usableFromInline + internal var base: AnyWeakAttribute + @_alwaysEmitIntoClient + public init(base: AnyWeakAttribute) { self.base = base } + public init() + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public var wrappedValue: Value? { get } + public var projectedValue: AttributeGraph.Attribute? { get set } + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { + get + } + public var attribute: AttributeGraph.Attribute? { get set _modify } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? } extension AttributeGraph.WeakAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.WeakAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - OptionalAttribute @frozen public struct AnyOptionalAttribute { - public init() - public init(_ attribute: AnyAttribute) - public init(_ attribute: AnyAttribute?) - public init(_ attribute: AttributeGraph.OptionalAttribute) - public var identifier: AnyAttribute - public static var current: AttributeGraph.AnyOptionalAttribute { get } - public var attribute: AnyAttribute? { get set } - public func map(_ body: (AnyAttribute) -> Value) -> Value? - public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute + public init() + public init(_ attribute: AnyAttribute) + public init(_ attribute: AnyAttribute?) + public init(_ attribute: AttributeGraph.OptionalAttribute) + public var identifier: AnyAttribute + public static var current: AttributeGraph.AnyOptionalAttribute { get } + public var attribute: AnyAttribute? { get set } + public func map(_ body: (AnyAttribute) -> Value) -> Value? + public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute } extension AttributeGraph.AnyOptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.AnyOptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } @frozen @propertyWrapper @dynamicMemberLookup public struct OptionalAttribute { - public var base: AttributeGraph.AnyOptionalAttribute - public init() - public init(base: AttributeGraph.AnyOptionalAttribute) - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public var attribute: AttributeGraph.Attribute? { get set } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? - public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? - public var wrappedValue: Value? { get } - public var projectedValue: Attribute? { get set _modify } - public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } + public var base: AttributeGraph.AnyOptionalAttribute + public init() + public init(base: AttributeGraph.AnyOptionalAttribute) + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public init(_ weakAttribute: AttributeGraph.WeakAttribute) + public var attribute: AttributeGraph.Attribute? { get set } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? + public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? + public var wrappedValue: Value? { get } + public var projectedValue: Attribute? { get set _modify } + public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } } extension AttributeGraph.OptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - IndirectAttribute @@ -257,36 +269,37 @@ extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { - public let identifier: AnyAttribute - public init(source: AttributeGraph.Attribute) - public var source: AttributeGraph.Attribute { - get - nonmutating set - nonmutating _modify - } - public var dependency: AnyAttribute? { - get - nonmutating set - } - public var value: Value { - get - nonmutating set - nonmutating _modify - } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public var wrappedValue: Value { - get - nonmutating set - nonmutating _modify - } - public var projectedValue: AttributeGraph.Attribute { get } - public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } + public let identifier: AnyAttribute + public init(source: AttributeGraph.Attribute) + public var source: AttributeGraph.Attribute { + get + nonmutating set + nonmutating _modify + } + public var dependency: AnyAttribute? { + get + nonmutating set + } + public var value: Value { + get + nonmutating set + nonmutating _modify + } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public var wrappedValue: Value { + get + nonmutating set + nonmutating _modify + } + public var projectedValue: AttributeGraph.Attribute { get } + public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } } extension AttributeGraph.IndirectAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } // MARK: - _AttributeBody @@ -317,17 +330,17 @@ public protocol AttributeBodyVisitor { @frozen public struct External { - public init() + public init() } extension AttributeGraph.External: AttributeGraph._AttributeBody { - public static var comparisonMode: AGComparisonMode { get } - public static var flags: AGAttributeTypeFlags { get } - public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static var comparisonMode: AGComparisonMode { get } + public static var flags: AGAttributeTypeFlags { get } + public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) } extension AttributeGraph.External: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - Focus @@ -336,28 +349,28 @@ extension AttributeGraph.External: Swift.CustomStringConvertible { public struct Focus { public var root: Attribute public var keyPath: KeyPath - + public init(root: Attribute, keyPath: KeyPath) } extension AttributeGraph.Focus: AttributeGraph.Rule { - public var value: Self.Value { get } - public static var flags: AGAttributeTypeFlags { get } + public var value: Self.Value { get } + public static var flags: AGAttributeTypeFlags { get } } extension AttributeGraph.Focus: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - ObservedAttribute public protocol ObservedAttribute: AttributeGraph._AttributeBody { - func destroy() + func destroy() } extension AttributeGraph.ObservedAttribute { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { get } + public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) + public static var _hasDestroySelf: Swift.Bool { get } } // MARK: - Graph Related @@ -365,65 +378,69 @@ extension AttributeGraph.ObservedAttribute { // MARK: - AGGraph extension AttributeGraph.AGGraph { - public static func typeIndex( - ctx: AGGraphContext, - body: AttributeGraph._AttributeBody.Type, - valueType: Metadata, - flags: AGAttributeTypeFlags, - update: AttributeUpdateBlock - ) -> Int + public static func typeIndex( + ctx: AGUnownedGraphRef, + body: AttributeGraph._AttributeBody.Type, + valueType: Metadata, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) -> Int } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphStartProfiling") - public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStartProfiling") + public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) - @_silgen_name("AGGraphStopProfiling") - public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStopProfiling") + public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphSetInvalidationCallback") - public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) + @_silgen_name("AGGraphSetInvalidationCallback") + public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) - @_silgen_name("AGGraphSetUpdateCallback") - public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) + @_silgen_name("AGGraphSetUpdateCallback") + public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) } extension AttributeGraph.AGGraph { - @_transparent - @inline(__always) - public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: ._10)) } + @_transparent + @inline(__always) + public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: .mainThreadUpdateCount)) } } extension AttributeGraph.AGGraph { - public static func withoutUpdate(_ body: () -> Value) -> Value + public static func withoutUpdate(_ body: () -> Value) -> Value } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphGetOutputValue") - @inline(__always) - @inlinable - public static func outputValue() -> Swift.UnsafePointer? + @_silgen_name("AGGraphGetOutputValue") + @inline(__always) + @inlinable + public static func outputValue() -> Swift.UnsafePointer? - @_silgen_name("AGGraphSetOutputValue") - @inline(__always) - @inlinable - public static func setOutputValue(_ value: Swift.UnsafePointer) + @_silgen_name("AGGraphSetOutputValue") + @inline(__always) + @inlinable + public static func setOutputValue(_ value: Swift.UnsafePointer) } // MARK: - AGSubgraph extension AttributeGraph.AGSubgraph { - public func addObserver(_ observer: () -> Void) -> Swift.Int - public func apply(_ body: () -> Value) -> Value - public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) + public func addObserver(_ observer: () -> Void) -> Swift.Int + public func apply(_ body: () -> Value) -> Value + public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) } extension AttributeGraph.AGSubgraph { - public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) - public static func endTreeElement(value: AttributeGraph.Attribute) - public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) + public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) + public static func endTreeElement(value: AttributeGraph.Attribute) + public static func addTreeValue( + _ value: AttributeGraph.Attribute, + forKey key: Swift.UnsafePointer, + flags: Swift.UInt32 + ) } // MARK: - Rule Related @@ -438,97 +455,114 @@ public protocol Rule: AttributeGraph._AttributeBody { extension AttributeGraph.Rule { public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.Rule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } } extension AttributeGraph.Rule where Self: Swift.Hashable { - public func cachedValueIfExists( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value? + public func cachedValueIfExists( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value? - public func cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value + public func cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value - public static func _cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute?, - hashValue: Swift.Int, - bodyPtr: Swift.UnsafeRawPointer, - update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> () - ) -> Swift.UnsafePointer + public static func _cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute?, + hashValue: Swift.Int, + bodyPtr: Swift.UnsafeRawPointer, + update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void + ) -> Swift.UnsafePointer } // MARK: - StateRule public protocol StatefulRule: AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Value? { get } - mutating func updateValue() + associatedtype Value + static var initialValue: Value? { get } + mutating func updateValue() } extension AttributeGraph.StatefulRule { - public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static var initialValue: Self.Value? { get } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.StatefulRule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool { get } } // MARK: - RuleContext @frozen public struct RuleContext { - public var attribute: AttributeGraph.Attribute - public init(attribute: AttributeGraph.Attribute) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) + public var attribute: AttributeGraph.Attribute + public init(attribute: AttributeGraph.Attribute) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) } // MARK: - AnyRuleContext @frozen public struct AnyRuleContext { - public var attribute: AnyAttribute - public init(attribute: AnyAttribute) - public init(_ context: AttributeGraph.RuleContext) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) - public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext + public var attribute: AnyAttribute + public init(attribute: AnyAttribute) + public init(_ context: AttributeGraph.RuleContext) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) + public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext } // MARK: - Runtime Related // MARK: - CompareValues -public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = ._3) -> Swift.Bool +extension AGComparisonOptions { + public init(mode: AGComparisonMode) +} + +public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = .equatableAlways) -> Swift.Bool public func compareValues(_ lhs: A, _ rhs: A, options: AGComparisonOptions) -> Swift.Bool // MARK: - Metadata +public func forEachField( + of type: Any.Type, + do body: (UnsafePointer, Int, Any.Type) -> Void +) + extension Metadata: Swift.CustomStringConvertible { public init(_ type: Any.Type) public var type: Any.Type { get } @@ -539,83 +573,97 @@ extension Metadata: Swift.CustomStringConvertible { ) -> Bool } +// MARK: - Signature + +extension Signature: Swift.Equatable {} + // MARK: - TupleType extension TupleType { - @_transparent + @_transparent public init(_ types: [Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) } - - @_transparent + + @_transparent public init(_ type: Any.Type) { - self.init(rawValue: unsafeBitCast(type, to: UnsafePointer<_Metadata>.self)) + self.init(rawValue: unsafeBitCast(type, to: OpaquePointer.self)) } - - @_transparent + + @_transparent public var isEmpty: Bool { count == 0 } - @_transparent - public var indices: Range { 0 ..< count } - - @_transparent + @_transparent + public var indices: Range { 0.. Any.Type { elementType(at: index).type } - - @_transparent + + @_transparent public func offset(at index: Int, as type: T.Type) -> Int { elementOffset(at: index, type: Metadata(type)) } - - @_transparent - public func setElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, from srcValue: UnsafePointer, options: CopyOptions) { + + @_transparent + public func setElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + from srcValue: UnsafePointer, + options: CopyOptions + ) { __AGTupleSetElement(self, tupleValue, index, srcValue, Metadata(T.self), options) } - - @_transparent - public func getElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, to dstValue: UnsafeMutablePointer, options: CopyOptions) { + + @_transparent + public func getElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + to dstValue: UnsafeMutablePointer, + options: CopyOptions + ) { __AGTupleGetElement(self, tupleValue, index, dstValue, Metadata(T.self), options) } } @_silgen_name("AGTupleWithBuffer") -public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> ()) +public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> Void) // MARK: - UnsafeTuple extension UnsafeTuple { - @_transparent + @_transparent public var count: Int { type.count } - - @_transparent - public var isEmpty: Bool { type.isEmpty } - - @_transparent - public var indices: Range { type.indices } - - @_transparent + + @_transparent + public var isEmpty: Bool { type.isEmpty } + + @_transparent + public var indices: Range { type.indices } + + @_transparent public func address(as _: T.Type = T.self) -> UnsafePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { address(of: index, as: T.self) } } @@ -630,61 +678,61 @@ extension UnsafeTuple { /*private*/ public func slowDealloc(_ ptr: UnsafeMutableRawPointer, _ size: Int, _ alignMask: Int) extension UnsafeMutableTuple { - @_transparent + @_transparent public init(with tupleType: TupleType) { self.init(type: tupleType, value: slowAlloc(tupleType.size, -1)) } - @_transparent + @_transparent public func initialize(at index: Int, to element: T) { withUnsafePointer(to: element) { elementPointer in type.setElement(in: value, at: index, from: elementPointer, options: .initCopy) } } - @_transparent + @_transparent public func deinitialize() { type.destroy(value) } - @_transparent + @_transparent public func deinitialize(at index: Int) { type.destroy(value, at: index) } - @_transparent + @_transparent public func deallocate(initialized: Bool) { if initialized { deinitialize() } slowDealloc(value, -1, -1) - } - @_transparent + } + @_transparent public var count: Int { type.count } - @_transparent + @_transparent public var isEmpty: Bool { type.isEmpty } - @_transparent + @_transparent public var indices: Range { type.indices } - - @_transparent + + @_transparent public func address(as _: T.Type = T.self) -> UnsafeMutablePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafeMutablePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { UnsafePointer(address(as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { UnsafePointer(address(of: index, as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(of: index, as: T.self) } @@ -724,30 +772,41 @@ public func AGTypeApplyFields2( @frozen public struct PointerOffset { - public var byteOffset: Swift.Int - public init(byteOffset: Swift.Int) + public var byteOffset: Swift.Int + public init(byteOffset: Swift.Int) } extension AttributeGraph.PointerOffset { - public static func + (_ lhs: AttributeGraph.PointerOffset, _ rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset + public static func + ( + _ lhs: AttributeGraph.PointerOffset, + _ rhs: AttributeGraph.PointerOffset + ) -> AttributeGraph.PointerOffset } extension AttributeGraph.PointerOffset { - public static func invalidScenePointer() -> Swift.UnsafeMutablePointer - public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset - public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset + public static func invalidScenePointer() -> Swift.UnsafeMutablePointer + public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset + public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset< + Base, Member + > } extension AttributeGraph.PointerOffset where Base == Member { - public init() + public init() } extension Swift.UnsafePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - } - public static func + (_ lhs: Swift.UnsafePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + } + public static func + ( + _ lhs: Swift.UnsafePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafePointer } extension Swift.UnsafeMutablePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - nonmutating unsafeMutableAddress - } - public static func + (_ lhs: Swift.UnsafeMutablePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + nonmutating unsafeMutableAddress + } + public static func + ( + _ lhs: Swift.UnsafeMutablePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafeMutablePointer } diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-ios-simulator.swiftinterface b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-ios-simulator.swiftinterface index 36582ec..72a0c79 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-ios-simulator.swiftinterface @@ -1,6 +1,6 @@ // swift-interface-format-version: 1.0 -// swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) -// swift-module-flags: -target x86_64-apple-ios11.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name AttributeGraph +// swift-compiler-version: Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3) +// swift-module-flags: -target x86_64-apple-ios11.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 6 -enforce-exclusivity=checked -O -module-name AttributeGraph // swift-module-flags-ignorable: -enable-bare-slash-regex @_exported import AttributeGraph import Foundation @@ -13,27 +13,27 @@ import _StringProcessing // MARK: - AnyAttribute extension AttributeGraph.AnyAttribute { - public init(_ attribute: AttributeGraph.Attribute) - public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute - public static var current: AnyAttribute? { get } - public func unsafeOffset(at offset: Int) -> AnyAttribute - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - public func visitBody(_ visitor: inout Visitor); - public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> ()) - public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var _bodyType: Any.Type { get } - public var _bodyPointer: UnsafeRawPointer { get } - public var valueType: Any.Type { get } - public var indirectDependency: AnyAttribute? { - get - nonmutating set - } + public init(_ attribute: AttributeGraph.Attribute) + public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute + public static var current: AnyAttribute? { get } + public func unsafeOffset(at offset: Int) -> AnyAttribute + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + public func visitBody(_ visitor: inout Visitor) + public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + public var _bodyType: Any.Type { get } + public var _bodyPointer: UnsafeRawPointer { get } + public var valueType: Any.Type { get } + public var indirectDependency: AnyAttribute? { + get + nonmutating set + } } extension AttributeGraph.AnyAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } public typealias AttributeUpdateBlock = () -> ((Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void) @@ -48,66 +48,74 @@ public struct Attribute { public init(identifier: AnyAttribute) public init(_ attribute: AttributeGraph.Attribute) - public init(value: Value) - public init(type: Value.Type) - public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: AGAttributeTypeFlags, update: AttributeUpdateBlock) - public var wrappedValue: Value { - unsafeAddress - nonmutating set - } - public var projectedValue: AttributeGraph.Attribute { get set } - + public init(value: Value) + public init(type: Value.Type) + public init( + body: Swift.UnsafePointer, + value: Swift.UnsafePointer?, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) + public var wrappedValue: Value { + unsafeAddress + nonmutating set + } + public var projectedValue: AttributeGraph.Attribute { get set } + public subscript(dynamicMember _: Swift.KeyPath) -> AttributeGraph.Attribute { get } public subscript(keyPath _: Swift.KeyPath) -> AttributeGraph.Attribute { get } - public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) -> AttributeGraph.Attribute { get } - - public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute - public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute - public func applying(offset: AttributeGraph.PointerOffset) -> AttributeGraph.Attribute - public func visitBody(_ visitor: inout Body) - public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) - public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - - public var graph: AGGraph { get } - public var subgraph: AGSubgraph { get } - - public var value: Value { - unsafeAddress - nonmutating set - } - public var valueState: AGValueState { get } - public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public func setValue(_ value: Value) -> Bool - public var hasValue: Bool { get } - public func updateValue() - public func prefetchValue() - public func invalidateValue() - public func validate() - - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - - public var flags: AGAttributeFlags { - get - nonmutating set - } - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + { get } + + public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute + public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute + public func applying(offset: AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + public func visitBody(_ visitor: inout Body) + public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + + public var graph: AGGraph { get } + public var subgraph: AGSubgraph { get } + + public var value: Value { + unsafeAddress + nonmutating set + } + public var valueState: AGValueState { get } + public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public func setValue(_ value: Value) -> Bool + public var hasValue: Bool { get } + public func updateValue() + public func prefetchValue() + public func invalidateValue() + public func validate() + + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + + public var flags: AGAttributeFlags { + get + nonmutating set + } + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) } extension AttributeGraph.Attribute: Swift.Hashable { public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool + public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool public var hashValue: Swift.Int { get } } extension AttributeGraph.Attribute: Swift.CustomStringConvertible { - public var description: String { get } + public var description: String { get } } extension AttributeGraph.Attribute { - public init(_ rule: R) where R.Value == Value - public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value } // MARK: - AnyWeakAttribute @@ -115,140 +123,144 @@ extension AttributeGraph.Attribute { public typealias AnyWeakAttribute = AGWeakAttribute extension AttributeGraph.AnyWeakAttribute { - @_alwaysEmitIntoClient - public init(_ attribute: AnyAttribute?) { - self = __AGCreateWeakAttribute(attribute ?? .nil) - } - - @_alwaysEmitIntoClient - public init(_ weakAttribute: AttributeGraph.WeakAttribute) { - self = weakAttribute.base - } - - @_alwaysEmitIntoClient - public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { - WeakAttribute(base: self) - } - - @_alwaysEmitIntoClient - public var attribute: AnyAttribute? { - get { - let attribute = __AGWeakAttributeGetAttribute(self) - return attribute == .nil ? nil : attribute - } - set { - self = AnyWeakAttribute(newValue) - } - } + @_alwaysEmitIntoClient + public init(_ attribute: AnyAttribute?) { + self = __AGCreateWeakAttribute(attribute ?? .nil) + } + + @_alwaysEmitIntoClient + public init(_ weakAttribute: AttributeGraph.WeakAttribute) { + self = weakAttribute.base + } + + @_alwaysEmitIntoClient + public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { + WeakAttribute(base: self) + } + + @_alwaysEmitIntoClient + public var attribute: AnyAttribute? { + get { + let attribute = __AGWeakAttributeGetAttribute(self) + return attribute == .nil ? nil : attribute + } + set { + self = AnyWeakAttribute(newValue) + } + } } extension AttributeGraph.AnyWeakAttribute: Hashable { - @_alwaysEmitIntoClient - public func hash(into hasher: inout Swift.Hasher) { - hasher.combine(raw_attribute) - hasher.combine(subgraph_id) - } + @_alwaysEmitIntoClient + public func hash(into hasher: inout Swift.Hasher) { + hasher.combine(raw_attribute) + hasher.combine(subgraph_id) + } - @_alwaysEmitIntoClient - public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { - lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id - } + @_alwaysEmitIntoClient + public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { + lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id + } - @_alwaysEmitIntoClient - public var hashValue: Int { - _hashValue(for: self) - } + @_alwaysEmitIntoClient + public var hashValue: Int { + _hashValue(for: self) + } } extension AttributeGraph.AnyWeakAttribute: CustomStringConvertible { - @_alwaysEmitIntoClient - public var description: String { - attribute?.description ?? "nil" - } + @_alwaysEmitIntoClient + public var description: String { + attribute?.description ?? "nil" + } } - // MARK: - WeakAttribute @frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - @usableFromInline - internal var base: AnyWeakAttribute - @_alwaysEmitIntoClient - public init(base: AnyWeakAttribute) { self.base = base } - public init() - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public var wrappedValue: Value? { get } - public var projectedValue: AttributeGraph.Attribute?{ get set } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { get } - public var attribute: AttributeGraph.Attribute? { get set _modify } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? + @usableFromInline + internal var base: AnyWeakAttribute + @_alwaysEmitIntoClient + public init(base: AnyWeakAttribute) { self.base = base } + public init() + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public var wrappedValue: Value? { get } + public var projectedValue: AttributeGraph.Attribute? { get set } + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { + get + } + public var attribute: AttributeGraph.Attribute? { get set _modify } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? } extension AttributeGraph.WeakAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.WeakAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - OptionalAttribute @frozen public struct AnyOptionalAttribute { - public init() - public init(_ attribute: AnyAttribute) - public init(_ attribute: AnyAttribute?) - public init(_ attribute: AttributeGraph.OptionalAttribute) - public var identifier: AnyAttribute - public static var current: AttributeGraph.AnyOptionalAttribute { get } - public var attribute: AnyAttribute? { get set } - public func map(_ body: (AnyAttribute) -> Value) -> Value? - public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute + public init() + public init(_ attribute: AnyAttribute) + public init(_ attribute: AnyAttribute?) + public init(_ attribute: AttributeGraph.OptionalAttribute) + public var identifier: AnyAttribute + public static var current: AttributeGraph.AnyOptionalAttribute { get } + public var attribute: AnyAttribute? { get set } + public func map(_ body: (AnyAttribute) -> Value) -> Value? + public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute } extension AttributeGraph.AnyOptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.AnyOptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } @frozen @propertyWrapper @dynamicMemberLookup public struct OptionalAttribute { - public var base: AttributeGraph.AnyOptionalAttribute - public init() - public init(base: AttributeGraph.AnyOptionalAttribute) - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public var attribute: AttributeGraph.Attribute? { get set } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? - public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? - public var wrappedValue: Value? { get } - public var projectedValue: Attribute? { get set _modify } - public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } + public var base: AttributeGraph.AnyOptionalAttribute + public init() + public init(base: AttributeGraph.AnyOptionalAttribute) + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public init(_ weakAttribute: AttributeGraph.WeakAttribute) + public var attribute: AttributeGraph.Attribute? { get set } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? + public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? + public var wrappedValue: Value? { get } + public var projectedValue: Attribute? { get set _modify } + public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } } extension AttributeGraph.OptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - IndirectAttribute @@ -257,36 +269,37 @@ extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { - public let identifier: AnyAttribute - public init(source: AttributeGraph.Attribute) - public var source: AttributeGraph.Attribute { - get - nonmutating set - nonmutating _modify - } - public var dependency: AnyAttribute? { - get - nonmutating set - } - public var value: Value { - get - nonmutating set - nonmutating _modify - } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public var wrappedValue: Value { - get - nonmutating set - nonmutating _modify - } - public var projectedValue: AttributeGraph.Attribute { get } - public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } + public let identifier: AnyAttribute + public init(source: AttributeGraph.Attribute) + public var source: AttributeGraph.Attribute { + get + nonmutating set + nonmutating _modify + } + public var dependency: AnyAttribute? { + get + nonmutating set + } + public var value: Value { + get + nonmutating set + nonmutating _modify + } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public var wrappedValue: Value { + get + nonmutating set + nonmutating _modify + } + public var projectedValue: AttributeGraph.Attribute { get } + public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } } extension AttributeGraph.IndirectAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } // MARK: - _AttributeBody @@ -317,17 +330,17 @@ public protocol AttributeBodyVisitor { @frozen public struct External { - public init() + public init() } extension AttributeGraph.External: AttributeGraph._AttributeBody { - public static var comparisonMode: AGComparisonMode { get } - public static var flags: AGAttributeTypeFlags { get } - public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static var comparisonMode: AGComparisonMode { get } + public static var flags: AGAttributeTypeFlags { get } + public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) } extension AttributeGraph.External: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - Focus @@ -336,28 +349,28 @@ extension AttributeGraph.External: Swift.CustomStringConvertible { public struct Focus { public var root: Attribute public var keyPath: KeyPath - + public init(root: Attribute, keyPath: KeyPath) } extension AttributeGraph.Focus: AttributeGraph.Rule { - public var value: Self.Value { get } - public static var flags: AGAttributeTypeFlags { get } + public var value: Self.Value { get } + public static var flags: AGAttributeTypeFlags { get } } extension AttributeGraph.Focus: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - ObservedAttribute public protocol ObservedAttribute: AttributeGraph._AttributeBody { - func destroy() + func destroy() } extension AttributeGraph.ObservedAttribute { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { get } + public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) + public static var _hasDestroySelf: Swift.Bool { get } } // MARK: - Graph Related @@ -365,65 +378,69 @@ extension AttributeGraph.ObservedAttribute { // MARK: - AGGraph extension AttributeGraph.AGGraph { - public static func typeIndex( - ctx: AGGraphContext, - body: AttributeGraph._AttributeBody.Type, - valueType: Metadata, - flags: AGAttributeTypeFlags, - update: AttributeUpdateBlock - ) -> Int + public static func typeIndex( + ctx: AGUnownedGraphRef, + body: AttributeGraph._AttributeBody.Type, + valueType: Metadata, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) -> Int } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphStartProfiling") - public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStartProfiling") + public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) - @_silgen_name("AGGraphStopProfiling") - public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStopProfiling") + public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphSetInvalidationCallback") - public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) + @_silgen_name("AGGraphSetInvalidationCallback") + public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) - @_silgen_name("AGGraphSetUpdateCallback") - public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) + @_silgen_name("AGGraphSetUpdateCallback") + public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) } extension AttributeGraph.AGGraph { - @_transparent - @inline(__always) - public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: ._10)) } + @_transparent + @inline(__always) + public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: .mainThreadUpdateCount)) } } extension AttributeGraph.AGGraph { - public static func withoutUpdate(_ body: () -> Value) -> Value + public static func withoutUpdate(_ body: () -> Value) -> Value } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphGetOutputValue") - @inline(__always) - @inlinable - public static func outputValue() -> Swift.UnsafePointer? + @_silgen_name("AGGraphGetOutputValue") + @inline(__always) + @inlinable + public static func outputValue() -> Swift.UnsafePointer? - @_silgen_name("AGGraphSetOutputValue") - @inline(__always) - @inlinable - public static func setOutputValue(_ value: Swift.UnsafePointer) + @_silgen_name("AGGraphSetOutputValue") + @inline(__always) + @inlinable + public static func setOutputValue(_ value: Swift.UnsafePointer) } // MARK: - AGSubgraph extension AttributeGraph.AGSubgraph { - public func addObserver(_ observer: () -> Void) -> Swift.Int - public func apply(_ body: () -> Value) -> Value - public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) + public func addObserver(_ observer: () -> Void) -> Swift.Int + public func apply(_ body: () -> Value) -> Value + public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) } extension AttributeGraph.AGSubgraph { - public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) - public static func endTreeElement(value: AttributeGraph.Attribute) - public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) + public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) + public static func endTreeElement(value: AttributeGraph.Attribute) + public static func addTreeValue( + _ value: AttributeGraph.Attribute, + forKey key: Swift.UnsafePointer, + flags: Swift.UInt32 + ) } // MARK: - Rule Related @@ -438,97 +455,114 @@ public protocol Rule: AttributeGraph._AttributeBody { extension AttributeGraph.Rule { public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.Rule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } } extension AttributeGraph.Rule where Self: Swift.Hashable { - public func cachedValueIfExists( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value? + public func cachedValueIfExists( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value? - public func cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value + public func cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value - public static func _cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute?, - hashValue: Swift.Int, - bodyPtr: Swift.UnsafeRawPointer, - update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> () - ) -> Swift.UnsafePointer + public static func _cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute?, + hashValue: Swift.Int, + bodyPtr: Swift.UnsafeRawPointer, + update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void + ) -> Swift.UnsafePointer } // MARK: - StateRule public protocol StatefulRule: AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Value? { get } - mutating func updateValue() + associatedtype Value + static var initialValue: Value? { get } + mutating func updateValue() } extension AttributeGraph.StatefulRule { - public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static var initialValue: Self.Value? { get } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.StatefulRule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool { get } } // MARK: - RuleContext @frozen public struct RuleContext { - public var attribute: AttributeGraph.Attribute - public init(attribute: AttributeGraph.Attribute) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) + public var attribute: AttributeGraph.Attribute + public init(attribute: AttributeGraph.Attribute) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) } // MARK: - AnyRuleContext @frozen public struct AnyRuleContext { - public var attribute: AnyAttribute - public init(attribute: AnyAttribute) - public init(_ context: AttributeGraph.RuleContext) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) - public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext + public var attribute: AnyAttribute + public init(attribute: AnyAttribute) + public init(_ context: AttributeGraph.RuleContext) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) + public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext } // MARK: - Runtime Related // MARK: - CompareValues -public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = ._3) -> Swift.Bool +extension AGComparisonOptions { + public init(mode: AGComparisonMode) +} + +public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = .equatableAlways) -> Swift.Bool public func compareValues(_ lhs: A, _ rhs: A, options: AGComparisonOptions) -> Swift.Bool // MARK: - Metadata +public func forEachField( + of type: Any.Type, + do body: (UnsafePointer, Int, Any.Type) -> Void +) + extension Metadata: Swift.CustomStringConvertible { public init(_ type: Any.Type) public var type: Any.Type { get } @@ -539,83 +573,97 @@ extension Metadata: Swift.CustomStringConvertible { ) -> Bool } +// MARK: - Signature + +extension Signature: Swift.Equatable {} + // MARK: - TupleType extension TupleType { - @_transparent + @_transparent public init(_ types: [Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) } - - @_transparent + + @_transparent public init(_ type: Any.Type) { - self.init(rawValue: unsafeBitCast(type, to: UnsafePointer<_Metadata>.self)) + self.init(rawValue: unsafeBitCast(type, to: OpaquePointer.self)) } - - @_transparent + + @_transparent public var isEmpty: Bool { count == 0 } - @_transparent - public var indices: Range { 0 ..< count } - - @_transparent + @_transparent + public var indices: Range { 0.. Any.Type { elementType(at: index).type } - - @_transparent + + @_transparent public func offset(at index: Int, as type: T.Type) -> Int { elementOffset(at: index, type: Metadata(type)) } - - @_transparent - public func setElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, from srcValue: UnsafePointer, options: CopyOptions) { + + @_transparent + public func setElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + from srcValue: UnsafePointer, + options: CopyOptions + ) { __AGTupleSetElement(self, tupleValue, index, srcValue, Metadata(T.self), options) } - - @_transparent - public func getElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, to dstValue: UnsafeMutablePointer, options: CopyOptions) { + + @_transparent + public func getElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + to dstValue: UnsafeMutablePointer, + options: CopyOptions + ) { __AGTupleGetElement(self, tupleValue, index, dstValue, Metadata(T.self), options) } } @_silgen_name("AGTupleWithBuffer") -public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> ()) +public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> Void) // MARK: - UnsafeTuple extension UnsafeTuple { - @_transparent + @_transparent public var count: Int { type.count } - - @_transparent - public var isEmpty: Bool { type.isEmpty } - - @_transparent - public var indices: Range { type.indices } - - @_transparent + + @_transparent + public var isEmpty: Bool { type.isEmpty } + + @_transparent + public var indices: Range { type.indices } + + @_transparent public func address(as _: T.Type = T.self) -> UnsafePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { address(of: index, as: T.self) } } @@ -630,61 +678,61 @@ extension UnsafeTuple { /*private*/ public func slowDealloc(_ ptr: UnsafeMutableRawPointer, _ size: Int, _ alignMask: Int) extension UnsafeMutableTuple { - @_transparent + @_transparent public init(with tupleType: TupleType) { self.init(type: tupleType, value: slowAlloc(tupleType.size, -1)) } - @_transparent + @_transparent public func initialize(at index: Int, to element: T) { withUnsafePointer(to: element) { elementPointer in type.setElement(in: value, at: index, from: elementPointer, options: .initCopy) } } - @_transparent + @_transparent public func deinitialize() { type.destroy(value) } - @_transparent + @_transparent public func deinitialize(at index: Int) { type.destroy(value, at: index) } - @_transparent + @_transparent public func deallocate(initialized: Bool) { if initialized { deinitialize() } slowDealloc(value, -1, -1) - } - @_transparent + } + @_transparent public var count: Int { type.count } - @_transparent + @_transparent public var isEmpty: Bool { type.isEmpty } - @_transparent + @_transparent public var indices: Range { type.indices } - - @_transparent + + @_transparent public func address(as _: T.Type = T.self) -> UnsafeMutablePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafeMutablePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { UnsafePointer(address(as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { UnsafePointer(address(of: index, as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(of: index, as: T.self) } @@ -724,30 +772,41 @@ public func AGTypeApplyFields2( @frozen public struct PointerOffset { - public var byteOffset: Swift.Int - public init(byteOffset: Swift.Int) + public var byteOffset: Swift.Int + public init(byteOffset: Swift.Int) } extension AttributeGraph.PointerOffset { - public static func + (_ lhs: AttributeGraph.PointerOffset, _ rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset + public static func + ( + _ lhs: AttributeGraph.PointerOffset, + _ rhs: AttributeGraph.PointerOffset + ) -> AttributeGraph.PointerOffset } extension AttributeGraph.PointerOffset { - public static func invalidScenePointer() -> Swift.UnsafeMutablePointer - public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset - public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset + public static func invalidScenePointer() -> Swift.UnsafeMutablePointer + public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset + public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset< + Base, Member + > } extension AttributeGraph.PointerOffset where Base == Member { - public init() + public init() } extension Swift.UnsafePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - } - public static func + (_ lhs: Swift.UnsafePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + } + public static func + ( + _ lhs: Swift.UnsafePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafePointer } extension Swift.UnsafeMutablePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - nonmutating unsafeMutableAddress - } - public static func + (_ lhs: Swift.UnsafeMutablePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + nonmutating unsafeMutableAddress + } + public static func + ( + _ lhs: Swift.UnsafeMutablePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafeMutablePointer } diff --git a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGAttributeType.h b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGAttributeType.h index 4229ac2..0579f04 100644 --- a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGAttributeType.h +++ b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGAttributeType.h @@ -1,6 +1,6 @@ // // AGAttributeType.h -// +// // // Created by Kyle on 2024/2/17. // @@ -8,15 +8,35 @@ #ifndef AGAttributeType_h #define AGAttributeType_h +#include "AGAttributeTypeFlags.h" #include "AGBase.h" #include "AGTypeID.h" AG_ASSUME_NONNULL_BEGIN +typedef struct AGClosureStorage { + void *function; + void *context; +} AGClosureStorage; + +typedef struct AGAttributeVTable { +} AGAttributeVTable; + typedef struct AGAttributeType { AGTypeID typeID; AGTypeID valueTypeID; - // TODO + + AGClosureStorage updateClosure; + + AGAttributeVTable *_Nullable callbacks; + AGAttributeTypeFlags flags; + + // set after construction + uint32_t offset; + const unsigned char *_Nullable layout; + + AGTypeID initialTypeID; + void *initialBodyTypeID; } AGAttributeType; AG_ASSUME_NONNULL_END diff --git a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGCompareValues.h b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGCompareValues.h index 2fc6604..398c60b 100644 --- a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGCompareValues.h +++ b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGCompareValues.h @@ -12,9 +12,15 @@ #include "AGComparisonMode.h" AG_EXTERN_C_BEGIN + AG_EXPORT AG_REFINED_FOR_SWIFT bool AGCompareValues(const void *lhs, const void *rhs, const void *type, const AGComparisonMode comparisonMode); + +AG_EXPORT +AG_REFINED_FOR_SWIFT +const unsigned char *_Nullable AGPrefetchCompareValues(AGTypeID type, AGComparisonOptions options, uint32_t priority); + AG_EXTERN_C_END #endif /* AGCompareValues_h */ diff --git a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGComparisonMode.h b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGComparisonMode.h index b4a5b9f..ec83f07 100644 --- a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGComparisonMode.h +++ b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGComparisonMode.h @@ -10,19 +10,19 @@ #include "AGBase.h" -typedef AG_OPTIONS(uint32_t, AGComparisonMode) { - AGComparisonMode_0 = 0, - AGComparisonMode_1 = 1 << 0, - AGComparisonMode_2 = 1 << 1, - AGComparisonMode_3 = AGComparisonMode_1 | AGComparisonMode_2, +typedef AG_ENUM(uint8_t, AGComparisonMode){ + AGComparisonModeBitwise = 0, + AGComparisonModeIndirect = 1, + AGComparisonModeEquatableUnlessPOD = 2, + AGComparisonModeEquatableAlways = 3, }; -typedef AG_OPTIONS(uint32_t, AGComparisonOptions) { - AGComparisonOptions_0 = 0, - AGComparisonOptions_1 = 1 << 0, - AGComparisonOptions_2 = 1 << 1, - AGComparisonOptions_3 = AGComparisonOptions_1 | AGComparisonOptions_2, +typedef AG_OPTIONS(uint32_t, AGComparisonOptions){ + AGComparisonOptionsComparisonModeMask = 0xff, + + AGComparisonOptionsCopyOnWrite = 1 << 8, + AGComparisonOptionsFetchLayoutsSynchronously = 1 << 9, + AGComparisonOptionsReportFailures = 1ul << 31, // -1 signed int }; #endif /* AGComparisonMode_h */ - diff --git a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGCounterQueryType.h b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGCounterQueryType.h deleted file mode 100644 index 2a60455..0000000 --- a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGCounterQueryType.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// AGCounterQueryType.h -// -// -// Created by Kyle on 2024/3/8. -// - -#ifndef AGCounterQueryType_h -#define AGCounterQueryType_h - -#include "AGBase.h" - -typedef AG_ENUM(uint32_t, AGCounterQueryType) { - AGCounterQueryType_0, - AGCounterQueryType_1, - AGCounterQueryType_2, - AGCounterQueryType_3, - AGCounterQueryType_4, - AGCounterQueryType_5, - AGCounterQueryType_6, - AGCounterQueryType_7, - AGCounterQueryType_8, - AGCounterQueryType_9, - AGCounterQueryType_10, -}; - -#endif /* AGCounterQueryType_h */ diff --git a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraph.h b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraph.h index 1bd7674..65eedf4 100644 --- a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraph.h +++ b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraph.h @@ -10,17 +10,19 @@ #include "AGBase.h" #include "CFRuntime.h" -#include "AGCounterQueryType.h" +#include "AGGraphCounterQuery.h" // Note: Place all structure declaration in a single place to avoid header cycle dependency typedef struct AG_BRIDGED_TYPE(id) AGGraphStorage * AGGraphRef; -typedef struct AG_BRIDGED_TYPE(id) AGGraphContextStorage * AGGraphContextRef; typedef struct AG_BRIDGED_TYPE(id) AGSubgraphStorage * AGSubgraphRef; +typedef void * AGUnownedGraphRef; +typedef struct AGGraphContextStorage * AGUnownedGraphContextRef; + struct AGGraphStorage; -struct AGGraphContextStorage; struct AGSubgraphStorage; +struct AGGraphContextStorage; typedef uint32_t AGAttribute AG_SWIFT_STRUCT AG_SWIFT_NAME(AnyAttribute); @@ -68,7 +70,7 @@ void AGGraphSetContext(AGGraphRef graph, const void * _Nullable context) AG_SWIF AG_EXPORT AG_REFINED_FOR_SWIFT -AGGraphContextRef AGGraphGetGraphContext(AGGraphRef graph) AG_SWIFT_NAME(getter:AGGraphRef.graphContext(self:)); +AGUnownedGraphRef AGGraphGetGraphContext(AGGraphRef graph) AG_SWIFT_NAME(getter:AGGraphRef.graphContext(self:)); AG_EXPORT AG_REFINED_FOR_SWIFT @@ -92,7 +94,7 @@ void AGGraphSetUpdateCallback(AGGraphRef graph, AG_EXPORT AG_REFINED_FOR_SWIFT -uint64_t AGGraphGetCounter(AGGraphRef graph, AGCounterQueryType query) AG_SWIFT_NAME(AGGraphRef.counter(self:for:)); +uint64_t AGGraphGetCounter(AGGraphRef graph, AGGraphCounterQuery query) AG_SWIFT_NAME(AGGraphRef.counter(self:for:)); AG_EXPORT AG_REFINED_FOR_SWIFT diff --git a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraphContext.h b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraphContext.h index eee32d0..4d6e84f 100644 --- a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraphContext.h +++ b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraphContext.h @@ -19,7 +19,7 @@ AG_EXTERN_C_BEGIN AG_EXPORT AG_REFINED_FOR_SWIFT -AGGraphRef AGGraphContextGetGraph(AGGraphContextRef context) AG_SWIFT_NAME(getter:AGGraphContextRef.graph(self:)); +AGGraphRef AGGraphContextGetGraph(AGUnownedGraphContextRef context) AG_SWIFT_NAME(getter:AGUnownedGraphContextRef.graph(self:)); AG_EXTERN_C_END diff --git a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraphCounterQuery.h b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraphCounterQuery.h new file mode 100644 index 0000000..6fd06d3 --- /dev/null +++ b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraphCounterQuery.h @@ -0,0 +1,30 @@ +// +// AGCounterQueryType.h +// +// +// Created by Kyle on 2024/3/8. +// + +#ifndef AGGraphCounterQuery_h +#define AGGraphCounterQuery_h + +#include "AGBase.h" + +typedef AG_ENUM(uint32_t, AGGraphCounterQuery){ + AGGraphCounterQueryNodeCount, + AGGraphCounterQueryTransactionCount, + AGGraphCounterQueryUpdateCount, + AGGraphCounterQueryChangeCount, + AGGraphCounterQueryContextID, + AGGraphCounterQueryGraphID, + AGGraphCounterQueryContextThreadUpdating, + AGGraphCounterQueryThreadUpdating, + AGGraphCounterQueryContextNeedsUpdate, + AGGraphCounterQueryNeedsUpdate, + AGGraphCounterQueryMainThreadUpdateCount, + AGGraphCounterQueryNodeTotalCount, + AGGraphCounterQuerySubgraphCount, + AGGraphCounterQuerySubgraphTotalCount, +}; + +#endif /* AGGraphCounterQuery_h */ diff --git a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGSubgraph.h b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGSubgraph.h index 8cf9f2c..461a8b2 100644 --- a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGSubgraph.h +++ b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGSubgraph.h @@ -43,7 +43,7 @@ void AGSubgraphSetCurrent(_Nullable AGSubgraphRef cf_subgraph) AG_SWIFT_NAME(set AG_EXPORT AG_REFINED_FOR_SWIFT -_Nullable AGGraphContextRef AGSubgraphGetCurrentGraphContext(void) AG_SWIFT_NAME(getter:AGSubgraphRef.currentGraphContext()); +_Nullable AGUnownedGraphRef AGSubgraphGetCurrentGraphContext(void) AG_SWIFT_NAME(getter:AGSubgraphRef.currentGraphContext()); AG_EXPORT AG_REFINED_FOR_SWIFT diff --git a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGTypeID.h b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGTypeID.h index 002b5f4..585248c 100644 --- a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGTypeID.h +++ b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGTypeID.h @@ -10,10 +10,7 @@ AG_ASSUME_NONNULL_BEGIN -typedef struct AG_SWIFT_NAME(_Metadata) AGSwiftMetadata { -} AGSwiftMetadata; - -typedef const AGSwiftMetadata *AGTypeID AG_SWIFT_STRUCT AG_SWIFT_NAME(Metadata); +typedef const struct AGSwiftMetadata *AGTypeID AG_SWIFT_STRUCT AG_SWIFT_NAME(Metadata); #if ATTRIBUTEGRAPH_RELEASE >= ATTRIBUTEGRAPH_RELEASE_2024 @@ -35,11 +32,11 @@ typedef AG_CLOSED_ENUM(uint32_t, AGTypeKind) { AGTypeKindMetatype, } AG_SWIFT_NAME(Metadata.Kind); -typedef AG_OPTIONS(uint32_t, AGTypeApplyOptions) { - AGTypeApplyOptions_0 = 0, - AGTypeApplyOptions_1 = 1 << 0, - AGTypeApplyOptions_2 = 1 << 1, - AGTypeApplyOptions_4 = 1 << 2, +typedef AG_OPTIONS(uint32_t, AGTypeApplyOptions){ + AGTypeApplyOptionsEnumerateStructFields = 0, + AGTypeApplyOptionsEnumerateClassFields = 1 << 0, + AGTypeApplyOptionsContinueAfterUnknownField = 1 << 1, + AGTypeApplyOptionsEnumerateEnumCases = 1 << 2, }; AG_EXTERN_C_BEGIN diff --git a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h index 5341208..eea48a1 100644 --- a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h +++ b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h @@ -8,10 +8,10 @@ #include "AGChangedValueFlags.h" #include "AGCompareValues.h" #include "AGComparisonMode.h" -#include "AGCounterQueryType.h" #include "AGDebugServer.h" #include "AGGraph.h" #include "AGGraphContext.h" +#include "AGGraphCounterQuery.h" #include "AGGraphDescription.h" #include "AGInputOptions.h" #include "AGSearchOptions.h" diff --git a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-macos.swiftinterface b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-macos.swiftinterface index aacbf77..4c3fc76 100644 --- a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-macos.swiftinterface +++ b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-macos.swiftinterface @@ -1,6 +1,6 @@ // swift-interface-format-version: 1.0 -// swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) -// swift-module-flags: -target arm64-apple-macos12.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name AttributeGraph +// swift-compiler-version: Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3) +// swift-module-flags: -target arm64-apple-macos12.0 -enable-objc-interop -enable-library-evolution -swift-version 6 -enforce-exclusivity=checked -O -module-name AttributeGraph // swift-module-flags-ignorable: -enable-bare-slash-regex @_exported import AttributeGraph import Foundation @@ -13,27 +13,27 @@ import _StringProcessing // MARK: - AnyAttribute extension AttributeGraph.AnyAttribute { - public init(_ attribute: AttributeGraph.Attribute) - public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute - public static var current: AnyAttribute? { get } - public func unsafeOffset(at offset: Int) -> AnyAttribute - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - public func visitBody(_ visitor: inout Visitor); - public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> ()) - public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var _bodyType: Any.Type { get } - public var _bodyPointer: UnsafeRawPointer { get } - public var valueType: Any.Type { get } - public var indirectDependency: AnyAttribute? { - get - nonmutating set - } + public init(_ attribute: AttributeGraph.Attribute) + public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute + public static var current: AnyAttribute? { get } + public func unsafeOffset(at offset: Int) -> AnyAttribute + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + public func visitBody(_ visitor: inout Visitor) + public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + public var _bodyType: Any.Type { get } + public var _bodyPointer: UnsafeRawPointer { get } + public var valueType: Any.Type { get } + public var indirectDependency: AnyAttribute? { + get + nonmutating set + } } extension AttributeGraph.AnyAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } public typealias AttributeUpdateBlock = () -> ((Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void) @@ -48,66 +48,74 @@ public struct Attribute { public init(identifier: AnyAttribute) public init(_ attribute: AttributeGraph.Attribute) - public init(value: Value) - public init(type: Value.Type) - public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: AGAttributeTypeFlags, update: AttributeUpdateBlock) - public var wrappedValue: Value { - unsafeAddress - nonmutating set - } - public var projectedValue: AttributeGraph.Attribute { get set } - + public init(value: Value) + public init(type: Value.Type) + public init( + body: Swift.UnsafePointer, + value: Swift.UnsafePointer?, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) + public var wrappedValue: Value { + unsafeAddress + nonmutating set + } + public var projectedValue: AttributeGraph.Attribute { get set } + public subscript(dynamicMember _: Swift.KeyPath) -> AttributeGraph.Attribute { get } public subscript(keyPath _: Swift.KeyPath) -> AttributeGraph.Attribute { get } - public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) -> AttributeGraph.Attribute { get } - - public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute - public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute - public func applying(offset: AttributeGraph.PointerOffset) -> AttributeGraph.Attribute - public func visitBody(_ visitor: inout Body) - public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) - public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - - public var graph: AGGraph { get } - public var subgraph: AGSubgraph { get } - - public var value: Value { - unsafeAddress - nonmutating set - } - public var valueState: AGValueState { get } - public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public func setValue(_ value: Value) -> Bool - public var hasValue: Bool { get } - public func updateValue() - public func prefetchValue() - public func invalidateValue() - public func validate() - - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - - public var flags: AGAttributeFlags { - get - nonmutating set - } - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + { get } + + public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute + public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute + public func applying(offset: AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + public func visitBody(_ visitor: inout Body) + public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + + public var graph: AGGraph { get } + public var subgraph: AGSubgraph { get } + + public var value: Value { + unsafeAddress + nonmutating set + } + public var valueState: AGValueState { get } + public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public func setValue(_ value: Value) -> Bool + public var hasValue: Bool { get } + public func updateValue() + public func prefetchValue() + public func invalidateValue() + public func validate() + + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + + public var flags: AGAttributeFlags { + get + nonmutating set + } + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) } extension AttributeGraph.Attribute: Swift.Hashable { public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool + public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool public var hashValue: Swift.Int { get } } extension AttributeGraph.Attribute: Swift.CustomStringConvertible { - public var description: String { get } + public var description: String { get } } extension AttributeGraph.Attribute { - public init(_ rule: R) where R.Value == Value - public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value } // MARK: - AnyWeakAttribute @@ -115,140 +123,144 @@ extension AttributeGraph.Attribute { public typealias AnyWeakAttribute = AGWeakAttribute extension AttributeGraph.AnyWeakAttribute { - @_alwaysEmitIntoClient - public init(_ attribute: AnyAttribute?) { - self = __AGCreateWeakAttribute(attribute ?? .nil) - } - - @_alwaysEmitIntoClient - public init(_ weakAttribute: AttributeGraph.WeakAttribute) { - self = weakAttribute.base - } - - @_alwaysEmitIntoClient - public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { - WeakAttribute(base: self) - } - - @_alwaysEmitIntoClient - public var attribute: AnyAttribute? { - get { - let attribute = __AGWeakAttributeGetAttribute(self) - return attribute == .nil ? nil : attribute - } - set { - self = AnyWeakAttribute(newValue) - } - } + @_alwaysEmitIntoClient + public init(_ attribute: AnyAttribute?) { + self = __AGCreateWeakAttribute(attribute ?? .nil) + } + + @_alwaysEmitIntoClient + public init(_ weakAttribute: AttributeGraph.WeakAttribute) { + self = weakAttribute.base + } + + @_alwaysEmitIntoClient + public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { + WeakAttribute(base: self) + } + + @_alwaysEmitIntoClient + public var attribute: AnyAttribute? { + get { + let attribute = __AGWeakAttributeGetAttribute(self) + return attribute == .nil ? nil : attribute + } + set { + self = AnyWeakAttribute(newValue) + } + } } extension AttributeGraph.AnyWeakAttribute: Hashable { - @_alwaysEmitIntoClient - public func hash(into hasher: inout Swift.Hasher) { - hasher.combine(raw_attribute) - hasher.combine(subgraph_id) - } + @_alwaysEmitIntoClient + public func hash(into hasher: inout Swift.Hasher) { + hasher.combine(raw_attribute) + hasher.combine(subgraph_id) + } - @_alwaysEmitIntoClient - public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { - lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id - } + @_alwaysEmitIntoClient + public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { + lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id + } - @_alwaysEmitIntoClient - public var hashValue: Int { - _hashValue(for: self) - } + @_alwaysEmitIntoClient + public var hashValue: Int { + _hashValue(for: self) + } } extension AttributeGraph.AnyWeakAttribute: CustomStringConvertible { - @_alwaysEmitIntoClient - public var description: String { - attribute?.description ?? "nil" - } + @_alwaysEmitIntoClient + public var description: String { + attribute?.description ?? "nil" + } } - // MARK: - WeakAttribute @frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - @usableFromInline - internal var base: AnyWeakAttribute - @_alwaysEmitIntoClient - public init(base: AnyWeakAttribute) { self.base = base } - public init() - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public var wrappedValue: Value? { get } - public var projectedValue: AttributeGraph.Attribute?{ get set } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { get } - public var attribute: AttributeGraph.Attribute? { get set _modify } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? + @usableFromInline + internal var base: AnyWeakAttribute + @_alwaysEmitIntoClient + public init(base: AnyWeakAttribute) { self.base = base } + public init() + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public var wrappedValue: Value? { get } + public var projectedValue: AttributeGraph.Attribute? { get set } + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { + get + } + public var attribute: AttributeGraph.Attribute? { get set _modify } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? } extension AttributeGraph.WeakAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.WeakAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - OptionalAttribute @frozen public struct AnyOptionalAttribute { - public init() - public init(_ attribute: AnyAttribute) - public init(_ attribute: AnyAttribute?) - public init(_ attribute: AttributeGraph.OptionalAttribute) - public var identifier: AnyAttribute - public static var current: AttributeGraph.AnyOptionalAttribute { get } - public var attribute: AnyAttribute? { get set } - public func map(_ body: (AnyAttribute) -> Value) -> Value? - public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute + public init() + public init(_ attribute: AnyAttribute) + public init(_ attribute: AnyAttribute?) + public init(_ attribute: AttributeGraph.OptionalAttribute) + public var identifier: AnyAttribute + public static var current: AttributeGraph.AnyOptionalAttribute { get } + public var attribute: AnyAttribute? { get set } + public func map(_ body: (AnyAttribute) -> Value) -> Value? + public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute } extension AttributeGraph.AnyOptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.AnyOptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } @frozen @propertyWrapper @dynamicMemberLookup public struct OptionalAttribute { - public var base: AttributeGraph.AnyOptionalAttribute - public init() - public init(base: AttributeGraph.AnyOptionalAttribute) - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public var attribute: AttributeGraph.Attribute? { get set } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? - public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? - public var wrappedValue: Value? { get } - public var projectedValue: Attribute? { get set _modify } - public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } + public var base: AttributeGraph.AnyOptionalAttribute + public init() + public init(base: AttributeGraph.AnyOptionalAttribute) + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public init(_ weakAttribute: AttributeGraph.WeakAttribute) + public var attribute: AttributeGraph.Attribute? { get set } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? + public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? + public var wrappedValue: Value? { get } + public var projectedValue: Attribute? { get set _modify } + public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } } extension AttributeGraph.OptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - IndirectAttribute @@ -257,36 +269,37 @@ extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { - public let identifier: AnyAttribute - public init(source: AttributeGraph.Attribute) - public var source: AttributeGraph.Attribute { - get - nonmutating set - nonmutating _modify - } - public var dependency: AnyAttribute? { - get - nonmutating set - } - public var value: Value { - get - nonmutating set - nonmutating _modify - } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public var wrappedValue: Value { - get - nonmutating set - nonmutating _modify - } - public var projectedValue: AttributeGraph.Attribute { get } - public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } + public let identifier: AnyAttribute + public init(source: AttributeGraph.Attribute) + public var source: AttributeGraph.Attribute { + get + nonmutating set + nonmutating _modify + } + public var dependency: AnyAttribute? { + get + nonmutating set + } + public var value: Value { + get + nonmutating set + nonmutating _modify + } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public var wrappedValue: Value { + get + nonmutating set + nonmutating _modify + } + public var projectedValue: AttributeGraph.Attribute { get } + public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } } extension AttributeGraph.IndirectAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } // MARK: - _AttributeBody @@ -317,17 +330,17 @@ public protocol AttributeBodyVisitor { @frozen public struct External { - public init() + public init() } extension AttributeGraph.External: AttributeGraph._AttributeBody { - public static var comparisonMode: AGComparisonMode { get } - public static var flags: AGAttributeTypeFlags { get } - public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static var comparisonMode: AGComparisonMode { get } + public static var flags: AGAttributeTypeFlags { get } + public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) } extension AttributeGraph.External: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - Focus @@ -336,28 +349,28 @@ extension AttributeGraph.External: Swift.CustomStringConvertible { public struct Focus { public var root: Attribute public var keyPath: KeyPath - + public init(root: Attribute, keyPath: KeyPath) } extension AttributeGraph.Focus: AttributeGraph.Rule { - public var value: Self.Value { get } - public static var flags: AGAttributeTypeFlags { get } + public var value: Self.Value { get } + public static var flags: AGAttributeTypeFlags { get } } extension AttributeGraph.Focus: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - ObservedAttribute public protocol ObservedAttribute: AttributeGraph._AttributeBody { - func destroy() + func destroy() } extension AttributeGraph.ObservedAttribute { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { get } + public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) + public static var _hasDestroySelf: Swift.Bool { get } } // MARK: - Graph Related @@ -365,65 +378,69 @@ extension AttributeGraph.ObservedAttribute { // MARK: - AGGraph extension AttributeGraph.AGGraph { - public static func typeIndex( - ctx: AGGraphContext, - body: AttributeGraph._AttributeBody.Type, - valueType: Metadata, - flags: AGAttributeTypeFlags, - update: AttributeUpdateBlock - ) -> Int + public static func typeIndex( + ctx: AGUnownedGraphRef, + body: AttributeGraph._AttributeBody.Type, + valueType: Metadata, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) -> Int } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphStartProfiling") - public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStartProfiling") + public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) - @_silgen_name("AGGraphStopProfiling") - public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStopProfiling") + public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphSetInvalidationCallback") - public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) + @_silgen_name("AGGraphSetInvalidationCallback") + public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) - @_silgen_name("AGGraphSetUpdateCallback") - public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) + @_silgen_name("AGGraphSetUpdateCallback") + public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) } extension AttributeGraph.AGGraph { - @_transparent - @inline(__always) - public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: ._10)) } + @_transparent + @inline(__always) + public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: .mainThreadUpdateCount)) } } extension AttributeGraph.AGGraph { - public static func withoutUpdate(_ body: () -> Value) -> Value + public static func withoutUpdate(_ body: () -> Value) -> Value } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphGetOutputValue") - @inline(__always) - @inlinable - public static func outputValue() -> Swift.UnsafePointer? + @_silgen_name("AGGraphGetOutputValue") + @inline(__always) + @inlinable + public static func outputValue() -> Swift.UnsafePointer? - @_silgen_name("AGGraphSetOutputValue") - @inline(__always) - @inlinable - public static func setOutputValue(_ value: Swift.UnsafePointer) + @_silgen_name("AGGraphSetOutputValue") + @inline(__always) + @inlinable + public static func setOutputValue(_ value: Swift.UnsafePointer) } // MARK: - AGSubgraph extension AttributeGraph.AGSubgraph { - public func addObserver(_ observer: () -> Void) -> Swift.Int - public func apply(_ body: () -> Value) -> Value - public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) + public func addObserver(_ observer: () -> Void) -> Swift.Int + public func apply(_ body: () -> Value) -> Value + public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) } extension AttributeGraph.AGSubgraph { - public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) - public static func endTreeElement(value: AttributeGraph.Attribute) - public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) + public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) + public static func endTreeElement(value: AttributeGraph.Attribute) + public static func addTreeValue( + _ value: AttributeGraph.Attribute, + forKey key: Swift.UnsafePointer, + flags: Swift.UInt32 + ) } // MARK: - Rule Related @@ -438,97 +455,114 @@ public protocol Rule: AttributeGraph._AttributeBody { extension AttributeGraph.Rule { public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.Rule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } } extension AttributeGraph.Rule where Self: Swift.Hashable { - public func cachedValueIfExists( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value? + public func cachedValueIfExists( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value? - public func cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value + public func cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value - public static func _cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute?, - hashValue: Swift.Int, - bodyPtr: Swift.UnsafeRawPointer, - update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> () - ) -> Swift.UnsafePointer + public static func _cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute?, + hashValue: Swift.Int, + bodyPtr: Swift.UnsafeRawPointer, + update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void + ) -> Swift.UnsafePointer } // MARK: - StateRule public protocol StatefulRule: AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Value? { get } - mutating func updateValue() + associatedtype Value + static var initialValue: Value? { get } + mutating func updateValue() } extension AttributeGraph.StatefulRule { - public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static var initialValue: Self.Value? { get } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.StatefulRule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool { get } } // MARK: - RuleContext @frozen public struct RuleContext { - public var attribute: AttributeGraph.Attribute - public init(attribute: AttributeGraph.Attribute) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) + public var attribute: AttributeGraph.Attribute + public init(attribute: AttributeGraph.Attribute) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) } // MARK: - AnyRuleContext @frozen public struct AnyRuleContext { - public var attribute: AnyAttribute - public init(attribute: AnyAttribute) - public init(_ context: AttributeGraph.RuleContext) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) - public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext + public var attribute: AnyAttribute + public init(attribute: AnyAttribute) + public init(_ context: AttributeGraph.RuleContext) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) + public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext } // MARK: - Runtime Related // MARK: - CompareValues -public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = ._3) -> Swift.Bool +extension AGComparisonOptions { + public init(mode: AGComparisonMode) +} + +public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = .equatableAlways) -> Swift.Bool public func compareValues(_ lhs: A, _ rhs: A, options: AGComparisonOptions) -> Swift.Bool // MARK: - Metadata +public func forEachField( + of type: Any.Type, + do body: (UnsafePointer, Int, Any.Type) -> Void +) + extension Metadata: Swift.CustomStringConvertible { public init(_ type: Any.Type) public var type: Any.Type { get } @@ -539,83 +573,97 @@ extension Metadata: Swift.CustomStringConvertible { ) -> Bool } +// MARK: - Signature + +extension Signature: Swift.Equatable {} + // MARK: - TupleType extension TupleType { - @_transparent + @_transparent public init(_ types: [Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) } - - @_transparent + + @_transparent public init(_ type: Any.Type) { - self.init(rawValue: unsafeBitCast(type, to: UnsafePointer<_Metadata>.self)) + self.init(rawValue: unsafeBitCast(type, to: OpaquePointer.self)) } - - @_transparent + + @_transparent public var isEmpty: Bool { count == 0 } - @_transparent - public var indices: Range { 0 ..< count } - - @_transparent + @_transparent + public var indices: Range { 0.. Any.Type { elementType(at: index).type } - - @_transparent + + @_transparent public func offset(at index: Int, as type: T.Type) -> Int { elementOffset(at: index, type: Metadata(type)) } - - @_transparent - public func setElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, from srcValue: UnsafePointer, options: CopyOptions) { + + @_transparent + public func setElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + from srcValue: UnsafePointer, + options: CopyOptions + ) { __AGTupleSetElement(self, tupleValue, index, srcValue, Metadata(T.self), options) } - - @_transparent - public func getElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, to dstValue: UnsafeMutablePointer, options: CopyOptions) { + + @_transparent + public func getElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + to dstValue: UnsafeMutablePointer, + options: CopyOptions + ) { __AGTupleGetElement(self, tupleValue, index, dstValue, Metadata(T.self), options) } } @_silgen_name("AGTupleWithBuffer") -public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> ()) +public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> Void) // MARK: - UnsafeTuple extension UnsafeTuple { - @_transparent + @_transparent public var count: Int { type.count } - - @_transparent - public var isEmpty: Bool { type.isEmpty } - - @_transparent - public var indices: Range { type.indices } - - @_transparent + + @_transparent + public var isEmpty: Bool { type.isEmpty } + + @_transparent + public var indices: Range { type.indices } + + @_transparent public func address(as _: T.Type = T.self) -> UnsafePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { address(of: index, as: T.self) } } @@ -630,61 +678,61 @@ extension UnsafeTuple { /*private*/ public func slowDealloc(_ ptr: UnsafeMutableRawPointer, _ size: Int, _ alignMask: Int) extension UnsafeMutableTuple { - @_transparent + @_transparent public init(with tupleType: TupleType) { self.init(type: tupleType, value: slowAlloc(tupleType.size, -1)) } - @_transparent + @_transparent public func initialize(at index: Int, to element: T) { withUnsafePointer(to: element) { elementPointer in type.setElement(in: value, at: index, from: elementPointer, options: .initCopy) } } - @_transparent + @_transparent public func deinitialize() { type.destroy(value) } - @_transparent + @_transparent public func deinitialize(at index: Int) { type.destroy(value, at: index) } - @_transparent + @_transparent public func deallocate(initialized: Bool) { if initialized { deinitialize() } slowDealloc(value, -1, -1) - } - @_transparent + } + @_transparent public var count: Int { type.count } - @_transparent + @_transparent public var isEmpty: Bool { type.isEmpty } - @_transparent + @_transparent public var indices: Range { type.indices } - - @_transparent + + @_transparent public func address(as _: T.Type = T.self) -> UnsafeMutablePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafeMutablePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { UnsafePointer(address(as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { UnsafePointer(address(of: index, as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(of: index, as: T.self) } @@ -724,30 +772,41 @@ public func AGTypeApplyFields2( @frozen public struct PointerOffset { - public var byteOffset: Swift.Int - public init(byteOffset: Swift.Int) + public var byteOffset: Swift.Int + public init(byteOffset: Swift.Int) } extension AttributeGraph.PointerOffset { - public static func + (_ lhs: AttributeGraph.PointerOffset, _ rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset + public static func + ( + _ lhs: AttributeGraph.PointerOffset, + _ rhs: AttributeGraph.PointerOffset + ) -> AttributeGraph.PointerOffset } extension AttributeGraph.PointerOffset { - public static func invalidScenePointer() -> Swift.UnsafeMutablePointer - public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset - public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset + public static func invalidScenePointer() -> Swift.UnsafeMutablePointer + public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset + public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset< + Base, Member + > } extension AttributeGraph.PointerOffset where Base == Member { - public init() + public init() } extension Swift.UnsafePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - } - public static func + (_ lhs: Swift.UnsafePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + } + public static func + ( + _ lhs: Swift.UnsafePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafePointer } extension Swift.UnsafeMutablePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - nonmutating unsafeMutableAddress - } - public static func + (_ lhs: Swift.UnsafeMutablePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + nonmutating unsafeMutableAddress + } + public static func + ( + _ lhs: Swift.UnsafeMutablePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafeMutablePointer } diff --git a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64e-apple-macos.swiftinterface b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64e-apple-macos.swiftinterface index 2010087..4a13662 100644 --- a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64e-apple-macos.swiftinterface +++ b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64e-apple-macos.swiftinterface @@ -1,6 +1,6 @@ // swift-interface-format-version: 1.0 -// swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) -// swift-module-flags: -target arm64e-apple-macos12.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name AttributeGraph +// swift-compiler-version: Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3) +// swift-module-flags: -target arm64e-apple-macos12.0 -enable-objc-interop -enable-library-evolution -swift-version 6 -enforce-exclusivity=checked -O -module-name AttributeGraph // swift-module-flags-ignorable: -enable-bare-slash-regex @_exported import AttributeGraph import Foundation @@ -13,27 +13,27 @@ import _StringProcessing // MARK: - AnyAttribute extension AttributeGraph.AnyAttribute { - public init(_ attribute: AttributeGraph.Attribute) - public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute - public static var current: AnyAttribute? { get } - public func unsafeOffset(at offset: Int) -> AnyAttribute - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - public func visitBody(_ visitor: inout Visitor); - public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> ()) - public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var _bodyType: Any.Type { get } - public var _bodyPointer: UnsafeRawPointer { get } - public var valueType: Any.Type { get } - public var indirectDependency: AnyAttribute? { - get - nonmutating set - } + public init(_ attribute: AttributeGraph.Attribute) + public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute + public static var current: AnyAttribute? { get } + public func unsafeOffset(at offset: Int) -> AnyAttribute + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + public func visitBody(_ visitor: inout Visitor) + public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + public var _bodyType: Any.Type { get } + public var _bodyPointer: UnsafeRawPointer { get } + public var valueType: Any.Type { get } + public var indirectDependency: AnyAttribute? { + get + nonmutating set + } } extension AttributeGraph.AnyAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } public typealias AttributeUpdateBlock = () -> ((Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void) @@ -48,66 +48,74 @@ public struct Attribute { public init(identifier: AnyAttribute) public init(_ attribute: AttributeGraph.Attribute) - public init(value: Value) - public init(type: Value.Type) - public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: AGAttributeTypeFlags, update: AttributeUpdateBlock) - public var wrappedValue: Value { - unsafeAddress - nonmutating set - } - public var projectedValue: AttributeGraph.Attribute { get set } - + public init(value: Value) + public init(type: Value.Type) + public init( + body: Swift.UnsafePointer, + value: Swift.UnsafePointer?, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) + public var wrappedValue: Value { + unsafeAddress + nonmutating set + } + public var projectedValue: AttributeGraph.Attribute { get set } + public subscript(dynamicMember _: Swift.KeyPath) -> AttributeGraph.Attribute { get } public subscript(keyPath _: Swift.KeyPath) -> AttributeGraph.Attribute { get } - public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) -> AttributeGraph.Attribute { get } - - public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute - public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute - public func applying(offset: AttributeGraph.PointerOffset) -> AttributeGraph.Attribute - public func visitBody(_ visitor: inout Body) - public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) - public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - - public var graph: AGGraph { get } - public var subgraph: AGSubgraph { get } - - public var value: Value { - unsafeAddress - nonmutating set - } - public var valueState: AGValueState { get } - public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public func setValue(_ value: Value) -> Bool - public var hasValue: Bool { get } - public func updateValue() - public func prefetchValue() - public func invalidateValue() - public func validate() - - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - - public var flags: AGAttributeFlags { - get - nonmutating set - } - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + { get } + + public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute + public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute + public func applying(offset: AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + public func visitBody(_ visitor: inout Body) + public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + + public var graph: AGGraph { get } + public var subgraph: AGSubgraph { get } + + public var value: Value { + unsafeAddress + nonmutating set + } + public var valueState: AGValueState { get } + public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public func setValue(_ value: Value) -> Bool + public var hasValue: Bool { get } + public func updateValue() + public func prefetchValue() + public func invalidateValue() + public func validate() + + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + + public var flags: AGAttributeFlags { + get + nonmutating set + } + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) } extension AttributeGraph.Attribute: Swift.Hashable { public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool + public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool public var hashValue: Swift.Int { get } } extension AttributeGraph.Attribute: Swift.CustomStringConvertible { - public var description: String { get } + public var description: String { get } } extension AttributeGraph.Attribute { - public init(_ rule: R) where R.Value == Value - public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value } // MARK: - AnyWeakAttribute @@ -115,140 +123,144 @@ extension AttributeGraph.Attribute { public typealias AnyWeakAttribute = AGWeakAttribute extension AttributeGraph.AnyWeakAttribute { - @_alwaysEmitIntoClient - public init(_ attribute: AnyAttribute?) { - self = __AGCreateWeakAttribute(attribute ?? .nil) - } - - @_alwaysEmitIntoClient - public init(_ weakAttribute: AttributeGraph.WeakAttribute) { - self = weakAttribute.base - } - - @_alwaysEmitIntoClient - public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { - WeakAttribute(base: self) - } - - @_alwaysEmitIntoClient - public var attribute: AnyAttribute? { - get { - let attribute = __AGWeakAttributeGetAttribute(self) - return attribute == .nil ? nil : attribute - } - set { - self = AnyWeakAttribute(newValue) - } - } + @_alwaysEmitIntoClient + public init(_ attribute: AnyAttribute?) { + self = __AGCreateWeakAttribute(attribute ?? .nil) + } + + @_alwaysEmitIntoClient + public init(_ weakAttribute: AttributeGraph.WeakAttribute) { + self = weakAttribute.base + } + + @_alwaysEmitIntoClient + public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { + WeakAttribute(base: self) + } + + @_alwaysEmitIntoClient + public var attribute: AnyAttribute? { + get { + let attribute = __AGWeakAttributeGetAttribute(self) + return attribute == .nil ? nil : attribute + } + set { + self = AnyWeakAttribute(newValue) + } + } } extension AttributeGraph.AnyWeakAttribute: Hashable { - @_alwaysEmitIntoClient - public func hash(into hasher: inout Swift.Hasher) { - hasher.combine(raw_attribute) - hasher.combine(subgraph_id) - } + @_alwaysEmitIntoClient + public func hash(into hasher: inout Swift.Hasher) { + hasher.combine(raw_attribute) + hasher.combine(subgraph_id) + } - @_alwaysEmitIntoClient - public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { - lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id - } + @_alwaysEmitIntoClient + public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { + lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id + } - @_alwaysEmitIntoClient - public var hashValue: Int { - _hashValue(for: self) - } + @_alwaysEmitIntoClient + public var hashValue: Int { + _hashValue(for: self) + } } extension AttributeGraph.AnyWeakAttribute: CustomStringConvertible { - @_alwaysEmitIntoClient - public var description: String { - attribute?.description ?? "nil" - } + @_alwaysEmitIntoClient + public var description: String { + attribute?.description ?? "nil" + } } - // MARK: - WeakAttribute @frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - @usableFromInline - internal var base: AnyWeakAttribute - @_alwaysEmitIntoClient - public init(base: AnyWeakAttribute) { self.base = base } - public init() - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public var wrappedValue: Value? { get } - public var projectedValue: AttributeGraph.Attribute?{ get set } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { get } - public var attribute: AttributeGraph.Attribute? { get set _modify } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? + @usableFromInline + internal var base: AnyWeakAttribute + @_alwaysEmitIntoClient + public init(base: AnyWeakAttribute) { self.base = base } + public init() + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public var wrappedValue: Value? { get } + public var projectedValue: AttributeGraph.Attribute? { get set } + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { + get + } + public var attribute: AttributeGraph.Attribute? { get set _modify } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? } extension AttributeGraph.WeakAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.WeakAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - OptionalAttribute @frozen public struct AnyOptionalAttribute { - public init() - public init(_ attribute: AnyAttribute) - public init(_ attribute: AnyAttribute?) - public init(_ attribute: AttributeGraph.OptionalAttribute) - public var identifier: AnyAttribute - public static var current: AttributeGraph.AnyOptionalAttribute { get } - public var attribute: AnyAttribute? { get set } - public func map(_ body: (AnyAttribute) -> Value) -> Value? - public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute + public init() + public init(_ attribute: AnyAttribute) + public init(_ attribute: AnyAttribute?) + public init(_ attribute: AttributeGraph.OptionalAttribute) + public var identifier: AnyAttribute + public static var current: AttributeGraph.AnyOptionalAttribute { get } + public var attribute: AnyAttribute? { get set } + public func map(_ body: (AnyAttribute) -> Value) -> Value? + public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute } extension AttributeGraph.AnyOptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.AnyOptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } @frozen @propertyWrapper @dynamicMemberLookup public struct OptionalAttribute { - public var base: AttributeGraph.AnyOptionalAttribute - public init() - public init(base: AttributeGraph.AnyOptionalAttribute) - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public var attribute: AttributeGraph.Attribute? { get set } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? - public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? - public var wrappedValue: Value? { get } - public var projectedValue: Attribute? { get set _modify } - public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } + public var base: AttributeGraph.AnyOptionalAttribute + public init() + public init(base: AttributeGraph.AnyOptionalAttribute) + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public init(_ weakAttribute: AttributeGraph.WeakAttribute) + public var attribute: AttributeGraph.Attribute? { get set } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? + public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? + public var wrappedValue: Value? { get } + public var projectedValue: Attribute? { get set _modify } + public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } } extension AttributeGraph.OptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - IndirectAttribute @@ -257,36 +269,37 @@ extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { - public let identifier: AnyAttribute - public init(source: AttributeGraph.Attribute) - public var source: AttributeGraph.Attribute { - get - nonmutating set - nonmutating _modify - } - public var dependency: AnyAttribute? { - get - nonmutating set - } - public var value: Value { - get - nonmutating set - nonmutating _modify - } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public var wrappedValue: Value { - get - nonmutating set - nonmutating _modify - } - public var projectedValue: AttributeGraph.Attribute { get } - public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } + public let identifier: AnyAttribute + public init(source: AttributeGraph.Attribute) + public var source: AttributeGraph.Attribute { + get + nonmutating set + nonmutating _modify + } + public var dependency: AnyAttribute? { + get + nonmutating set + } + public var value: Value { + get + nonmutating set + nonmutating _modify + } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public var wrappedValue: Value { + get + nonmutating set + nonmutating _modify + } + public var projectedValue: AttributeGraph.Attribute { get } + public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } } extension AttributeGraph.IndirectAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } // MARK: - _AttributeBody @@ -317,17 +330,17 @@ public protocol AttributeBodyVisitor { @frozen public struct External { - public init() + public init() } extension AttributeGraph.External: AttributeGraph._AttributeBody { - public static var comparisonMode: AGComparisonMode { get } - public static var flags: AGAttributeTypeFlags { get } - public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static var comparisonMode: AGComparisonMode { get } + public static var flags: AGAttributeTypeFlags { get } + public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) } extension AttributeGraph.External: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - Focus @@ -336,28 +349,28 @@ extension AttributeGraph.External: Swift.CustomStringConvertible { public struct Focus { public var root: Attribute public var keyPath: KeyPath - + public init(root: Attribute, keyPath: KeyPath) } extension AttributeGraph.Focus: AttributeGraph.Rule { - public var value: Self.Value { get } - public static var flags: AGAttributeTypeFlags { get } + public var value: Self.Value { get } + public static var flags: AGAttributeTypeFlags { get } } extension AttributeGraph.Focus: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - ObservedAttribute public protocol ObservedAttribute: AttributeGraph._AttributeBody { - func destroy() + func destroy() } extension AttributeGraph.ObservedAttribute { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { get } + public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) + public static var _hasDestroySelf: Swift.Bool { get } } // MARK: - Graph Related @@ -365,65 +378,69 @@ extension AttributeGraph.ObservedAttribute { // MARK: - AGGraph extension AttributeGraph.AGGraph { - public static func typeIndex( - ctx: AGGraphContext, - body: AttributeGraph._AttributeBody.Type, - valueType: Metadata, - flags: AGAttributeTypeFlags, - update: AttributeUpdateBlock - ) -> Int + public static func typeIndex( + ctx: AGUnownedGraphRef, + body: AttributeGraph._AttributeBody.Type, + valueType: Metadata, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) -> Int } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphStartProfiling") - public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStartProfiling") + public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) - @_silgen_name("AGGraphStopProfiling") - public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStopProfiling") + public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphSetInvalidationCallback") - public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) + @_silgen_name("AGGraphSetInvalidationCallback") + public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) - @_silgen_name("AGGraphSetUpdateCallback") - public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) + @_silgen_name("AGGraphSetUpdateCallback") + public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) } extension AttributeGraph.AGGraph { - @_transparent - @inline(__always) - public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: ._10)) } + @_transparent + @inline(__always) + public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: .mainThreadUpdateCount)) } } extension AttributeGraph.AGGraph { - public static func withoutUpdate(_ body: () -> Value) -> Value + public static func withoutUpdate(_ body: () -> Value) -> Value } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphGetOutputValue") - @inline(__always) - @inlinable - public static func outputValue() -> Swift.UnsafePointer? + @_silgen_name("AGGraphGetOutputValue") + @inline(__always) + @inlinable + public static func outputValue() -> Swift.UnsafePointer? - @_silgen_name("AGGraphSetOutputValue") - @inline(__always) - @inlinable - public static func setOutputValue(_ value: Swift.UnsafePointer) + @_silgen_name("AGGraphSetOutputValue") + @inline(__always) + @inlinable + public static func setOutputValue(_ value: Swift.UnsafePointer) } // MARK: - AGSubgraph extension AttributeGraph.AGSubgraph { - public func addObserver(_ observer: () -> Void) -> Swift.Int - public func apply(_ body: () -> Value) -> Value - public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) + public func addObserver(_ observer: () -> Void) -> Swift.Int + public func apply(_ body: () -> Value) -> Value + public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) } extension AttributeGraph.AGSubgraph { - public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) - public static func endTreeElement(value: AttributeGraph.Attribute) - public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) + public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) + public static func endTreeElement(value: AttributeGraph.Attribute) + public static func addTreeValue( + _ value: AttributeGraph.Attribute, + forKey key: Swift.UnsafePointer, + flags: Swift.UInt32 + ) } // MARK: - Rule Related @@ -438,97 +455,114 @@ public protocol Rule: AttributeGraph._AttributeBody { extension AttributeGraph.Rule { public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.Rule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } } extension AttributeGraph.Rule where Self: Swift.Hashable { - public func cachedValueIfExists( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value? + public func cachedValueIfExists( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value? - public func cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value + public func cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value - public static func _cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute?, - hashValue: Swift.Int, - bodyPtr: Swift.UnsafeRawPointer, - update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> () - ) -> Swift.UnsafePointer + public static func _cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute?, + hashValue: Swift.Int, + bodyPtr: Swift.UnsafeRawPointer, + update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void + ) -> Swift.UnsafePointer } // MARK: - StateRule public protocol StatefulRule: AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Value? { get } - mutating func updateValue() + associatedtype Value + static var initialValue: Value? { get } + mutating func updateValue() } extension AttributeGraph.StatefulRule { - public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static var initialValue: Self.Value? { get } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.StatefulRule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool { get } } // MARK: - RuleContext @frozen public struct RuleContext { - public var attribute: AttributeGraph.Attribute - public init(attribute: AttributeGraph.Attribute) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) + public var attribute: AttributeGraph.Attribute + public init(attribute: AttributeGraph.Attribute) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) } // MARK: - AnyRuleContext @frozen public struct AnyRuleContext { - public var attribute: AnyAttribute - public init(attribute: AnyAttribute) - public init(_ context: AttributeGraph.RuleContext) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) - public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext + public var attribute: AnyAttribute + public init(attribute: AnyAttribute) + public init(_ context: AttributeGraph.RuleContext) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) + public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext } // MARK: - Runtime Related // MARK: - CompareValues -public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = ._3) -> Swift.Bool +extension AGComparisonOptions { + public init(mode: AGComparisonMode) +} + +public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = .equatableAlways) -> Swift.Bool public func compareValues(_ lhs: A, _ rhs: A, options: AGComparisonOptions) -> Swift.Bool // MARK: - Metadata +public func forEachField( + of type: Any.Type, + do body: (UnsafePointer, Int, Any.Type) -> Void +) + extension Metadata: Swift.CustomStringConvertible { public init(_ type: Any.Type) public var type: Any.Type { get } @@ -539,83 +573,97 @@ extension Metadata: Swift.CustomStringConvertible { ) -> Bool } +// MARK: - Signature + +extension Signature: Swift.Equatable {} + // MARK: - TupleType extension TupleType { - @_transparent + @_transparent public init(_ types: [Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) } - - @_transparent + + @_transparent public init(_ type: Any.Type) { - self.init(rawValue: unsafeBitCast(type, to: UnsafePointer<_Metadata>.self)) + self.init(rawValue: unsafeBitCast(type, to: OpaquePointer.self)) } - - @_transparent + + @_transparent public var isEmpty: Bool { count == 0 } - @_transparent - public var indices: Range { 0 ..< count } - - @_transparent + @_transparent + public var indices: Range { 0.. Any.Type { elementType(at: index).type } - - @_transparent + + @_transparent public func offset(at index: Int, as type: T.Type) -> Int { elementOffset(at: index, type: Metadata(type)) } - - @_transparent - public func setElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, from srcValue: UnsafePointer, options: CopyOptions) { + + @_transparent + public func setElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + from srcValue: UnsafePointer, + options: CopyOptions + ) { __AGTupleSetElement(self, tupleValue, index, srcValue, Metadata(T.self), options) } - - @_transparent - public func getElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, to dstValue: UnsafeMutablePointer, options: CopyOptions) { + + @_transparent + public func getElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + to dstValue: UnsafeMutablePointer, + options: CopyOptions + ) { __AGTupleGetElement(self, tupleValue, index, dstValue, Metadata(T.self), options) } } @_silgen_name("AGTupleWithBuffer") -public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> ()) +public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> Void) // MARK: - UnsafeTuple extension UnsafeTuple { - @_transparent + @_transparent public var count: Int { type.count } - - @_transparent - public var isEmpty: Bool { type.isEmpty } - - @_transparent - public var indices: Range { type.indices } - - @_transparent + + @_transparent + public var isEmpty: Bool { type.isEmpty } + + @_transparent + public var indices: Range { type.indices } + + @_transparent public func address(as _: T.Type = T.self) -> UnsafePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { address(of: index, as: T.self) } } @@ -630,61 +678,61 @@ extension UnsafeTuple { /*private*/ public func slowDealloc(_ ptr: UnsafeMutableRawPointer, _ size: Int, _ alignMask: Int) extension UnsafeMutableTuple { - @_transparent + @_transparent public init(with tupleType: TupleType) { self.init(type: tupleType, value: slowAlloc(tupleType.size, -1)) } - @_transparent + @_transparent public func initialize(at index: Int, to element: T) { withUnsafePointer(to: element) { elementPointer in type.setElement(in: value, at: index, from: elementPointer, options: .initCopy) } } - @_transparent + @_transparent public func deinitialize() { type.destroy(value) } - @_transparent + @_transparent public func deinitialize(at index: Int) { type.destroy(value, at: index) } - @_transparent + @_transparent public func deallocate(initialized: Bool) { if initialized { deinitialize() } slowDealloc(value, -1, -1) - } - @_transparent + } + @_transparent public var count: Int { type.count } - @_transparent + @_transparent public var isEmpty: Bool { type.isEmpty } - @_transparent + @_transparent public var indices: Range { type.indices } - - @_transparent + + @_transparent public func address(as _: T.Type = T.self) -> UnsafeMutablePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafeMutablePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { UnsafePointer(address(as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { UnsafePointer(address(of: index, as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(of: index, as: T.self) } @@ -724,30 +772,41 @@ public func AGTypeApplyFields2( @frozen public struct PointerOffset { - public var byteOffset: Swift.Int - public init(byteOffset: Swift.Int) + public var byteOffset: Swift.Int + public init(byteOffset: Swift.Int) } extension AttributeGraph.PointerOffset { - public static func + (_ lhs: AttributeGraph.PointerOffset, _ rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset + public static func + ( + _ lhs: AttributeGraph.PointerOffset, + _ rhs: AttributeGraph.PointerOffset + ) -> AttributeGraph.PointerOffset } extension AttributeGraph.PointerOffset { - public static func invalidScenePointer() -> Swift.UnsafeMutablePointer - public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset - public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset + public static func invalidScenePointer() -> Swift.UnsafeMutablePointer + public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset + public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset< + Base, Member + > } extension AttributeGraph.PointerOffset where Base == Member { - public init() + public init() } extension Swift.UnsafePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - } - public static func + (_ lhs: Swift.UnsafePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + } + public static func + ( + _ lhs: Swift.UnsafePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafePointer } extension Swift.UnsafeMutablePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - nonmutating unsafeMutableAddress - } - public static func + (_ lhs: Swift.UnsafeMutablePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + nonmutating unsafeMutableAddress + } + public static func + ( + _ lhs: Swift.UnsafeMutablePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafeMutablePointer } diff --git a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-macos.swiftinterface b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-macos.swiftinterface index 778068d..641e380 100644 --- a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-macos.swiftinterface +++ b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-macos.swiftinterface @@ -1,6 +1,6 @@ // swift-interface-format-version: 1.0 -// swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) -// swift-module-flags: -target x86_64-apple-macos12.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name AttributeGraph +// swift-compiler-version: Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3) +// swift-module-flags: -target x86_64-apple-macos12.0 -enable-objc-interop -enable-library-evolution -swift-version 6 -enforce-exclusivity=checked -O -module-name AttributeGraph // swift-module-flags-ignorable: -enable-bare-slash-regex @_exported import AttributeGraph import Foundation @@ -13,27 +13,27 @@ import _StringProcessing // MARK: - AnyAttribute extension AttributeGraph.AnyAttribute { - public init(_ attribute: AttributeGraph.Attribute) - public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute - public static var current: AnyAttribute? { get } - public func unsafeOffset(at offset: Int) -> AnyAttribute - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - public func visitBody(_ visitor: inout Visitor); - public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> ()) - public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var _bodyType: Any.Type { get } - public var _bodyPointer: UnsafeRawPointer { get } - public var valueType: Any.Type { get } - public var indirectDependency: AnyAttribute? { - get - nonmutating set - } + public init(_ attribute: AttributeGraph.Attribute) + public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute + public static var current: AnyAttribute? { get } + public func unsafeOffset(at offset: Int) -> AnyAttribute + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + public func visitBody(_ visitor: inout Visitor) + public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + public var _bodyType: Any.Type { get } + public var _bodyPointer: UnsafeRawPointer { get } + public var valueType: Any.Type { get } + public var indirectDependency: AnyAttribute? { + get + nonmutating set + } } extension AttributeGraph.AnyAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } public typealias AttributeUpdateBlock = () -> ((Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void) @@ -48,66 +48,74 @@ public struct Attribute { public init(identifier: AnyAttribute) public init(_ attribute: AttributeGraph.Attribute) - public init(value: Value) - public init(type: Value.Type) - public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: AGAttributeTypeFlags, update: AttributeUpdateBlock) - public var wrappedValue: Value { - unsafeAddress - nonmutating set - } - public var projectedValue: AttributeGraph.Attribute { get set } - + public init(value: Value) + public init(type: Value.Type) + public init( + body: Swift.UnsafePointer, + value: Swift.UnsafePointer?, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) + public var wrappedValue: Value { + unsafeAddress + nonmutating set + } + public var projectedValue: AttributeGraph.Attribute { get set } + public subscript(dynamicMember _: Swift.KeyPath) -> AttributeGraph.Attribute { get } public subscript(keyPath _: Swift.KeyPath) -> AttributeGraph.Attribute { get } - public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) -> AttributeGraph.Attribute { get } - - public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute - public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute - public func applying(offset: AttributeGraph.PointerOffset) -> AttributeGraph.Attribute - public func visitBody(_ visitor: inout Body) - public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) - public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - - public var graph: AGGraph { get } - public var subgraph: AGSubgraph { get } - - public var value: Value { - unsafeAddress - nonmutating set - } - public var valueState: AGValueState { get } - public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public func setValue(_ value: Value) -> Bool - public var hasValue: Bool { get } - public func updateValue() - public func prefetchValue() - public func invalidateValue() - public func validate() - - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - - public var flags: AGAttributeFlags { - get - nonmutating set - } - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + { get } + + public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute + public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute + public func applying(offset: AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + public func visitBody(_ visitor: inout Body) + public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + + public var graph: AGGraph { get } + public var subgraph: AGSubgraph { get } + + public var value: Value { + unsafeAddress + nonmutating set + } + public var valueState: AGValueState { get } + public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public func setValue(_ value: Value) -> Bool + public var hasValue: Bool { get } + public func updateValue() + public func prefetchValue() + public func invalidateValue() + public func validate() + + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + + public var flags: AGAttributeFlags { + get + nonmutating set + } + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) } extension AttributeGraph.Attribute: Swift.Hashable { public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool + public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool public var hashValue: Swift.Int { get } } extension AttributeGraph.Attribute: Swift.CustomStringConvertible { - public var description: String { get } + public var description: String { get } } extension AttributeGraph.Attribute { - public init(_ rule: R) where R.Value == Value - public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value } // MARK: - AnyWeakAttribute @@ -115,140 +123,144 @@ extension AttributeGraph.Attribute { public typealias AnyWeakAttribute = AGWeakAttribute extension AttributeGraph.AnyWeakAttribute { - @_alwaysEmitIntoClient - public init(_ attribute: AnyAttribute?) { - self = __AGCreateWeakAttribute(attribute ?? .nil) - } - - @_alwaysEmitIntoClient - public init(_ weakAttribute: AttributeGraph.WeakAttribute) { - self = weakAttribute.base - } - - @_alwaysEmitIntoClient - public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { - WeakAttribute(base: self) - } - - @_alwaysEmitIntoClient - public var attribute: AnyAttribute? { - get { - let attribute = __AGWeakAttributeGetAttribute(self) - return attribute == .nil ? nil : attribute - } - set { - self = AnyWeakAttribute(newValue) - } - } + @_alwaysEmitIntoClient + public init(_ attribute: AnyAttribute?) { + self = __AGCreateWeakAttribute(attribute ?? .nil) + } + + @_alwaysEmitIntoClient + public init(_ weakAttribute: AttributeGraph.WeakAttribute) { + self = weakAttribute.base + } + + @_alwaysEmitIntoClient + public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { + WeakAttribute(base: self) + } + + @_alwaysEmitIntoClient + public var attribute: AnyAttribute? { + get { + let attribute = __AGWeakAttributeGetAttribute(self) + return attribute == .nil ? nil : attribute + } + set { + self = AnyWeakAttribute(newValue) + } + } } extension AttributeGraph.AnyWeakAttribute: Hashable { - @_alwaysEmitIntoClient - public func hash(into hasher: inout Swift.Hasher) { - hasher.combine(raw_attribute) - hasher.combine(subgraph_id) - } + @_alwaysEmitIntoClient + public func hash(into hasher: inout Swift.Hasher) { + hasher.combine(raw_attribute) + hasher.combine(subgraph_id) + } - @_alwaysEmitIntoClient - public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { - lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id - } + @_alwaysEmitIntoClient + public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { + lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id + } - @_alwaysEmitIntoClient - public var hashValue: Int { - _hashValue(for: self) - } + @_alwaysEmitIntoClient + public var hashValue: Int { + _hashValue(for: self) + } } extension AttributeGraph.AnyWeakAttribute: CustomStringConvertible { - @_alwaysEmitIntoClient - public var description: String { - attribute?.description ?? "nil" - } + @_alwaysEmitIntoClient + public var description: String { + attribute?.description ?? "nil" + } } - // MARK: - WeakAttribute @frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - @usableFromInline - internal var base: AnyWeakAttribute - @_alwaysEmitIntoClient - public init(base: AnyWeakAttribute) { self.base = base } - public init() - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public var wrappedValue: Value? { get } - public var projectedValue: AttributeGraph.Attribute?{ get set } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { get } - public var attribute: AttributeGraph.Attribute? { get set _modify } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? + @usableFromInline + internal var base: AnyWeakAttribute + @_alwaysEmitIntoClient + public init(base: AnyWeakAttribute) { self.base = base } + public init() + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public var wrappedValue: Value? { get } + public var projectedValue: AttributeGraph.Attribute? { get set } + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { + get + } + public var attribute: AttributeGraph.Attribute? { get set _modify } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? } extension AttributeGraph.WeakAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.WeakAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - OptionalAttribute @frozen public struct AnyOptionalAttribute { - public init() - public init(_ attribute: AnyAttribute) - public init(_ attribute: AnyAttribute?) - public init(_ attribute: AttributeGraph.OptionalAttribute) - public var identifier: AnyAttribute - public static var current: AttributeGraph.AnyOptionalAttribute { get } - public var attribute: AnyAttribute? { get set } - public func map(_ body: (AnyAttribute) -> Value) -> Value? - public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute + public init() + public init(_ attribute: AnyAttribute) + public init(_ attribute: AnyAttribute?) + public init(_ attribute: AttributeGraph.OptionalAttribute) + public var identifier: AnyAttribute + public static var current: AttributeGraph.AnyOptionalAttribute { get } + public var attribute: AnyAttribute? { get set } + public func map(_ body: (AnyAttribute) -> Value) -> Value? + public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute } extension AttributeGraph.AnyOptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.AnyOptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } @frozen @propertyWrapper @dynamicMemberLookup public struct OptionalAttribute { - public var base: AttributeGraph.AnyOptionalAttribute - public init() - public init(base: AttributeGraph.AnyOptionalAttribute) - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public var attribute: AttributeGraph.Attribute? { get set } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? - public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? - public var wrappedValue: Value? { get } - public var projectedValue: Attribute? { get set _modify } - public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } + public var base: AttributeGraph.AnyOptionalAttribute + public init() + public init(base: AttributeGraph.AnyOptionalAttribute) + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public init(_ weakAttribute: AttributeGraph.WeakAttribute) + public var attribute: AttributeGraph.Attribute? { get set } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? + public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? + public var wrappedValue: Value? { get } + public var projectedValue: Attribute? { get set _modify } + public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } } extension AttributeGraph.OptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - IndirectAttribute @@ -257,36 +269,37 @@ extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { - public let identifier: AnyAttribute - public init(source: AttributeGraph.Attribute) - public var source: AttributeGraph.Attribute { - get - nonmutating set - nonmutating _modify - } - public var dependency: AnyAttribute? { - get - nonmutating set - } - public var value: Value { - get - nonmutating set - nonmutating _modify - } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public var wrappedValue: Value { - get - nonmutating set - nonmutating _modify - } - public var projectedValue: AttributeGraph.Attribute { get } - public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } + public let identifier: AnyAttribute + public init(source: AttributeGraph.Attribute) + public var source: AttributeGraph.Attribute { + get + nonmutating set + nonmutating _modify + } + public var dependency: AnyAttribute? { + get + nonmutating set + } + public var value: Value { + get + nonmutating set + nonmutating _modify + } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public var wrappedValue: Value { + get + nonmutating set + nonmutating _modify + } + public var projectedValue: AttributeGraph.Attribute { get } + public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } } extension AttributeGraph.IndirectAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } // MARK: - _AttributeBody @@ -317,17 +330,17 @@ public protocol AttributeBodyVisitor { @frozen public struct External { - public init() + public init() } extension AttributeGraph.External: AttributeGraph._AttributeBody { - public static var comparisonMode: AGComparisonMode { get } - public static var flags: AGAttributeTypeFlags { get } - public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static var comparisonMode: AGComparisonMode { get } + public static var flags: AGAttributeTypeFlags { get } + public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) } extension AttributeGraph.External: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - Focus @@ -336,28 +349,28 @@ extension AttributeGraph.External: Swift.CustomStringConvertible { public struct Focus { public var root: Attribute public var keyPath: KeyPath - + public init(root: Attribute, keyPath: KeyPath) } extension AttributeGraph.Focus: AttributeGraph.Rule { - public var value: Self.Value { get } - public static var flags: AGAttributeTypeFlags { get } + public var value: Self.Value { get } + public static var flags: AGAttributeTypeFlags { get } } extension AttributeGraph.Focus: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - ObservedAttribute public protocol ObservedAttribute: AttributeGraph._AttributeBody { - func destroy() + func destroy() } extension AttributeGraph.ObservedAttribute { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { get } + public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) + public static var _hasDestroySelf: Swift.Bool { get } } // MARK: - Graph Related @@ -365,65 +378,69 @@ extension AttributeGraph.ObservedAttribute { // MARK: - AGGraph extension AttributeGraph.AGGraph { - public static func typeIndex( - ctx: AGGraphContext, - body: AttributeGraph._AttributeBody.Type, - valueType: Metadata, - flags: AGAttributeTypeFlags, - update: AttributeUpdateBlock - ) -> Int + public static func typeIndex( + ctx: AGUnownedGraphRef, + body: AttributeGraph._AttributeBody.Type, + valueType: Metadata, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) -> Int } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphStartProfiling") - public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStartProfiling") + public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) - @_silgen_name("AGGraphStopProfiling") - public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStopProfiling") + public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphSetInvalidationCallback") - public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) + @_silgen_name("AGGraphSetInvalidationCallback") + public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) - @_silgen_name("AGGraphSetUpdateCallback") - public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) + @_silgen_name("AGGraphSetUpdateCallback") + public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) } extension AttributeGraph.AGGraph { - @_transparent - @inline(__always) - public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: ._10)) } + @_transparent + @inline(__always) + public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: .mainThreadUpdateCount)) } } extension AttributeGraph.AGGraph { - public static func withoutUpdate(_ body: () -> Value) -> Value + public static func withoutUpdate(_ body: () -> Value) -> Value } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphGetOutputValue") - @inline(__always) - @inlinable - public static func outputValue() -> Swift.UnsafePointer? + @_silgen_name("AGGraphGetOutputValue") + @inline(__always) + @inlinable + public static func outputValue() -> Swift.UnsafePointer? - @_silgen_name("AGGraphSetOutputValue") - @inline(__always) - @inlinable - public static func setOutputValue(_ value: Swift.UnsafePointer) + @_silgen_name("AGGraphSetOutputValue") + @inline(__always) + @inlinable + public static func setOutputValue(_ value: Swift.UnsafePointer) } // MARK: - AGSubgraph extension AttributeGraph.AGSubgraph { - public func addObserver(_ observer: () -> Void) -> Swift.Int - public func apply(_ body: () -> Value) -> Value - public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) + public func addObserver(_ observer: () -> Void) -> Swift.Int + public func apply(_ body: () -> Value) -> Value + public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) } extension AttributeGraph.AGSubgraph { - public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) - public static func endTreeElement(value: AttributeGraph.Attribute) - public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) + public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) + public static func endTreeElement(value: AttributeGraph.Attribute) + public static func addTreeValue( + _ value: AttributeGraph.Attribute, + forKey key: Swift.UnsafePointer, + flags: Swift.UInt32 + ) } // MARK: - Rule Related @@ -438,97 +455,114 @@ public protocol Rule: AttributeGraph._AttributeBody { extension AttributeGraph.Rule { public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.Rule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } } extension AttributeGraph.Rule where Self: Swift.Hashable { - public func cachedValueIfExists( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value? + public func cachedValueIfExists( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value? - public func cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value + public func cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value - public static func _cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute?, - hashValue: Swift.Int, - bodyPtr: Swift.UnsafeRawPointer, - update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> () - ) -> Swift.UnsafePointer + public static func _cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute?, + hashValue: Swift.Int, + bodyPtr: Swift.UnsafeRawPointer, + update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void + ) -> Swift.UnsafePointer } // MARK: - StateRule public protocol StatefulRule: AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Value? { get } - mutating func updateValue() + associatedtype Value + static var initialValue: Value? { get } + mutating func updateValue() } extension AttributeGraph.StatefulRule { - public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static var initialValue: Self.Value? { get } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.StatefulRule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool { get } } // MARK: - RuleContext @frozen public struct RuleContext { - public var attribute: AttributeGraph.Attribute - public init(attribute: AttributeGraph.Attribute) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) + public var attribute: AttributeGraph.Attribute + public init(attribute: AttributeGraph.Attribute) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) } // MARK: - AnyRuleContext @frozen public struct AnyRuleContext { - public var attribute: AnyAttribute - public init(attribute: AnyAttribute) - public init(_ context: AttributeGraph.RuleContext) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) - public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext + public var attribute: AnyAttribute + public init(attribute: AnyAttribute) + public init(_ context: AttributeGraph.RuleContext) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) + public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext } // MARK: - Runtime Related // MARK: - CompareValues -public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = ._3) -> Swift.Bool +extension AGComparisonOptions { + public init(mode: AGComparisonMode) +} + +public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = .equatableAlways) -> Swift.Bool public func compareValues(_ lhs: A, _ rhs: A, options: AGComparisonOptions) -> Swift.Bool // MARK: - Metadata +public func forEachField( + of type: Any.Type, + do body: (UnsafePointer, Int, Any.Type) -> Void +) + extension Metadata: Swift.CustomStringConvertible { public init(_ type: Any.Type) public var type: Any.Type { get } @@ -539,83 +573,97 @@ extension Metadata: Swift.CustomStringConvertible { ) -> Bool } +// MARK: - Signature + +extension Signature: Swift.Equatable {} + // MARK: - TupleType extension TupleType { - @_transparent + @_transparent public init(_ types: [Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) } - - @_transparent + + @_transparent public init(_ type: Any.Type) { - self.init(rawValue: unsafeBitCast(type, to: UnsafePointer<_Metadata>.self)) + self.init(rawValue: unsafeBitCast(type, to: OpaquePointer.self)) } - - @_transparent + + @_transparent public var isEmpty: Bool { count == 0 } - @_transparent - public var indices: Range { 0 ..< count } - - @_transparent + @_transparent + public var indices: Range { 0.. Any.Type { elementType(at: index).type } - - @_transparent + + @_transparent public func offset(at index: Int, as type: T.Type) -> Int { elementOffset(at: index, type: Metadata(type)) } - - @_transparent - public func setElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, from srcValue: UnsafePointer, options: CopyOptions) { + + @_transparent + public func setElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + from srcValue: UnsafePointer, + options: CopyOptions + ) { __AGTupleSetElement(self, tupleValue, index, srcValue, Metadata(T.self), options) } - - @_transparent - public func getElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, to dstValue: UnsafeMutablePointer, options: CopyOptions) { + + @_transparent + public func getElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + to dstValue: UnsafeMutablePointer, + options: CopyOptions + ) { __AGTupleGetElement(self, tupleValue, index, dstValue, Metadata(T.self), options) } } @_silgen_name("AGTupleWithBuffer") -public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> ()) +public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> Void) // MARK: - UnsafeTuple extension UnsafeTuple { - @_transparent + @_transparent public var count: Int { type.count } - - @_transparent - public var isEmpty: Bool { type.isEmpty } - - @_transparent - public var indices: Range { type.indices } - - @_transparent + + @_transparent + public var isEmpty: Bool { type.isEmpty } + + @_transparent + public var indices: Range { type.indices } + + @_transparent public func address(as _: T.Type = T.self) -> UnsafePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { address(of: index, as: T.self) } } @@ -630,61 +678,61 @@ extension UnsafeTuple { /*private*/ public func slowDealloc(_ ptr: UnsafeMutableRawPointer, _ size: Int, _ alignMask: Int) extension UnsafeMutableTuple { - @_transparent + @_transparent public init(with tupleType: TupleType) { self.init(type: tupleType, value: slowAlloc(tupleType.size, -1)) } - @_transparent + @_transparent public func initialize(at index: Int, to element: T) { withUnsafePointer(to: element) { elementPointer in type.setElement(in: value, at: index, from: elementPointer, options: .initCopy) } } - @_transparent + @_transparent public func deinitialize() { type.destroy(value) } - @_transparent + @_transparent public func deinitialize(at index: Int) { type.destroy(value, at: index) } - @_transparent + @_transparent public func deallocate(initialized: Bool) { if initialized { deinitialize() } slowDealloc(value, -1, -1) - } - @_transparent + } + @_transparent public var count: Int { type.count } - @_transparent + @_transparent public var isEmpty: Bool { type.isEmpty } - @_transparent + @_transparent public var indices: Range { type.indices } - - @_transparent + + @_transparent public func address(as _: T.Type = T.self) -> UnsafeMutablePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafeMutablePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { UnsafePointer(address(as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { UnsafePointer(address(of: index, as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(of: index, as: T.self) } @@ -724,30 +772,41 @@ public func AGTypeApplyFields2( @frozen public struct PointerOffset { - public var byteOffset: Swift.Int - public init(byteOffset: Swift.Int) + public var byteOffset: Swift.Int + public init(byteOffset: Swift.Int) } extension AttributeGraph.PointerOffset { - public static func + (_ lhs: AttributeGraph.PointerOffset, _ rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset + public static func + ( + _ lhs: AttributeGraph.PointerOffset, + _ rhs: AttributeGraph.PointerOffset + ) -> AttributeGraph.PointerOffset } extension AttributeGraph.PointerOffset { - public static func invalidScenePointer() -> Swift.UnsafeMutablePointer - public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset - public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset + public static func invalidScenePointer() -> Swift.UnsafeMutablePointer + public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset + public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset< + Base, Member + > } extension AttributeGraph.PointerOffset where Base == Member { - public init() + public init() } extension Swift.UnsafePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - } - public static func + (_ lhs: Swift.UnsafePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + } + public static func + ( + _ lhs: Swift.UnsafePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafePointer } extension Swift.UnsafeMutablePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - nonmutating unsafeMutableAddress - } - public static func + (_ lhs: Swift.UnsafeMutablePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + nonmutating unsafeMutableAddress + } + public static func + ( + _ lhs: Swift.UnsafeMutablePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafeMutablePointer } diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGAttributeType.h b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGAttributeType.h index 4229ac2..0579f04 100644 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGAttributeType.h +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGAttributeType.h @@ -1,6 +1,6 @@ // // AGAttributeType.h -// +// // // Created by Kyle on 2024/2/17. // @@ -8,15 +8,35 @@ #ifndef AGAttributeType_h #define AGAttributeType_h +#include "AGAttributeTypeFlags.h" #include "AGBase.h" #include "AGTypeID.h" AG_ASSUME_NONNULL_BEGIN +typedef struct AGClosureStorage { + void *function; + void *context; +} AGClosureStorage; + +typedef struct AGAttributeVTable { +} AGAttributeVTable; + typedef struct AGAttributeType { AGTypeID typeID; AGTypeID valueTypeID; - // TODO + + AGClosureStorage updateClosure; + + AGAttributeVTable *_Nullable callbacks; + AGAttributeTypeFlags flags; + + // set after construction + uint32_t offset; + const unsigned char *_Nullable layout; + + AGTypeID initialTypeID; + void *initialBodyTypeID; } AGAttributeType; AG_ASSUME_NONNULL_END diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGCompareValues.h b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGCompareValues.h index 2fc6604..398c60b 100644 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGCompareValues.h +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGCompareValues.h @@ -12,9 +12,15 @@ #include "AGComparisonMode.h" AG_EXTERN_C_BEGIN + AG_EXPORT AG_REFINED_FOR_SWIFT bool AGCompareValues(const void *lhs, const void *rhs, const void *type, const AGComparisonMode comparisonMode); + +AG_EXPORT +AG_REFINED_FOR_SWIFT +const unsigned char *_Nullable AGPrefetchCompareValues(AGTypeID type, AGComparisonOptions options, uint32_t priority); + AG_EXTERN_C_END #endif /* AGCompareValues_h */ diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGComparisonMode.h b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGComparisonMode.h index b4a5b9f..ec83f07 100644 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGComparisonMode.h +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGComparisonMode.h @@ -10,19 +10,19 @@ #include "AGBase.h" -typedef AG_OPTIONS(uint32_t, AGComparisonMode) { - AGComparisonMode_0 = 0, - AGComparisonMode_1 = 1 << 0, - AGComparisonMode_2 = 1 << 1, - AGComparisonMode_3 = AGComparisonMode_1 | AGComparisonMode_2, +typedef AG_ENUM(uint8_t, AGComparisonMode){ + AGComparisonModeBitwise = 0, + AGComparisonModeIndirect = 1, + AGComparisonModeEquatableUnlessPOD = 2, + AGComparisonModeEquatableAlways = 3, }; -typedef AG_OPTIONS(uint32_t, AGComparisonOptions) { - AGComparisonOptions_0 = 0, - AGComparisonOptions_1 = 1 << 0, - AGComparisonOptions_2 = 1 << 1, - AGComparisonOptions_3 = AGComparisonOptions_1 | AGComparisonOptions_2, +typedef AG_OPTIONS(uint32_t, AGComparisonOptions){ + AGComparisonOptionsComparisonModeMask = 0xff, + + AGComparisonOptionsCopyOnWrite = 1 << 8, + AGComparisonOptionsFetchLayoutsSynchronously = 1 << 9, + AGComparisonOptionsReportFailures = 1ul << 31, // -1 signed int }; #endif /* AGComparisonMode_h */ - diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGCounterQueryType.h b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGCounterQueryType.h deleted file mode 100644 index 2a60455..0000000 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGCounterQueryType.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// AGCounterQueryType.h -// -// -// Created by Kyle on 2024/3/8. -// - -#ifndef AGCounterQueryType_h -#define AGCounterQueryType_h - -#include "AGBase.h" - -typedef AG_ENUM(uint32_t, AGCounterQueryType) { - AGCounterQueryType_0, - AGCounterQueryType_1, - AGCounterQueryType_2, - AGCounterQueryType_3, - AGCounterQueryType_4, - AGCounterQueryType_5, - AGCounterQueryType_6, - AGCounterQueryType_7, - AGCounterQueryType_8, - AGCounterQueryType_9, - AGCounterQueryType_10, -}; - -#endif /* AGCounterQueryType_h */ diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraph.h b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraph.h index 1bd7674..65eedf4 100644 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraph.h +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraph.h @@ -10,17 +10,19 @@ #include "AGBase.h" #include "CFRuntime.h" -#include "AGCounterQueryType.h" +#include "AGGraphCounterQuery.h" // Note: Place all structure declaration in a single place to avoid header cycle dependency typedef struct AG_BRIDGED_TYPE(id) AGGraphStorage * AGGraphRef; -typedef struct AG_BRIDGED_TYPE(id) AGGraphContextStorage * AGGraphContextRef; typedef struct AG_BRIDGED_TYPE(id) AGSubgraphStorage * AGSubgraphRef; +typedef void * AGUnownedGraphRef; +typedef struct AGGraphContextStorage * AGUnownedGraphContextRef; + struct AGGraphStorage; -struct AGGraphContextStorage; struct AGSubgraphStorage; +struct AGGraphContextStorage; typedef uint32_t AGAttribute AG_SWIFT_STRUCT AG_SWIFT_NAME(AnyAttribute); @@ -68,7 +70,7 @@ void AGGraphSetContext(AGGraphRef graph, const void * _Nullable context) AG_SWIF AG_EXPORT AG_REFINED_FOR_SWIFT -AGGraphContextRef AGGraphGetGraphContext(AGGraphRef graph) AG_SWIFT_NAME(getter:AGGraphRef.graphContext(self:)); +AGUnownedGraphRef AGGraphGetGraphContext(AGGraphRef graph) AG_SWIFT_NAME(getter:AGGraphRef.graphContext(self:)); AG_EXPORT AG_REFINED_FOR_SWIFT @@ -92,7 +94,7 @@ void AGGraphSetUpdateCallback(AGGraphRef graph, AG_EXPORT AG_REFINED_FOR_SWIFT -uint64_t AGGraphGetCounter(AGGraphRef graph, AGCounterQueryType query) AG_SWIFT_NAME(AGGraphRef.counter(self:for:)); +uint64_t AGGraphGetCounter(AGGraphRef graph, AGGraphCounterQuery query) AG_SWIFT_NAME(AGGraphRef.counter(self:for:)); AG_EXPORT AG_REFINED_FOR_SWIFT diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraphContext.h b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraphContext.h index eee32d0..4d6e84f 100644 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraphContext.h +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraphContext.h @@ -19,7 +19,7 @@ AG_EXTERN_C_BEGIN AG_EXPORT AG_REFINED_FOR_SWIFT -AGGraphRef AGGraphContextGetGraph(AGGraphContextRef context) AG_SWIFT_NAME(getter:AGGraphContextRef.graph(self:)); +AGGraphRef AGGraphContextGetGraph(AGUnownedGraphContextRef context) AG_SWIFT_NAME(getter:AGUnownedGraphContextRef.graph(self:)); AG_EXTERN_C_END diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraphCounterQuery.h b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraphCounterQuery.h new file mode 100644 index 0000000..6fd06d3 --- /dev/null +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGGraphCounterQuery.h @@ -0,0 +1,30 @@ +// +// AGCounterQueryType.h +// +// +// Created by Kyle on 2024/3/8. +// + +#ifndef AGGraphCounterQuery_h +#define AGGraphCounterQuery_h + +#include "AGBase.h" + +typedef AG_ENUM(uint32_t, AGGraphCounterQuery){ + AGGraphCounterQueryNodeCount, + AGGraphCounterQueryTransactionCount, + AGGraphCounterQueryUpdateCount, + AGGraphCounterQueryChangeCount, + AGGraphCounterQueryContextID, + AGGraphCounterQueryGraphID, + AGGraphCounterQueryContextThreadUpdating, + AGGraphCounterQueryThreadUpdating, + AGGraphCounterQueryContextNeedsUpdate, + AGGraphCounterQueryNeedsUpdate, + AGGraphCounterQueryMainThreadUpdateCount, + AGGraphCounterQueryNodeTotalCount, + AGGraphCounterQuerySubgraphCount, + AGGraphCounterQuerySubgraphTotalCount, +}; + +#endif /* AGGraphCounterQuery_h */ diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGSubgraph.h b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGSubgraph.h index 8cf9f2c..461a8b2 100644 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGSubgraph.h +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGSubgraph.h @@ -43,7 +43,7 @@ void AGSubgraphSetCurrent(_Nullable AGSubgraphRef cf_subgraph) AG_SWIFT_NAME(set AG_EXPORT AG_REFINED_FOR_SWIFT -_Nullable AGGraphContextRef AGSubgraphGetCurrentGraphContext(void) AG_SWIFT_NAME(getter:AGSubgraphRef.currentGraphContext()); +_Nullable AGUnownedGraphRef AGSubgraphGetCurrentGraphContext(void) AG_SWIFT_NAME(getter:AGSubgraphRef.currentGraphContext()); AG_EXPORT AG_REFINED_FOR_SWIFT diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGTypeID.h b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGTypeID.h index 002b5f4..585248c 100644 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGTypeID.h +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGTypeID.h @@ -10,10 +10,7 @@ AG_ASSUME_NONNULL_BEGIN -typedef struct AG_SWIFT_NAME(_Metadata) AGSwiftMetadata { -} AGSwiftMetadata; - -typedef const AGSwiftMetadata *AGTypeID AG_SWIFT_STRUCT AG_SWIFT_NAME(Metadata); +typedef const struct AGSwiftMetadata *AGTypeID AG_SWIFT_STRUCT AG_SWIFT_NAME(Metadata); #if ATTRIBUTEGRAPH_RELEASE >= ATTRIBUTEGRAPH_RELEASE_2024 @@ -35,11 +32,11 @@ typedef AG_CLOSED_ENUM(uint32_t, AGTypeKind) { AGTypeKindMetatype, } AG_SWIFT_NAME(Metadata.Kind); -typedef AG_OPTIONS(uint32_t, AGTypeApplyOptions) { - AGTypeApplyOptions_0 = 0, - AGTypeApplyOptions_1 = 1 << 0, - AGTypeApplyOptions_2 = 1 << 1, - AGTypeApplyOptions_4 = 1 << 2, +typedef AG_OPTIONS(uint32_t, AGTypeApplyOptions){ + AGTypeApplyOptionsEnumerateStructFields = 0, + AGTypeApplyOptionsEnumerateClassFields = 1 << 0, + AGTypeApplyOptionsContinueAfterUnknownField = 1 << 1, + AGTypeApplyOptionsEnumerateEnumCases = 1 << 2, }; AG_EXTERN_C_BEGIN diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h index 5341208..eea48a1 100644 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h @@ -8,10 +8,10 @@ #include "AGChangedValueFlags.h" #include "AGCompareValues.h" #include "AGComparisonMode.h" -#include "AGCounterQueryType.h" #include "AGDebugServer.h" #include "AGGraph.h" #include "AGGraphContext.h" +#include "AGGraphCounterQuery.h" #include "AGGraphDescription.h" #include "AGInputOptions.h" #include "AGSearchOptions.h" diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios.swiftinterface b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios.swiftinterface index 168aa6d..c42a5ca 100644 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios.swiftinterface +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios.swiftinterface @@ -1,6 +1,6 @@ // swift-interface-format-version: 1.0 -// swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) -// swift-module-flags: -target arm64e-apple-ios11.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name AttributeGraph +// swift-compiler-version: Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3) +// swift-module-flags: -target arm64e-apple-ios11.0 -enable-objc-interop -enable-library-evolution -swift-version 6 -enforce-exclusivity=checked -O -module-name AttributeGraph // swift-module-flags-ignorable: -enable-bare-slash-regex @_exported import AttributeGraph import Foundation @@ -13,27 +13,27 @@ import _StringProcessing // MARK: - AnyAttribute extension AttributeGraph.AnyAttribute { - public init(_ attribute: AttributeGraph.Attribute) - public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute - public static var current: AnyAttribute? { get } - public func unsafeOffset(at offset: Int) -> AnyAttribute - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - public func visitBody(_ visitor: inout Visitor); - public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> ()) - public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var _bodyType: Any.Type { get } - public var _bodyPointer: UnsafeRawPointer { get } - public var valueType: Any.Type { get } - public var indirectDependency: AnyAttribute? { - get - nonmutating set - } + public init(_ attribute: AttributeGraph.Attribute) + public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute + public static var current: AnyAttribute? { get } + public func unsafeOffset(at offset: Int) -> AnyAttribute + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + public func visitBody(_ visitor: inout Visitor) + public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + public var _bodyType: Any.Type { get } + public var _bodyPointer: UnsafeRawPointer { get } + public var valueType: Any.Type { get } + public var indirectDependency: AnyAttribute? { + get + nonmutating set + } } extension AttributeGraph.AnyAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } public typealias AttributeUpdateBlock = () -> ((Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void) @@ -48,66 +48,74 @@ public struct Attribute { public init(identifier: AnyAttribute) public init(_ attribute: AttributeGraph.Attribute) - public init(value: Value) - public init(type: Value.Type) - public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: AGAttributeTypeFlags, update: AttributeUpdateBlock) - public var wrappedValue: Value { - unsafeAddress - nonmutating set - } - public var projectedValue: AttributeGraph.Attribute { get set } - + public init(value: Value) + public init(type: Value.Type) + public init( + body: Swift.UnsafePointer, + value: Swift.UnsafePointer?, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) + public var wrappedValue: Value { + unsafeAddress + nonmutating set + } + public var projectedValue: AttributeGraph.Attribute { get set } + public subscript(dynamicMember _: Swift.KeyPath) -> AttributeGraph.Attribute { get } public subscript(keyPath _: Swift.KeyPath) -> AttributeGraph.Attribute { get } - public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) -> AttributeGraph.Attribute { get } - - public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute - public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute - public func applying(offset: AttributeGraph.PointerOffset) -> AttributeGraph.Attribute - public func visitBody(_ visitor: inout Body) - public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) - public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - - public var graph: AGGraph { get } - public var subgraph: AGSubgraph { get } - - public var value: Value { - unsafeAddress - nonmutating set - } - public var valueState: AGValueState { get } - public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public func setValue(_ value: Value) -> Bool - public var hasValue: Bool { get } - public func updateValue() - public func prefetchValue() - public func invalidateValue() - public func validate() - - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - - public var flags: AGAttributeFlags { - get - nonmutating set - } - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + { get } + + public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute + public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute + public func applying(offset: AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + public func visitBody(_ visitor: inout Body) + public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + + public var graph: AGGraph { get } + public var subgraph: AGSubgraph { get } + + public var value: Value { + unsafeAddress + nonmutating set + } + public var valueState: AGValueState { get } + public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public func setValue(_ value: Value) -> Bool + public var hasValue: Bool { get } + public func updateValue() + public func prefetchValue() + public func invalidateValue() + public func validate() + + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + + public var flags: AGAttributeFlags { + get + nonmutating set + } + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) } extension AttributeGraph.Attribute: Swift.Hashable { public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool + public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool public var hashValue: Swift.Int { get } } extension AttributeGraph.Attribute: Swift.CustomStringConvertible { - public var description: String { get } + public var description: String { get } } extension AttributeGraph.Attribute { - public init(_ rule: R) where R.Value == Value - public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value } // MARK: - AnyWeakAttribute @@ -115,140 +123,144 @@ extension AttributeGraph.Attribute { public typealias AnyWeakAttribute = AGWeakAttribute extension AttributeGraph.AnyWeakAttribute { - @_alwaysEmitIntoClient - public init(_ attribute: AnyAttribute?) { - self = __AGCreateWeakAttribute(attribute ?? .nil) - } - - @_alwaysEmitIntoClient - public init(_ weakAttribute: AttributeGraph.WeakAttribute) { - self = weakAttribute.base - } - - @_alwaysEmitIntoClient - public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { - WeakAttribute(base: self) - } - - @_alwaysEmitIntoClient - public var attribute: AnyAttribute? { - get { - let attribute = __AGWeakAttributeGetAttribute(self) - return attribute == .nil ? nil : attribute - } - set { - self = AnyWeakAttribute(newValue) - } - } + @_alwaysEmitIntoClient + public init(_ attribute: AnyAttribute?) { + self = __AGCreateWeakAttribute(attribute ?? .nil) + } + + @_alwaysEmitIntoClient + public init(_ weakAttribute: AttributeGraph.WeakAttribute) { + self = weakAttribute.base + } + + @_alwaysEmitIntoClient + public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { + WeakAttribute(base: self) + } + + @_alwaysEmitIntoClient + public var attribute: AnyAttribute? { + get { + let attribute = __AGWeakAttributeGetAttribute(self) + return attribute == .nil ? nil : attribute + } + set { + self = AnyWeakAttribute(newValue) + } + } } extension AttributeGraph.AnyWeakAttribute: Hashable { - @_alwaysEmitIntoClient - public func hash(into hasher: inout Swift.Hasher) { - hasher.combine(raw_attribute) - hasher.combine(subgraph_id) - } + @_alwaysEmitIntoClient + public func hash(into hasher: inout Swift.Hasher) { + hasher.combine(raw_attribute) + hasher.combine(subgraph_id) + } - @_alwaysEmitIntoClient - public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { - lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id - } + @_alwaysEmitIntoClient + public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { + lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id + } - @_alwaysEmitIntoClient - public var hashValue: Int { - _hashValue(for: self) - } + @_alwaysEmitIntoClient + public var hashValue: Int { + _hashValue(for: self) + } } extension AttributeGraph.AnyWeakAttribute: CustomStringConvertible { - @_alwaysEmitIntoClient - public var description: String { - attribute?.description ?? "nil" - } + @_alwaysEmitIntoClient + public var description: String { + attribute?.description ?? "nil" + } } - // MARK: - WeakAttribute @frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - @usableFromInline - internal var base: AnyWeakAttribute - @_alwaysEmitIntoClient - public init(base: AnyWeakAttribute) { self.base = base } - public init() - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public var wrappedValue: Value? { get } - public var projectedValue: AttributeGraph.Attribute?{ get set } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { get } - public var attribute: AttributeGraph.Attribute? { get set _modify } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? + @usableFromInline + internal var base: AnyWeakAttribute + @_alwaysEmitIntoClient + public init(base: AnyWeakAttribute) { self.base = base } + public init() + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public var wrappedValue: Value? { get } + public var projectedValue: AttributeGraph.Attribute? { get set } + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { + get + } + public var attribute: AttributeGraph.Attribute? { get set _modify } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? } extension AttributeGraph.WeakAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.WeakAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - OptionalAttribute @frozen public struct AnyOptionalAttribute { - public init() - public init(_ attribute: AnyAttribute) - public init(_ attribute: AnyAttribute?) - public init(_ attribute: AttributeGraph.OptionalAttribute) - public var identifier: AnyAttribute - public static var current: AttributeGraph.AnyOptionalAttribute { get } - public var attribute: AnyAttribute? { get set } - public func map(_ body: (AnyAttribute) -> Value) -> Value? - public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute + public init() + public init(_ attribute: AnyAttribute) + public init(_ attribute: AnyAttribute?) + public init(_ attribute: AttributeGraph.OptionalAttribute) + public var identifier: AnyAttribute + public static var current: AttributeGraph.AnyOptionalAttribute { get } + public var attribute: AnyAttribute? { get set } + public func map(_ body: (AnyAttribute) -> Value) -> Value? + public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute } extension AttributeGraph.AnyOptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.AnyOptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } @frozen @propertyWrapper @dynamicMemberLookup public struct OptionalAttribute { - public var base: AttributeGraph.AnyOptionalAttribute - public init() - public init(base: AttributeGraph.AnyOptionalAttribute) - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public var attribute: AttributeGraph.Attribute? { get set } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? - public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? - public var wrappedValue: Value? { get } - public var projectedValue: Attribute? { get set _modify } - public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } + public var base: AttributeGraph.AnyOptionalAttribute + public init() + public init(base: AttributeGraph.AnyOptionalAttribute) + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public init(_ weakAttribute: AttributeGraph.WeakAttribute) + public var attribute: AttributeGraph.Attribute? { get set } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? + public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? + public var wrappedValue: Value? { get } + public var projectedValue: Attribute? { get set _modify } + public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } } extension AttributeGraph.OptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - IndirectAttribute @@ -257,36 +269,37 @@ extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { - public let identifier: AnyAttribute - public init(source: AttributeGraph.Attribute) - public var source: AttributeGraph.Attribute { - get - nonmutating set - nonmutating _modify - } - public var dependency: AnyAttribute? { - get - nonmutating set - } - public var value: Value { - get - nonmutating set - nonmutating _modify - } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public var wrappedValue: Value { - get - nonmutating set - nonmutating _modify - } - public var projectedValue: AttributeGraph.Attribute { get } - public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } + public let identifier: AnyAttribute + public init(source: AttributeGraph.Attribute) + public var source: AttributeGraph.Attribute { + get + nonmutating set + nonmutating _modify + } + public var dependency: AnyAttribute? { + get + nonmutating set + } + public var value: Value { + get + nonmutating set + nonmutating _modify + } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public var wrappedValue: Value { + get + nonmutating set + nonmutating _modify + } + public var projectedValue: AttributeGraph.Attribute { get } + public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } } extension AttributeGraph.IndirectAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } // MARK: - _AttributeBody @@ -317,17 +330,17 @@ public protocol AttributeBodyVisitor { @frozen public struct External { - public init() + public init() } extension AttributeGraph.External: AttributeGraph._AttributeBody { - public static var comparisonMode: AGComparisonMode { get } - public static var flags: AGAttributeTypeFlags { get } - public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static var comparisonMode: AGComparisonMode { get } + public static var flags: AGAttributeTypeFlags { get } + public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) } extension AttributeGraph.External: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - Focus @@ -336,28 +349,28 @@ extension AttributeGraph.External: Swift.CustomStringConvertible { public struct Focus { public var root: Attribute public var keyPath: KeyPath - + public init(root: Attribute, keyPath: KeyPath) } extension AttributeGraph.Focus: AttributeGraph.Rule { - public var value: Self.Value { get } - public static var flags: AGAttributeTypeFlags { get } + public var value: Self.Value { get } + public static var flags: AGAttributeTypeFlags { get } } extension AttributeGraph.Focus: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - ObservedAttribute public protocol ObservedAttribute: AttributeGraph._AttributeBody { - func destroy() + func destroy() } extension AttributeGraph.ObservedAttribute { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { get } + public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) + public static var _hasDestroySelf: Swift.Bool { get } } // MARK: - Graph Related @@ -365,65 +378,69 @@ extension AttributeGraph.ObservedAttribute { // MARK: - AGGraph extension AttributeGraph.AGGraph { - public static func typeIndex( - ctx: AGGraphContext, - body: AttributeGraph._AttributeBody.Type, - valueType: Metadata, - flags: AGAttributeTypeFlags, - update: AttributeUpdateBlock - ) -> Int + public static func typeIndex( + ctx: AGUnownedGraphRef, + body: AttributeGraph._AttributeBody.Type, + valueType: Metadata, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) -> Int } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphStartProfiling") - public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStartProfiling") + public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) - @_silgen_name("AGGraphStopProfiling") - public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStopProfiling") + public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphSetInvalidationCallback") - public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) + @_silgen_name("AGGraphSetInvalidationCallback") + public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) - @_silgen_name("AGGraphSetUpdateCallback") - public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) + @_silgen_name("AGGraphSetUpdateCallback") + public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) } extension AttributeGraph.AGGraph { - @_transparent - @inline(__always) - public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: ._10)) } + @_transparent + @inline(__always) + public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: .mainThreadUpdateCount)) } } extension AttributeGraph.AGGraph { - public static func withoutUpdate(_ body: () -> Value) -> Value + public static func withoutUpdate(_ body: () -> Value) -> Value } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphGetOutputValue") - @inline(__always) - @inlinable - public static func outputValue() -> Swift.UnsafePointer? + @_silgen_name("AGGraphGetOutputValue") + @inline(__always) + @inlinable + public static func outputValue() -> Swift.UnsafePointer? - @_silgen_name("AGGraphSetOutputValue") - @inline(__always) - @inlinable - public static func setOutputValue(_ value: Swift.UnsafePointer) + @_silgen_name("AGGraphSetOutputValue") + @inline(__always) + @inlinable + public static func setOutputValue(_ value: Swift.UnsafePointer) } // MARK: - AGSubgraph extension AttributeGraph.AGSubgraph { - public func addObserver(_ observer: () -> Void) -> Swift.Int - public func apply(_ body: () -> Value) -> Value - public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) + public func addObserver(_ observer: () -> Void) -> Swift.Int + public func apply(_ body: () -> Value) -> Value + public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) } extension AttributeGraph.AGSubgraph { - public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) - public static func endTreeElement(value: AttributeGraph.Attribute) - public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) + public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) + public static func endTreeElement(value: AttributeGraph.Attribute) + public static func addTreeValue( + _ value: AttributeGraph.Attribute, + forKey key: Swift.UnsafePointer, + flags: Swift.UInt32 + ) } // MARK: - Rule Related @@ -438,97 +455,114 @@ public protocol Rule: AttributeGraph._AttributeBody { extension AttributeGraph.Rule { public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.Rule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } } extension AttributeGraph.Rule where Self: Swift.Hashable { - public func cachedValueIfExists( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value? + public func cachedValueIfExists( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value? - public func cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value + public func cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value - public static func _cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute?, - hashValue: Swift.Int, - bodyPtr: Swift.UnsafeRawPointer, - update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> () - ) -> Swift.UnsafePointer + public static func _cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute?, + hashValue: Swift.Int, + bodyPtr: Swift.UnsafeRawPointer, + update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void + ) -> Swift.UnsafePointer } // MARK: - StateRule public protocol StatefulRule: AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Value? { get } - mutating func updateValue() + associatedtype Value + static var initialValue: Value? { get } + mutating func updateValue() } extension AttributeGraph.StatefulRule { - public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static var initialValue: Self.Value? { get } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.StatefulRule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool { get } } // MARK: - RuleContext @frozen public struct RuleContext { - public var attribute: AttributeGraph.Attribute - public init(attribute: AttributeGraph.Attribute) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) + public var attribute: AttributeGraph.Attribute + public init(attribute: AttributeGraph.Attribute) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) } // MARK: - AnyRuleContext @frozen public struct AnyRuleContext { - public var attribute: AnyAttribute - public init(attribute: AnyAttribute) - public init(_ context: AttributeGraph.RuleContext) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) - public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext + public var attribute: AnyAttribute + public init(attribute: AnyAttribute) + public init(_ context: AttributeGraph.RuleContext) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) + public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext } // MARK: - Runtime Related // MARK: - CompareValues -public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = ._3) -> Swift.Bool +extension AGComparisonOptions { + public init(mode: AGComparisonMode) +} + +public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = .equatableAlways) -> Swift.Bool public func compareValues(_ lhs: A, _ rhs: A, options: AGComparisonOptions) -> Swift.Bool // MARK: - Metadata +public func forEachField( + of type: Any.Type, + do body: (UnsafePointer, Int, Any.Type) -> Void +) + extension Metadata: Swift.CustomStringConvertible { public init(_ type: Any.Type) public var type: Any.Type { get } @@ -539,83 +573,97 @@ extension Metadata: Swift.CustomStringConvertible { ) -> Bool } +// MARK: - Signature + +extension Signature: Swift.Equatable {} + // MARK: - TupleType extension TupleType { - @_transparent + @_transparent public init(_ types: [Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) } - - @_transparent + + @_transparent public init(_ type: Any.Type) { - self.init(rawValue: unsafeBitCast(type, to: UnsafePointer<_Metadata>.self)) + self.init(rawValue: unsafeBitCast(type, to: OpaquePointer.self)) } - - @_transparent + + @_transparent public var isEmpty: Bool { count == 0 } - @_transparent - public var indices: Range { 0 ..< count } - - @_transparent + @_transparent + public var indices: Range { 0.. Any.Type { elementType(at: index).type } - - @_transparent + + @_transparent public func offset(at index: Int, as type: T.Type) -> Int { elementOffset(at: index, type: Metadata(type)) } - - @_transparent - public func setElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, from srcValue: UnsafePointer, options: CopyOptions) { + + @_transparent + public func setElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + from srcValue: UnsafePointer, + options: CopyOptions + ) { __AGTupleSetElement(self, tupleValue, index, srcValue, Metadata(T.self), options) } - - @_transparent - public func getElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, to dstValue: UnsafeMutablePointer, options: CopyOptions) { + + @_transparent + public func getElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + to dstValue: UnsafeMutablePointer, + options: CopyOptions + ) { __AGTupleGetElement(self, tupleValue, index, dstValue, Metadata(T.self), options) } } @_silgen_name("AGTupleWithBuffer") -public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> ()) +public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> Void) // MARK: - UnsafeTuple extension UnsafeTuple { - @_transparent + @_transparent public var count: Int { type.count } - - @_transparent - public var isEmpty: Bool { type.isEmpty } - - @_transparent - public var indices: Range { type.indices } - - @_transparent + + @_transparent + public var isEmpty: Bool { type.isEmpty } + + @_transparent + public var indices: Range { type.indices } + + @_transparent public func address(as _: T.Type = T.self) -> UnsafePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { address(of: index, as: T.self) } } @@ -630,61 +678,61 @@ extension UnsafeTuple { /*private*/ public func slowDealloc(_ ptr: UnsafeMutableRawPointer, _ size: Int, _ alignMask: Int) extension UnsafeMutableTuple { - @_transparent + @_transparent public init(with tupleType: TupleType) { self.init(type: tupleType, value: slowAlloc(tupleType.size, -1)) } - @_transparent + @_transparent public func initialize(at index: Int, to element: T) { withUnsafePointer(to: element) { elementPointer in type.setElement(in: value, at: index, from: elementPointer, options: .initCopy) } } - @_transparent + @_transparent public func deinitialize() { type.destroy(value) } - @_transparent + @_transparent public func deinitialize(at index: Int) { type.destroy(value, at: index) } - @_transparent + @_transparent public func deallocate(initialized: Bool) { if initialized { deinitialize() } slowDealloc(value, -1, -1) - } - @_transparent + } + @_transparent public var count: Int { type.count } - @_transparent + @_transparent public var isEmpty: Bool { type.isEmpty } - @_transparent + @_transparent public var indices: Range { type.indices } - - @_transparent + + @_transparent public func address(as _: T.Type = T.self) -> UnsafeMutablePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafeMutablePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { UnsafePointer(address(as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { UnsafePointer(address(of: index, as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(of: index, as: T.self) } @@ -724,30 +772,41 @@ public func AGTypeApplyFields2( @frozen public struct PointerOffset { - public var byteOffset: Swift.Int - public init(byteOffset: Swift.Int) + public var byteOffset: Swift.Int + public init(byteOffset: Swift.Int) } extension AttributeGraph.PointerOffset { - public static func + (_ lhs: AttributeGraph.PointerOffset, _ rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset + public static func + ( + _ lhs: AttributeGraph.PointerOffset, + _ rhs: AttributeGraph.PointerOffset + ) -> AttributeGraph.PointerOffset } extension AttributeGraph.PointerOffset { - public static func invalidScenePointer() -> Swift.UnsafeMutablePointer - public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset - public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset + public static func invalidScenePointer() -> Swift.UnsafeMutablePointer + public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset + public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset< + Base, Member + > } extension AttributeGraph.PointerOffset where Base == Member { - public init() + public init() } extension Swift.UnsafePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - } - public static func + (_ lhs: Swift.UnsafePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + } + public static func + ( + _ lhs: Swift.UnsafePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafePointer } extension Swift.UnsafeMutablePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - nonmutating unsafeMutableAddress - } - public static func + (_ lhs: Swift.UnsafeMutablePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + nonmutating unsafeMutableAddress + } + public static func + ( + _ lhs: Swift.UnsafeMutablePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafeMutablePointer } diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64e-apple-ios.swiftinterface b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64e-apple-ios.swiftinterface index 168aa6d..c42a5ca 100644 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64e-apple-ios.swiftinterface +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64e-apple-ios.swiftinterface @@ -1,6 +1,6 @@ // swift-interface-format-version: 1.0 -// swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) -// swift-module-flags: -target arm64e-apple-ios11.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name AttributeGraph +// swift-compiler-version: Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3) +// swift-module-flags: -target arm64e-apple-ios11.0 -enable-objc-interop -enable-library-evolution -swift-version 6 -enforce-exclusivity=checked -O -module-name AttributeGraph // swift-module-flags-ignorable: -enable-bare-slash-regex @_exported import AttributeGraph import Foundation @@ -13,27 +13,27 @@ import _StringProcessing // MARK: - AnyAttribute extension AttributeGraph.AnyAttribute { - public init(_ attribute: AttributeGraph.Attribute) - public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute - public static var current: AnyAttribute? { get } - public func unsafeOffset(at offset: Int) -> AnyAttribute - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - public func visitBody(_ visitor: inout Visitor); - public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> ()) - public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var _bodyType: Any.Type { get } - public var _bodyPointer: UnsafeRawPointer { get } - public var valueType: Any.Type { get } - public var indirectDependency: AnyAttribute? { - get - nonmutating set - } + public init(_ attribute: AttributeGraph.Attribute) + public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute + public static var current: AnyAttribute? { get } + public func unsafeOffset(at offset: Int) -> AnyAttribute + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + public func visitBody(_ visitor: inout Visitor) + public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + public var _bodyType: Any.Type { get } + public var _bodyPointer: UnsafeRawPointer { get } + public var valueType: Any.Type { get } + public var indirectDependency: AnyAttribute? { + get + nonmutating set + } } extension AttributeGraph.AnyAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } public typealias AttributeUpdateBlock = () -> ((Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void) @@ -48,66 +48,74 @@ public struct Attribute { public init(identifier: AnyAttribute) public init(_ attribute: AttributeGraph.Attribute) - public init(value: Value) - public init(type: Value.Type) - public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: AGAttributeTypeFlags, update: AttributeUpdateBlock) - public var wrappedValue: Value { - unsafeAddress - nonmutating set - } - public var projectedValue: AttributeGraph.Attribute { get set } - + public init(value: Value) + public init(type: Value.Type) + public init( + body: Swift.UnsafePointer, + value: Swift.UnsafePointer?, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) + public var wrappedValue: Value { + unsafeAddress + nonmutating set + } + public var projectedValue: AttributeGraph.Attribute { get set } + public subscript(dynamicMember _: Swift.KeyPath) -> AttributeGraph.Attribute { get } public subscript(keyPath _: Swift.KeyPath) -> AttributeGraph.Attribute { get } - public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) -> AttributeGraph.Attribute { get } - - public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute - public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute - public func applying(offset: AttributeGraph.PointerOffset) -> AttributeGraph.Attribute - public func visitBody(_ visitor: inout Body) - public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) - public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - - public var graph: AGGraph { get } - public var subgraph: AGSubgraph { get } - - public var value: Value { - unsafeAddress - nonmutating set - } - public var valueState: AGValueState { get } - public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public func setValue(_ value: Value) -> Bool - public var hasValue: Bool { get } - public func updateValue() - public func prefetchValue() - public func invalidateValue() - public func validate() - - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - - public var flags: AGAttributeFlags { - get - nonmutating set - } - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + { get } + + public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute + public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute + public func applying(offset: AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + public func visitBody(_ visitor: inout Body) + public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + + public var graph: AGGraph { get } + public var subgraph: AGSubgraph { get } + + public var value: Value { + unsafeAddress + nonmutating set + } + public var valueState: AGValueState { get } + public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public func setValue(_ value: Value) -> Bool + public var hasValue: Bool { get } + public func updateValue() + public func prefetchValue() + public func invalidateValue() + public func validate() + + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + + public var flags: AGAttributeFlags { + get + nonmutating set + } + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) } extension AttributeGraph.Attribute: Swift.Hashable { public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool + public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool public var hashValue: Swift.Int { get } } extension AttributeGraph.Attribute: Swift.CustomStringConvertible { - public var description: String { get } + public var description: String { get } } extension AttributeGraph.Attribute { - public init(_ rule: R) where R.Value == Value - public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value } // MARK: - AnyWeakAttribute @@ -115,140 +123,144 @@ extension AttributeGraph.Attribute { public typealias AnyWeakAttribute = AGWeakAttribute extension AttributeGraph.AnyWeakAttribute { - @_alwaysEmitIntoClient - public init(_ attribute: AnyAttribute?) { - self = __AGCreateWeakAttribute(attribute ?? .nil) - } - - @_alwaysEmitIntoClient - public init(_ weakAttribute: AttributeGraph.WeakAttribute) { - self = weakAttribute.base - } - - @_alwaysEmitIntoClient - public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { - WeakAttribute(base: self) - } - - @_alwaysEmitIntoClient - public var attribute: AnyAttribute? { - get { - let attribute = __AGWeakAttributeGetAttribute(self) - return attribute == .nil ? nil : attribute - } - set { - self = AnyWeakAttribute(newValue) - } - } + @_alwaysEmitIntoClient + public init(_ attribute: AnyAttribute?) { + self = __AGCreateWeakAttribute(attribute ?? .nil) + } + + @_alwaysEmitIntoClient + public init(_ weakAttribute: AttributeGraph.WeakAttribute) { + self = weakAttribute.base + } + + @_alwaysEmitIntoClient + public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { + WeakAttribute(base: self) + } + + @_alwaysEmitIntoClient + public var attribute: AnyAttribute? { + get { + let attribute = __AGWeakAttributeGetAttribute(self) + return attribute == .nil ? nil : attribute + } + set { + self = AnyWeakAttribute(newValue) + } + } } extension AttributeGraph.AnyWeakAttribute: Hashable { - @_alwaysEmitIntoClient - public func hash(into hasher: inout Swift.Hasher) { - hasher.combine(raw_attribute) - hasher.combine(subgraph_id) - } + @_alwaysEmitIntoClient + public func hash(into hasher: inout Swift.Hasher) { + hasher.combine(raw_attribute) + hasher.combine(subgraph_id) + } - @_alwaysEmitIntoClient - public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { - lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id - } + @_alwaysEmitIntoClient + public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { + lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id + } - @_alwaysEmitIntoClient - public var hashValue: Int { - _hashValue(for: self) - } + @_alwaysEmitIntoClient + public var hashValue: Int { + _hashValue(for: self) + } } extension AttributeGraph.AnyWeakAttribute: CustomStringConvertible { - @_alwaysEmitIntoClient - public var description: String { - attribute?.description ?? "nil" - } + @_alwaysEmitIntoClient + public var description: String { + attribute?.description ?? "nil" + } } - // MARK: - WeakAttribute @frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - @usableFromInline - internal var base: AnyWeakAttribute - @_alwaysEmitIntoClient - public init(base: AnyWeakAttribute) { self.base = base } - public init() - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public var wrappedValue: Value? { get } - public var projectedValue: AttributeGraph.Attribute?{ get set } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { get } - public var attribute: AttributeGraph.Attribute? { get set _modify } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? + @usableFromInline + internal var base: AnyWeakAttribute + @_alwaysEmitIntoClient + public init(base: AnyWeakAttribute) { self.base = base } + public init() + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public var wrappedValue: Value? { get } + public var projectedValue: AttributeGraph.Attribute? { get set } + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { + get + } + public var attribute: AttributeGraph.Attribute? { get set _modify } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? } extension AttributeGraph.WeakAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.WeakAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - OptionalAttribute @frozen public struct AnyOptionalAttribute { - public init() - public init(_ attribute: AnyAttribute) - public init(_ attribute: AnyAttribute?) - public init(_ attribute: AttributeGraph.OptionalAttribute) - public var identifier: AnyAttribute - public static var current: AttributeGraph.AnyOptionalAttribute { get } - public var attribute: AnyAttribute? { get set } - public func map(_ body: (AnyAttribute) -> Value) -> Value? - public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute + public init() + public init(_ attribute: AnyAttribute) + public init(_ attribute: AnyAttribute?) + public init(_ attribute: AttributeGraph.OptionalAttribute) + public var identifier: AnyAttribute + public static var current: AttributeGraph.AnyOptionalAttribute { get } + public var attribute: AnyAttribute? { get set } + public func map(_ body: (AnyAttribute) -> Value) -> Value? + public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute } extension AttributeGraph.AnyOptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.AnyOptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } @frozen @propertyWrapper @dynamicMemberLookup public struct OptionalAttribute { - public var base: AttributeGraph.AnyOptionalAttribute - public init() - public init(base: AttributeGraph.AnyOptionalAttribute) - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public var attribute: AttributeGraph.Attribute? { get set } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? - public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? - public var wrappedValue: Value? { get } - public var projectedValue: Attribute? { get set _modify } - public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } + public var base: AttributeGraph.AnyOptionalAttribute + public init() + public init(base: AttributeGraph.AnyOptionalAttribute) + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public init(_ weakAttribute: AttributeGraph.WeakAttribute) + public var attribute: AttributeGraph.Attribute? { get set } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? + public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? + public var wrappedValue: Value? { get } + public var projectedValue: Attribute? { get set _modify } + public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } } extension AttributeGraph.OptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - IndirectAttribute @@ -257,36 +269,37 @@ extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { - public let identifier: AnyAttribute - public init(source: AttributeGraph.Attribute) - public var source: AttributeGraph.Attribute { - get - nonmutating set - nonmutating _modify - } - public var dependency: AnyAttribute? { - get - nonmutating set - } - public var value: Value { - get - nonmutating set - nonmutating _modify - } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public var wrappedValue: Value { - get - nonmutating set - nonmutating _modify - } - public var projectedValue: AttributeGraph.Attribute { get } - public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } + public let identifier: AnyAttribute + public init(source: AttributeGraph.Attribute) + public var source: AttributeGraph.Attribute { + get + nonmutating set + nonmutating _modify + } + public var dependency: AnyAttribute? { + get + nonmutating set + } + public var value: Value { + get + nonmutating set + nonmutating _modify + } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public var wrappedValue: Value { + get + nonmutating set + nonmutating _modify + } + public var projectedValue: AttributeGraph.Attribute { get } + public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } } extension AttributeGraph.IndirectAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } // MARK: - _AttributeBody @@ -317,17 +330,17 @@ public protocol AttributeBodyVisitor { @frozen public struct External { - public init() + public init() } extension AttributeGraph.External: AttributeGraph._AttributeBody { - public static var comparisonMode: AGComparisonMode { get } - public static var flags: AGAttributeTypeFlags { get } - public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static var comparisonMode: AGComparisonMode { get } + public static var flags: AGAttributeTypeFlags { get } + public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) } extension AttributeGraph.External: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - Focus @@ -336,28 +349,28 @@ extension AttributeGraph.External: Swift.CustomStringConvertible { public struct Focus { public var root: Attribute public var keyPath: KeyPath - + public init(root: Attribute, keyPath: KeyPath) } extension AttributeGraph.Focus: AttributeGraph.Rule { - public var value: Self.Value { get } - public static var flags: AGAttributeTypeFlags { get } + public var value: Self.Value { get } + public static var flags: AGAttributeTypeFlags { get } } extension AttributeGraph.Focus: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - ObservedAttribute public protocol ObservedAttribute: AttributeGraph._AttributeBody { - func destroy() + func destroy() } extension AttributeGraph.ObservedAttribute { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { get } + public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) + public static var _hasDestroySelf: Swift.Bool { get } } // MARK: - Graph Related @@ -365,65 +378,69 @@ extension AttributeGraph.ObservedAttribute { // MARK: - AGGraph extension AttributeGraph.AGGraph { - public static func typeIndex( - ctx: AGGraphContext, - body: AttributeGraph._AttributeBody.Type, - valueType: Metadata, - flags: AGAttributeTypeFlags, - update: AttributeUpdateBlock - ) -> Int + public static func typeIndex( + ctx: AGUnownedGraphRef, + body: AttributeGraph._AttributeBody.Type, + valueType: Metadata, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) -> Int } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphStartProfiling") - public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStartProfiling") + public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) - @_silgen_name("AGGraphStopProfiling") - public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStopProfiling") + public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphSetInvalidationCallback") - public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) + @_silgen_name("AGGraphSetInvalidationCallback") + public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) - @_silgen_name("AGGraphSetUpdateCallback") - public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) + @_silgen_name("AGGraphSetUpdateCallback") + public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) } extension AttributeGraph.AGGraph { - @_transparent - @inline(__always) - public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: ._10)) } + @_transparent + @inline(__always) + public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: .mainThreadUpdateCount)) } } extension AttributeGraph.AGGraph { - public static func withoutUpdate(_ body: () -> Value) -> Value + public static func withoutUpdate(_ body: () -> Value) -> Value } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphGetOutputValue") - @inline(__always) - @inlinable - public static func outputValue() -> Swift.UnsafePointer? + @_silgen_name("AGGraphGetOutputValue") + @inline(__always) + @inlinable + public static func outputValue() -> Swift.UnsafePointer? - @_silgen_name("AGGraphSetOutputValue") - @inline(__always) - @inlinable - public static func setOutputValue(_ value: Swift.UnsafePointer) + @_silgen_name("AGGraphSetOutputValue") + @inline(__always) + @inlinable + public static func setOutputValue(_ value: Swift.UnsafePointer) } // MARK: - AGSubgraph extension AttributeGraph.AGSubgraph { - public func addObserver(_ observer: () -> Void) -> Swift.Int - public func apply(_ body: () -> Value) -> Value - public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) + public func addObserver(_ observer: () -> Void) -> Swift.Int + public func apply(_ body: () -> Value) -> Value + public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) } extension AttributeGraph.AGSubgraph { - public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) - public static func endTreeElement(value: AttributeGraph.Attribute) - public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) + public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) + public static func endTreeElement(value: AttributeGraph.Attribute) + public static func addTreeValue( + _ value: AttributeGraph.Attribute, + forKey key: Swift.UnsafePointer, + flags: Swift.UInt32 + ) } // MARK: - Rule Related @@ -438,97 +455,114 @@ public protocol Rule: AttributeGraph._AttributeBody { extension AttributeGraph.Rule { public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.Rule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } } extension AttributeGraph.Rule where Self: Swift.Hashable { - public func cachedValueIfExists( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value? + public func cachedValueIfExists( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value? - public func cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value + public func cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value - public static func _cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute?, - hashValue: Swift.Int, - bodyPtr: Swift.UnsafeRawPointer, - update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> () - ) -> Swift.UnsafePointer + public static func _cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute?, + hashValue: Swift.Int, + bodyPtr: Swift.UnsafeRawPointer, + update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void + ) -> Swift.UnsafePointer } // MARK: - StateRule public protocol StatefulRule: AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Value? { get } - mutating func updateValue() + associatedtype Value + static var initialValue: Value? { get } + mutating func updateValue() } extension AttributeGraph.StatefulRule { - public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static var initialValue: Self.Value? { get } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.StatefulRule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool { get } } // MARK: - RuleContext @frozen public struct RuleContext { - public var attribute: AttributeGraph.Attribute - public init(attribute: AttributeGraph.Attribute) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) + public var attribute: AttributeGraph.Attribute + public init(attribute: AttributeGraph.Attribute) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) } // MARK: - AnyRuleContext @frozen public struct AnyRuleContext { - public var attribute: AnyAttribute - public init(attribute: AnyAttribute) - public init(_ context: AttributeGraph.RuleContext) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) - public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext + public var attribute: AnyAttribute + public init(attribute: AnyAttribute) + public init(_ context: AttributeGraph.RuleContext) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) + public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext } // MARK: - Runtime Related // MARK: - CompareValues -public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = ._3) -> Swift.Bool +extension AGComparisonOptions { + public init(mode: AGComparisonMode) +} + +public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = .equatableAlways) -> Swift.Bool public func compareValues(_ lhs: A, _ rhs: A, options: AGComparisonOptions) -> Swift.Bool // MARK: - Metadata +public func forEachField( + of type: Any.Type, + do body: (UnsafePointer, Int, Any.Type) -> Void +) + extension Metadata: Swift.CustomStringConvertible { public init(_ type: Any.Type) public var type: Any.Type { get } @@ -539,83 +573,97 @@ extension Metadata: Swift.CustomStringConvertible { ) -> Bool } +// MARK: - Signature + +extension Signature: Swift.Equatable {} + // MARK: - TupleType extension TupleType { - @_transparent + @_transparent public init(_ types: [Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) } - - @_transparent + + @_transparent public init(_ type: Any.Type) { - self.init(rawValue: unsafeBitCast(type, to: UnsafePointer<_Metadata>.self)) + self.init(rawValue: unsafeBitCast(type, to: OpaquePointer.self)) } - - @_transparent + + @_transparent public var isEmpty: Bool { count == 0 } - @_transparent - public var indices: Range { 0 ..< count } - - @_transparent + @_transparent + public var indices: Range { 0.. Any.Type { elementType(at: index).type } - - @_transparent + + @_transparent public func offset(at index: Int, as type: T.Type) -> Int { elementOffset(at: index, type: Metadata(type)) } - - @_transparent - public func setElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, from srcValue: UnsafePointer, options: CopyOptions) { + + @_transparent + public func setElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + from srcValue: UnsafePointer, + options: CopyOptions + ) { __AGTupleSetElement(self, tupleValue, index, srcValue, Metadata(T.self), options) } - - @_transparent - public func getElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, to dstValue: UnsafeMutablePointer, options: CopyOptions) { + + @_transparent + public func getElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + to dstValue: UnsafeMutablePointer, + options: CopyOptions + ) { __AGTupleGetElement(self, tupleValue, index, dstValue, Metadata(T.self), options) } } @_silgen_name("AGTupleWithBuffer") -public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> ()) +public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> Void) // MARK: - UnsafeTuple extension UnsafeTuple { - @_transparent + @_transparent public var count: Int { type.count } - - @_transparent - public var isEmpty: Bool { type.isEmpty } - - @_transparent - public var indices: Range { type.indices } - - @_transparent + + @_transparent + public var isEmpty: Bool { type.isEmpty } + + @_transparent + public var indices: Range { type.indices } + + @_transparent public func address(as _: T.Type = T.self) -> UnsafePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { address(of: index, as: T.self) } } @@ -630,61 +678,61 @@ extension UnsafeTuple { /*private*/ public func slowDealloc(_ ptr: UnsafeMutableRawPointer, _ size: Int, _ alignMask: Int) extension UnsafeMutableTuple { - @_transparent + @_transparent public init(with tupleType: TupleType) { self.init(type: tupleType, value: slowAlloc(tupleType.size, -1)) } - @_transparent + @_transparent public func initialize(at index: Int, to element: T) { withUnsafePointer(to: element) { elementPointer in type.setElement(in: value, at: index, from: elementPointer, options: .initCopy) } } - @_transparent + @_transparent public func deinitialize() { type.destroy(value) } - @_transparent + @_transparent public func deinitialize(at index: Int) { type.destroy(value, at: index) } - @_transparent + @_transparent public func deallocate(initialized: Bool) { if initialized { deinitialize() } slowDealloc(value, -1, -1) - } - @_transparent + } + @_transparent public var count: Int { type.count } - @_transparent + @_transparent public var isEmpty: Bool { type.isEmpty } - @_transparent + @_transparent public var indices: Range { type.indices } - - @_transparent + + @_transparent public func address(as _: T.Type = T.self) -> UnsafeMutablePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafeMutablePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { UnsafePointer(address(as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { UnsafePointer(address(of: index, as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(of: index, as: T.self) } @@ -724,30 +772,41 @@ public func AGTypeApplyFields2( @frozen public struct PointerOffset { - public var byteOffset: Swift.Int - public init(byteOffset: Swift.Int) + public var byteOffset: Swift.Int + public init(byteOffset: Swift.Int) } extension AttributeGraph.PointerOffset { - public static func + (_ lhs: AttributeGraph.PointerOffset, _ rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset + public static func + ( + _ lhs: AttributeGraph.PointerOffset, + _ rhs: AttributeGraph.PointerOffset + ) -> AttributeGraph.PointerOffset } extension AttributeGraph.PointerOffset { - public static func invalidScenePointer() -> Swift.UnsafeMutablePointer - public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset - public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset + public static func invalidScenePointer() -> Swift.UnsafeMutablePointer + public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset + public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset< + Base, Member + > } extension AttributeGraph.PointerOffset where Base == Member { - public init() + public init() } extension Swift.UnsafePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - } - public static func + (_ lhs: Swift.UnsafePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + } + public static func + ( + _ lhs: Swift.UnsafePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafePointer } extension Swift.UnsafeMutablePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - nonmutating unsafeMutableAddress - } - public static func + (_ lhs: Swift.UnsafeMutablePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + nonmutating unsafeMutableAddress + } + public static func + ( + _ lhs: Swift.UnsafeMutablePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafeMutablePointer } diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGAttributeType.h b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGAttributeType.h index 4229ac2..0579f04 100644 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGAttributeType.h +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGAttributeType.h @@ -1,6 +1,6 @@ // // AGAttributeType.h -// +// // // Created by Kyle on 2024/2/17. // @@ -8,15 +8,35 @@ #ifndef AGAttributeType_h #define AGAttributeType_h +#include "AGAttributeTypeFlags.h" #include "AGBase.h" #include "AGTypeID.h" AG_ASSUME_NONNULL_BEGIN +typedef struct AGClosureStorage { + void *function; + void *context; +} AGClosureStorage; + +typedef struct AGAttributeVTable { +} AGAttributeVTable; + typedef struct AGAttributeType { AGTypeID typeID; AGTypeID valueTypeID; - // TODO + + AGClosureStorage updateClosure; + + AGAttributeVTable *_Nullable callbacks; + AGAttributeTypeFlags flags; + + // set after construction + uint32_t offset; + const unsigned char *_Nullable layout; + + AGTypeID initialTypeID; + void *initialBodyTypeID; } AGAttributeType; AG_ASSUME_NONNULL_END diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGCompareValues.h b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGCompareValues.h index 2fc6604..398c60b 100644 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGCompareValues.h +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGCompareValues.h @@ -12,9 +12,15 @@ #include "AGComparisonMode.h" AG_EXTERN_C_BEGIN + AG_EXPORT AG_REFINED_FOR_SWIFT bool AGCompareValues(const void *lhs, const void *rhs, const void *type, const AGComparisonMode comparisonMode); + +AG_EXPORT +AG_REFINED_FOR_SWIFT +const unsigned char *_Nullable AGPrefetchCompareValues(AGTypeID type, AGComparisonOptions options, uint32_t priority); + AG_EXTERN_C_END #endif /* AGCompareValues_h */ diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGComparisonMode.h b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGComparisonMode.h index b4a5b9f..ec83f07 100644 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGComparisonMode.h +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGComparisonMode.h @@ -10,19 +10,19 @@ #include "AGBase.h" -typedef AG_OPTIONS(uint32_t, AGComparisonMode) { - AGComparisonMode_0 = 0, - AGComparisonMode_1 = 1 << 0, - AGComparisonMode_2 = 1 << 1, - AGComparisonMode_3 = AGComparisonMode_1 | AGComparisonMode_2, +typedef AG_ENUM(uint8_t, AGComparisonMode){ + AGComparisonModeBitwise = 0, + AGComparisonModeIndirect = 1, + AGComparisonModeEquatableUnlessPOD = 2, + AGComparisonModeEquatableAlways = 3, }; -typedef AG_OPTIONS(uint32_t, AGComparisonOptions) { - AGComparisonOptions_0 = 0, - AGComparisonOptions_1 = 1 << 0, - AGComparisonOptions_2 = 1 << 1, - AGComparisonOptions_3 = AGComparisonOptions_1 | AGComparisonOptions_2, +typedef AG_OPTIONS(uint32_t, AGComparisonOptions){ + AGComparisonOptionsComparisonModeMask = 0xff, + + AGComparisonOptionsCopyOnWrite = 1 << 8, + AGComparisonOptionsFetchLayoutsSynchronously = 1 << 9, + AGComparisonOptionsReportFailures = 1ul << 31, // -1 signed int }; #endif /* AGComparisonMode_h */ - diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGCounterQueryType.h b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGCounterQueryType.h deleted file mode 100644 index 2a60455..0000000 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGCounterQueryType.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// AGCounterQueryType.h -// -// -// Created by Kyle on 2024/3/8. -// - -#ifndef AGCounterQueryType_h -#define AGCounterQueryType_h - -#include "AGBase.h" - -typedef AG_ENUM(uint32_t, AGCounterQueryType) { - AGCounterQueryType_0, - AGCounterQueryType_1, - AGCounterQueryType_2, - AGCounterQueryType_3, - AGCounterQueryType_4, - AGCounterQueryType_5, - AGCounterQueryType_6, - AGCounterQueryType_7, - AGCounterQueryType_8, - AGCounterQueryType_9, - AGCounterQueryType_10, -}; - -#endif /* AGCounterQueryType_h */ diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraph.h b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraph.h index 1bd7674..65eedf4 100644 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraph.h +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraph.h @@ -10,17 +10,19 @@ #include "AGBase.h" #include "CFRuntime.h" -#include "AGCounterQueryType.h" +#include "AGGraphCounterQuery.h" // Note: Place all structure declaration in a single place to avoid header cycle dependency typedef struct AG_BRIDGED_TYPE(id) AGGraphStorage * AGGraphRef; -typedef struct AG_BRIDGED_TYPE(id) AGGraphContextStorage * AGGraphContextRef; typedef struct AG_BRIDGED_TYPE(id) AGSubgraphStorage * AGSubgraphRef; +typedef void * AGUnownedGraphRef; +typedef struct AGGraphContextStorage * AGUnownedGraphContextRef; + struct AGGraphStorage; -struct AGGraphContextStorage; struct AGSubgraphStorage; +struct AGGraphContextStorage; typedef uint32_t AGAttribute AG_SWIFT_STRUCT AG_SWIFT_NAME(AnyAttribute); @@ -68,7 +70,7 @@ void AGGraphSetContext(AGGraphRef graph, const void * _Nullable context) AG_SWIF AG_EXPORT AG_REFINED_FOR_SWIFT -AGGraphContextRef AGGraphGetGraphContext(AGGraphRef graph) AG_SWIFT_NAME(getter:AGGraphRef.graphContext(self:)); +AGUnownedGraphRef AGGraphGetGraphContext(AGGraphRef graph) AG_SWIFT_NAME(getter:AGGraphRef.graphContext(self:)); AG_EXPORT AG_REFINED_FOR_SWIFT @@ -92,7 +94,7 @@ void AGGraphSetUpdateCallback(AGGraphRef graph, AG_EXPORT AG_REFINED_FOR_SWIFT -uint64_t AGGraphGetCounter(AGGraphRef graph, AGCounterQueryType query) AG_SWIFT_NAME(AGGraphRef.counter(self:for:)); +uint64_t AGGraphGetCounter(AGGraphRef graph, AGGraphCounterQuery query) AG_SWIFT_NAME(AGGraphRef.counter(self:for:)); AG_EXPORT AG_REFINED_FOR_SWIFT diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraphContext.h b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraphContext.h index eee32d0..4d6e84f 100644 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraphContext.h +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraphContext.h @@ -19,7 +19,7 @@ AG_EXTERN_C_BEGIN AG_EXPORT AG_REFINED_FOR_SWIFT -AGGraphRef AGGraphContextGetGraph(AGGraphContextRef context) AG_SWIFT_NAME(getter:AGGraphContextRef.graph(self:)); +AGGraphRef AGGraphContextGetGraph(AGUnownedGraphContextRef context) AG_SWIFT_NAME(getter:AGUnownedGraphContextRef.graph(self:)); AG_EXTERN_C_END diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraphCounterQuery.h b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraphCounterQuery.h new file mode 100644 index 0000000..6fd06d3 --- /dev/null +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGGraphCounterQuery.h @@ -0,0 +1,30 @@ +// +// AGCounterQueryType.h +// +// +// Created by Kyle on 2024/3/8. +// + +#ifndef AGGraphCounterQuery_h +#define AGGraphCounterQuery_h + +#include "AGBase.h" + +typedef AG_ENUM(uint32_t, AGGraphCounterQuery){ + AGGraphCounterQueryNodeCount, + AGGraphCounterQueryTransactionCount, + AGGraphCounterQueryUpdateCount, + AGGraphCounterQueryChangeCount, + AGGraphCounterQueryContextID, + AGGraphCounterQueryGraphID, + AGGraphCounterQueryContextThreadUpdating, + AGGraphCounterQueryThreadUpdating, + AGGraphCounterQueryContextNeedsUpdate, + AGGraphCounterQueryNeedsUpdate, + AGGraphCounterQueryMainThreadUpdateCount, + AGGraphCounterQueryNodeTotalCount, + AGGraphCounterQuerySubgraphCount, + AGGraphCounterQuerySubgraphTotalCount, +}; + +#endif /* AGGraphCounterQuery_h */ diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGSubgraph.h b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGSubgraph.h index 8cf9f2c..461a8b2 100644 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGSubgraph.h +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGSubgraph.h @@ -43,7 +43,7 @@ void AGSubgraphSetCurrent(_Nullable AGSubgraphRef cf_subgraph) AG_SWIFT_NAME(set AG_EXPORT AG_REFINED_FOR_SWIFT -_Nullable AGGraphContextRef AGSubgraphGetCurrentGraphContext(void) AG_SWIFT_NAME(getter:AGSubgraphRef.currentGraphContext()); +_Nullable AGUnownedGraphRef AGSubgraphGetCurrentGraphContext(void) AG_SWIFT_NAME(getter:AGSubgraphRef.currentGraphContext()); AG_EXPORT AG_REFINED_FOR_SWIFT diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGTypeID.h b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGTypeID.h index 002b5f4..585248c 100644 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGTypeID.h +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGTypeID.h @@ -10,10 +10,7 @@ AG_ASSUME_NONNULL_BEGIN -typedef struct AG_SWIFT_NAME(_Metadata) AGSwiftMetadata { -} AGSwiftMetadata; - -typedef const AGSwiftMetadata *AGTypeID AG_SWIFT_STRUCT AG_SWIFT_NAME(Metadata); +typedef const struct AGSwiftMetadata *AGTypeID AG_SWIFT_STRUCT AG_SWIFT_NAME(Metadata); #if ATTRIBUTEGRAPH_RELEASE >= ATTRIBUTEGRAPH_RELEASE_2024 @@ -35,11 +32,11 @@ typedef AG_CLOSED_ENUM(uint32_t, AGTypeKind) { AGTypeKindMetatype, } AG_SWIFT_NAME(Metadata.Kind); -typedef AG_OPTIONS(uint32_t, AGTypeApplyOptions) { - AGTypeApplyOptions_0 = 0, - AGTypeApplyOptions_1 = 1 << 0, - AGTypeApplyOptions_2 = 1 << 1, - AGTypeApplyOptions_4 = 1 << 2, +typedef AG_OPTIONS(uint32_t, AGTypeApplyOptions){ + AGTypeApplyOptionsEnumerateStructFields = 0, + AGTypeApplyOptionsEnumerateClassFields = 1 << 0, + AGTypeApplyOptionsContinueAfterUnknownField = 1 << 1, + AGTypeApplyOptionsEnumerateEnumCases = 1 << 2, }; AG_EXTERN_C_BEGIN diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h index 5341208..eea48a1 100644 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h @@ -8,10 +8,10 @@ #include "AGChangedValueFlags.h" #include "AGCompareValues.h" #include "AGComparisonMode.h" -#include "AGCounterQueryType.h" #include "AGDebugServer.h" #include "AGGraph.h" #include "AGGraphContext.h" +#include "AGGraphCounterQuery.h" #include "AGGraphDescription.h" #include "AGInputOptions.h" #include "AGSearchOptions.h" diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios-simulator.swiftinterface b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios-simulator.swiftinterface index 189718d..331e455 100644 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios-simulator.swiftinterface +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios-simulator.swiftinterface @@ -1,6 +1,6 @@ // swift-interface-format-version: 1.0 -// swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) -// swift-module-flags: -target arm64-apple-ios11.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name AttributeGraph +// swift-compiler-version: Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3) +// swift-module-flags: -target arm64-apple-ios11.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 6 -enforce-exclusivity=checked -O -module-name AttributeGraph // swift-module-flags-ignorable: -enable-bare-slash-regex @_exported import AttributeGraph import Foundation @@ -13,27 +13,27 @@ import _StringProcessing // MARK: - AnyAttribute extension AttributeGraph.AnyAttribute { - public init(_ attribute: AttributeGraph.Attribute) - public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute - public static var current: AnyAttribute? { get } - public func unsafeOffset(at offset: Int) -> AnyAttribute - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - public func visitBody(_ visitor: inout Visitor); - public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> ()) - public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var _bodyType: Any.Type { get } - public var _bodyPointer: UnsafeRawPointer { get } - public var valueType: Any.Type { get } - public var indirectDependency: AnyAttribute? { - get - nonmutating set - } + public init(_ attribute: AttributeGraph.Attribute) + public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute + public static var current: AnyAttribute? { get } + public func unsafeOffset(at offset: Int) -> AnyAttribute + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + public func visitBody(_ visitor: inout Visitor) + public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + public var _bodyType: Any.Type { get } + public var _bodyPointer: UnsafeRawPointer { get } + public var valueType: Any.Type { get } + public var indirectDependency: AnyAttribute? { + get + nonmutating set + } } extension AttributeGraph.AnyAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } public typealias AttributeUpdateBlock = () -> ((Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void) @@ -48,66 +48,74 @@ public struct Attribute { public init(identifier: AnyAttribute) public init(_ attribute: AttributeGraph.Attribute) - public init(value: Value) - public init(type: Value.Type) - public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: AGAttributeTypeFlags, update: AttributeUpdateBlock) - public var wrappedValue: Value { - unsafeAddress - nonmutating set - } - public var projectedValue: AttributeGraph.Attribute { get set } - + public init(value: Value) + public init(type: Value.Type) + public init( + body: Swift.UnsafePointer, + value: Swift.UnsafePointer?, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) + public var wrappedValue: Value { + unsafeAddress + nonmutating set + } + public var projectedValue: AttributeGraph.Attribute { get set } + public subscript(dynamicMember _: Swift.KeyPath) -> AttributeGraph.Attribute { get } public subscript(keyPath _: Swift.KeyPath) -> AttributeGraph.Attribute { get } - public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) -> AttributeGraph.Attribute { get } - - public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute - public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute - public func applying(offset: AttributeGraph.PointerOffset) -> AttributeGraph.Attribute - public func visitBody(_ visitor: inout Body) - public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) - public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - - public var graph: AGGraph { get } - public var subgraph: AGSubgraph { get } - - public var value: Value { - unsafeAddress - nonmutating set - } - public var valueState: AGValueState { get } - public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public func setValue(_ value: Value) -> Bool - public var hasValue: Bool { get } - public func updateValue() - public func prefetchValue() - public func invalidateValue() - public func validate() - - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - - public var flags: AGAttributeFlags { - get - nonmutating set - } - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + { get } + + public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute + public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute + public func applying(offset: AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + public func visitBody(_ visitor: inout Body) + public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + + public var graph: AGGraph { get } + public var subgraph: AGSubgraph { get } + + public var value: Value { + unsafeAddress + nonmutating set + } + public var valueState: AGValueState { get } + public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public func setValue(_ value: Value) -> Bool + public var hasValue: Bool { get } + public func updateValue() + public func prefetchValue() + public func invalidateValue() + public func validate() + + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + + public var flags: AGAttributeFlags { + get + nonmutating set + } + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) } extension AttributeGraph.Attribute: Swift.Hashable { public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool + public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool public var hashValue: Swift.Int { get } } extension AttributeGraph.Attribute: Swift.CustomStringConvertible { - public var description: String { get } + public var description: String { get } } extension AttributeGraph.Attribute { - public init(_ rule: R) where R.Value == Value - public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value } // MARK: - AnyWeakAttribute @@ -115,140 +123,144 @@ extension AttributeGraph.Attribute { public typealias AnyWeakAttribute = AGWeakAttribute extension AttributeGraph.AnyWeakAttribute { - @_alwaysEmitIntoClient - public init(_ attribute: AnyAttribute?) { - self = __AGCreateWeakAttribute(attribute ?? .nil) - } - - @_alwaysEmitIntoClient - public init(_ weakAttribute: AttributeGraph.WeakAttribute) { - self = weakAttribute.base - } - - @_alwaysEmitIntoClient - public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { - WeakAttribute(base: self) - } - - @_alwaysEmitIntoClient - public var attribute: AnyAttribute? { - get { - let attribute = __AGWeakAttributeGetAttribute(self) - return attribute == .nil ? nil : attribute - } - set { - self = AnyWeakAttribute(newValue) - } - } + @_alwaysEmitIntoClient + public init(_ attribute: AnyAttribute?) { + self = __AGCreateWeakAttribute(attribute ?? .nil) + } + + @_alwaysEmitIntoClient + public init(_ weakAttribute: AttributeGraph.WeakAttribute) { + self = weakAttribute.base + } + + @_alwaysEmitIntoClient + public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { + WeakAttribute(base: self) + } + + @_alwaysEmitIntoClient + public var attribute: AnyAttribute? { + get { + let attribute = __AGWeakAttributeGetAttribute(self) + return attribute == .nil ? nil : attribute + } + set { + self = AnyWeakAttribute(newValue) + } + } } extension AttributeGraph.AnyWeakAttribute: Hashable { - @_alwaysEmitIntoClient - public func hash(into hasher: inout Swift.Hasher) { - hasher.combine(raw_attribute) - hasher.combine(subgraph_id) - } + @_alwaysEmitIntoClient + public func hash(into hasher: inout Swift.Hasher) { + hasher.combine(raw_attribute) + hasher.combine(subgraph_id) + } - @_alwaysEmitIntoClient - public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { - lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id - } + @_alwaysEmitIntoClient + public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { + lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id + } - @_alwaysEmitIntoClient - public var hashValue: Int { - _hashValue(for: self) - } + @_alwaysEmitIntoClient + public var hashValue: Int { + _hashValue(for: self) + } } extension AttributeGraph.AnyWeakAttribute: CustomStringConvertible { - @_alwaysEmitIntoClient - public var description: String { - attribute?.description ?? "nil" - } + @_alwaysEmitIntoClient + public var description: String { + attribute?.description ?? "nil" + } } - // MARK: - WeakAttribute @frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - @usableFromInline - internal var base: AnyWeakAttribute - @_alwaysEmitIntoClient - public init(base: AnyWeakAttribute) { self.base = base } - public init() - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public var wrappedValue: Value? { get } - public var projectedValue: AttributeGraph.Attribute?{ get set } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { get } - public var attribute: AttributeGraph.Attribute? { get set _modify } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? + @usableFromInline + internal var base: AnyWeakAttribute + @_alwaysEmitIntoClient + public init(base: AnyWeakAttribute) { self.base = base } + public init() + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public var wrappedValue: Value? { get } + public var projectedValue: AttributeGraph.Attribute? { get set } + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { + get + } + public var attribute: AttributeGraph.Attribute? { get set _modify } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? } extension AttributeGraph.WeakAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.WeakAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - OptionalAttribute @frozen public struct AnyOptionalAttribute { - public init() - public init(_ attribute: AnyAttribute) - public init(_ attribute: AnyAttribute?) - public init(_ attribute: AttributeGraph.OptionalAttribute) - public var identifier: AnyAttribute - public static var current: AttributeGraph.AnyOptionalAttribute { get } - public var attribute: AnyAttribute? { get set } - public func map(_ body: (AnyAttribute) -> Value) -> Value? - public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute + public init() + public init(_ attribute: AnyAttribute) + public init(_ attribute: AnyAttribute?) + public init(_ attribute: AttributeGraph.OptionalAttribute) + public var identifier: AnyAttribute + public static var current: AttributeGraph.AnyOptionalAttribute { get } + public var attribute: AnyAttribute? { get set } + public func map(_ body: (AnyAttribute) -> Value) -> Value? + public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute } extension AttributeGraph.AnyOptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.AnyOptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } @frozen @propertyWrapper @dynamicMemberLookup public struct OptionalAttribute { - public var base: AttributeGraph.AnyOptionalAttribute - public init() - public init(base: AttributeGraph.AnyOptionalAttribute) - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public var attribute: AttributeGraph.Attribute? { get set } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? - public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? - public var wrappedValue: Value? { get } - public var projectedValue: Attribute? { get set _modify } - public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } + public var base: AttributeGraph.AnyOptionalAttribute + public init() + public init(base: AttributeGraph.AnyOptionalAttribute) + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public init(_ weakAttribute: AttributeGraph.WeakAttribute) + public var attribute: AttributeGraph.Attribute? { get set } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? + public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? + public var wrappedValue: Value? { get } + public var projectedValue: Attribute? { get set _modify } + public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } } extension AttributeGraph.OptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - IndirectAttribute @@ -257,36 +269,37 @@ extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { - public let identifier: AnyAttribute - public init(source: AttributeGraph.Attribute) - public var source: AttributeGraph.Attribute { - get - nonmutating set - nonmutating _modify - } - public var dependency: AnyAttribute? { - get - nonmutating set - } - public var value: Value { - get - nonmutating set - nonmutating _modify - } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public var wrappedValue: Value { - get - nonmutating set - nonmutating _modify - } - public var projectedValue: AttributeGraph.Attribute { get } - public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } + public let identifier: AnyAttribute + public init(source: AttributeGraph.Attribute) + public var source: AttributeGraph.Attribute { + get + nonmutating set + nonmutating _modify + } + public var dependency: AnyAttribute? { + get + nonmutating set + } + public var value: Value { + get + nonmutating set + nonmutating _modify + } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public var wrappedValue: Value { + get + nonmutating set + nonmutating _modify + } + public var projectedValue: AttributeGraph.Attribute { get } + public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } } extension AttributeGraph.IndirectAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } // MARK: - _AttributeBody @@ -317,17 +330,17 @@ public protocol AttributeBodyVisitor { @frozen public struct External { - public init() + public init() } extension AttributeGraph.External: AttributeGraph._AttributeBody { - public static var comparisonMode: AGComparisonMode { get } - public static var flags: AGAttributeTypeFlags { get } - public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static var comparisonMode: AGComparisonMode { get } + public static var flags: AGAttributeTypeFlags { get } + public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) } extension AttributeGraph.External: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - Focus @@ -336,28 +349,28 @@ extension AttributeGraph.External: Swift.CustomStringConvertible { public struct Focus { public var root: Attribute public var keyPath: KeyPath - + public init(root: Attribute, keyPath: KeyPath) } extension AttributeGraph.Focus: AttributeGraph.Rule { - public var value: Self.Value { get } - public static var flags: AGAttributeTypeFlags { get } + public var value: Self.Value { get } + public static var flags: AGAttributeTypeFlags { get } } extension AttributeGraph.Focus: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - ObservedAttribute public protocol ObservedAttribute: AttributeGraph._AttributeBody { - func destroy() + func destroy() } extension AttributeGraph.ObservedAttribute { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { get } + public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) + public static var _hasDestroySelf: Swift.Bool { get } } // MARK: - Graph Related @@ -365,65 +378,69 @@ extension AttributeGraph.ObservedAttribute { // MARK: - AGGraph extension AttributeGraph.AGGraph { - public static func typeIndex( - ctx: AGGraphContext, - body: AttributeGraph._AttributeBody.Type, - valueType: Metadata, - flags: AGAttributeTypeFlags, - update: AttributeUpdateBlock - ) -> Int + public static func typeIndex( + ctx: AGUnownedGraphRef, + body: AttributeGraph._AttributeBody.Type, + valueType: Metadata, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) -> Int } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphStartProfiling") - public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStartProfiling") + public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) - @_silgen_name("AGGraphStopProfiling") - public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStopProfiling") + public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphSetInvalidationCallback") - public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) + @_silgen_name("AGGraphSetInvalidationCallback") + public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) - @_silgen_name("AGGraphSetUpdateCallback") - public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) + @_silgen_name("AGGraphSetUpdateCallback") + public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) } extension AttributeGraph.AGGraph { - @_transparent - @inline(__always) - public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: ._10)) } + @_transparent + @inline(__always) + public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: .mainThreadUpdateCount)) } } extension AttributeGraph.AGGraph { - public static func withoutUpdate(_ body: () -> Value) -> Value + public static func withoutUpdate(_ body: () -> Value) -> Value } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphGetOutputValue") - @inline(__always) - @inlinable - public static func outputValue() -> Swift.UnsafePointer? + @_silgen_name("AGGraphGetOutputValue") + @inline(__always) + @inlinable + public static func outputValue() -> Swift.UnsafePointer? - @_silgen_name("AGGraphSetOutputValue") - @inline(__always) - @inlinable - public static func setOutputValue(_ value: Swift.UnsafePointer) + @_silgen_name("AGGraphSetOutputValue") + @inline(__always) + @inlinable + public static func setOutputValue(_ value: Swift.UnsafePointer) } // MARK: - AGSubgraph extension AttributeGraph.AGSubgraph { - public func addObserver(_ observer: () -> Void) -> Swift.Int - public func apply(_ body: () -> Value) -> Value - public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) + public func addObserver(_ observer: () -> Void) -> Swift.Int + public func apply(_ body: () -> Value) -> Value + public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) } extension AttributeGraph.AGSubgraph { - public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) - public static func endTreeElement(value: AttributeGraph.Attribute) - public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) + public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) + public static func endTreeElement(value: AttributeGraph.Attribute) + public static func addTreeValue( + _ value: AttributeGraph.Attribute, + forKey key: Swift.UnsafePointer, + flags: Swift.UInt32 + ) } // MARK: - Rule Related @@ -438,97 +455,114 @@ public protocol Rule: AttributeGraph._AttributeBody { extension AttributeGraph.Rule { public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.Rule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } } extension AttributeGraph.Rule where Self: Swift.Hashable { - public func cachedValueIfExists( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value? + public func cachedValueIfExists( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value? - public func cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value + public func cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value - public static func _cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute?, - hashValue: Swift.Int, - bodyPtr: Swift.UnsafeRawPointer, - update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> () - ) -> Swift.UnsafePointer + public static func _cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute?, + hashValue: Swift.Int, + bodyPtr: Swift.UnsafeRawPointer, + update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void + ) -> Swift.UnsafePointer } // MARK: - StateRule public protocol StatefulRule: AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Value? { get } - mutating func updateValue() + associatedtype Value + static var initialValue: Value? { get } + mutating func updateValue() } extension AttributeGraph.StatefulRule { - public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static var initialValue: Self.Value? { get } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.StatefulRule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool { get } } // MARK: - RuleContext @frozen public struct RuleContext { - public var attribute: AttributeGraph.Attribute - public init(attribute: AttributeGraph.Attribute) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) + public var attribute: AttributeGraph.Attribute + public init(attribute: AttributeGraph.Attribute) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) } // MARK: - AnyRuleContext @frozen public struct AnyRuleContext { - public var attribute: AnyAttribute - public init(attribute: AnyAttribute) - public init(_ context: AttributeGraph.RuleContext) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) - public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext + public var attribute: AnyAttribute + public init(attribute: AnyAttribute) + public init(_ context: AttributeGraph.RuleContext) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) + public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext } // MARK: - Runtime Related // MARK: - CompareValues -public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = ._3) -> Swift.Bool +extension AGComparisonOptions { + public init(mode: AGComparisonMode) +} + +public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = .equatableAlways) -> Swift.Bool public func compareValues(_ lhs: A, _ rhs: A, options: AGComparisonOptions) -> Swift.Bool // MARK: - Metadata +public func forEachField( + of type: Any.Type, + do body: (UnsafePointer, Int, Any.Type) -> Void +) + extension Metadata: Swift.CustomStringConvertible { public init(_ type: Any.Type) public var type: Any.Type { get } @@ -539,83 +573,97 @@ extension Metadata: Swift.CustomStringConvertible { ) -> Bool } +// MARK: - Signature + +extension Signature: Swift.Equatable {} + // MARK: - TupleType extension TupleType { - @_transparent + @_transparent public init(_ types: [Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) } - - @_transparent + + @_transparent public init(_ type: Any.Type) { - self.init(rawValue: unsafeBitCast(type, to: UnsafePointer<_Metadata>.self)) + self.init(rawValue: unsafeBitCast(type, to: OpaquePointer.self)) } - - @_transparent + + @_transparent public var isEmpty: Bool { count == 0 } - @_transparent - public var indices: Range { 0 ..< count } - - @_transparent + @_transparent + public var indices: Range { 0.. Any.Type { elementType(at: index).type } - - @_transparent + + @_transparent public func offset(at index: Int, as type: T.Type) -> Int { elementOffset(at: index, type: Metadata(type)) } - - @_transparent - public func setElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, from srcValue: UnsafePointer, options: CopyOptions) { + + @_transparent + public func setElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + from srcValue: UnsafePointer, + options: CopyOptions + ) { __AGTupleSetElement(self, tupleValue, index, srcValue, Metadata(T.self), options) } - - @_transparent - public func getElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, to dstValue: UnsafeMutablePointer, options: CopyOptions) { + + @_transparent + public func getElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + to dstValue: UnsafeMutablePointer, + options: CopyOptions + ) { __AGTupleGetElement(self, tupleValue, index, dstValue, Metadata(T.self), options) } } @_silgen_name("AGTupleWithBuffer") -public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> ()) +public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> Void) // MARK: - UnsafeTuple extension UnsafeTuple { - @_transparent + @_transparent public var count: Int { type.count } - - @_transparent - public var isEmpty: Bool { type.isEmpty } - - @_transparent - public var indices: Range { type.indices } - - @_transparent + + @_transparent + public var isEmpty: Bool { type.isEmpty } + + @_transparent + public var indices: Range { type.indices } + + @_transparent public func address(as _: T.Type = T.self) -> UnsafePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { address(of: index, as: T.self) } } @@ -630,61 +678,61 @@ extension UnsafeTuple { /*private*/ public func slowDealloc(_ ptr: UnsafeMutableRawPointer, _ size: Int, _ alignMask: Int) extension UnsafeMutableTuple { - @_transparent + @_transparent public init(with tupleType: TupleType) { self.init(type: tupleType, value: slowAlloc(tupleType.size, -1)) } - @_transparent + @_transparent public func initialize(at index: Int, to element: T) { withUnsafePointer(to: element) { elementPointer in type.setElement(in: value, at: index, from: elementPointer, options: .initCopy) } } - @_transparent + @_transparent public func deinitialize() { type.destroy(value) } - @_transparent + @_transparent public func deinitialize(at index: Int) { type.destroy(value, at: index) } - @_transparent + @_transparent public func deallocate(initialized: Bool) { if initialized { deinitialize() } slowDealloc(value, -1, -1) - } - @_transparent + } + @_transparent public var count: Int { type.count } - @_transparent + @_transparent public var isEmpty: Bool { type.isEmpty } - @_transparent + @_transparent public var indices: Range { type.indices } - - @_transparent + + @_transparent public func address(as _: T.Type = T.self) -> UnsafeMutablePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafeMutablePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { UnsafePointer(address(as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { UnsafePointer(address(of: index, as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(of: index, as: T.self) } @@ -724,30 +772,41 @@ public func AGTypeApplyFields2( @frozen public struct PointerOffset { - public var byteOffset: Swift.Int - public init(byteOffset: Swift.Int) + public var byteOffset: Swift.Int + public init(byteOffset: Swift.Int) } extension AttributeGraph.PointerOffset { - public static func + (_ lhs: AttributeGraph.PointerOffset, _ rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset + public static func + ( + _ lhs: AttributeGraph.PointerOffset, + _ rhs: AttributeGraph.PointerOffset + ) -> AttributeGraph.PointerOffset } extension AttributeGraph.PointerOffset { - public static func invalidScenePointer() -> Swift.UnsafeMutablePointer - public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset - public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset + public static func invalidScenePointer() -> Swift.UnsafeMutablePointer + public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset + public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset< + Base, Member + > } extension AttributeGraph.PointerOffset where Base == Member { - public init() + public init() } extension Swift.UnsafePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - } - public static func + (_ lhs: Swift.UnsafePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + } + public static func + ( + _ lhs: Swift.UnsafePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafePointer } extension Swift.UnsafeMutablePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - nonmutating unsafeMutableAddress - } - public static func + (_ lhs: Swift.UnsafeMutablePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + nonmutating unsafeMutableAddress + } + public static func + ( + _ lhs: Swift.UnsafeMutablePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafeMutablePointer } diff --git a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-ios-simulator.swiftinterface b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-ios-simulator.swiftinterface index 36582ec..72a0c79 100644 --- a/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +++ b/AG/2024/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-ios-simulator.swiftinterface @@ -1,6 +1,6 @@ // swift-interface-format-version: 1.0 -// swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) -// swift-module-flags: -target x86_64-apple-ios11.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name AttributeGraph +// swift-compiler-version: Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3) +// swift-module-flags: -target x86_64-apple-ios11.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 6 -enforce-exclusivity=checked -O -module-name AttributeGraph // swift-module-flags-ignorable: -enable-bare-slash-regex @_exported import AttributeGraph import Foundation @@ -13,27 +13,27 @@ import _StringProcessing // MARK: - AnyAttribute extension AttributeGraph.AnyAttribute { - public init(_ attribute: AttributeGraph.Attribute) - public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute - public static var current: AnyAttribute? { get } - public func unsafeOffset(at offset: Int) -> AnyAttribute - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - public func visitBody(_ visitor: inout Visitor); - public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> ()) - public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var _bodyType: Any.Type { get } - public var _bodyPointer: UnsafeRawPointer { get } - public var valueType: Any.Type { get } - public var indirectDependency: AnyAttribute? { - get - nonmutating set - } + public init(_ attribute: AttributeGraph.Attribute) + public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute + public static var current: AnyAttribute? { get } + public func unsafeOffset(at offset: Int) -> AnyAttribute + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + public func visitBody(_ visitor: inout Visitor) + public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + public var _bodyType: Any.Type { get } + public var _bodyPointer: UnsafeRawPointer { get } + public var valueType: Any.Type { get } + public var indirectDependency: AnyAttribute? { + get + nonmutating set + } } extension AttributeGraph.AnyAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } public typealias AttributeUpdateBlock = () -> ((Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void) @@ -48,66 +48,74 @@ public struct Attribute { public init(identifier: AnyAttribute) public init(_ attribute: AttributeGraph.Attribute) - public init(value: Value) - public init(type: Value.Type) - public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: AGAttributeTypeFlags, update: AttributeUpdateBlock) - public var wrappedValue: Value { - unsafeAddress - nonmutating set - } - public var projectedValue: AttributeGraph.Attribute { get set } - + public init(value: Value) + public init(type: Value.Type) + public init( + body: Swift.UnsafePointer, + value: Swift.UnsafePointer?, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) + public var wrappedValue: Value { + unsafeAddress + nonmutating set + } + public var projectedValue: AttributeGraph.Attribute { get set } + public subscript(dynamicMember _: Swift.KeyPath) -> AttributeGraph.Attribute { get } public subscript(keyPath _: Swift.KeyPath) -> AttributeGraph.Attribute { get } - public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) -> AttributeGraph.Attribute { get } - - public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute - public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute - public func applying(offset: AttributeGraph.PointerOffset) -> AttributeGraph.Attribute - public func visitBody(_ visitor: inout Body) - public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) - public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - - public var graph: AGGraph { get } - public var subgraph: AGSubgraph { get } - - public var value: Value { - unsafeAddress - nonmutating set - } - public var valueState: AGValueState { get } - public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public func setValue(_ value: Value) -> Bool - public var hasValue: Bool { get } - public func updateValue() - public func prefetchValue() - public func invalidateValue() - public func validate() - - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - - public var flags: AGAttributeFlags { - get - nonmutating set - } - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + { get } + + public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute + public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute + public func applying(offset: AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + public func visitBody(_ visitor: inout Body) + public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + + public var graph: AGGraph { get } + public var subgraph: AGSubgraph { get } + + public var value: Value { + unsafeAddress + nonmutating set + } + public var valueState: AGValueState { get } + public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public func setValue(_ value: Value) -> Bool + public var hasValue: Bool { get } + public func updateValue() + public func prefetchValue() + public func invalidateValue() + public func validate() + + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + + public var flags: AGAttributeFlags { + get + nonmutating set + } + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) } extension AttributeGraph.Attribute: Swift.Hashable { public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool + public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool public var hashValue: Swift.Int { get } } extension AttributeGraph.Attribute: Swift.CustomStringConvertible { - public var description: String { get } + public var description: String { get } } extension AttributeGraph.Attribute { - public init(_ rule: R) where R.Value == Value - public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value } // MARK: - AnyWeakAttribute @@ -115,140 +123,144 @@ extension AttributeGraph.Attribute { public typealias AnyWeakAttribute = AGWeakAttribute extension AttributeGraph.AnyWeakAttribute { - @_alwaysEmitIntoClient - public init(_ attribute: AnyAttribute?) { - self = __AGCreateWeakAttribute(attribute ?? .nil) - } - - @_alwaysEmitIntoClient - public init(_ weakAttribute: AttributeGraph.WeakAttribute) { - self = weakAttribute.base - } - - @_alwaysEmitIntoClient - public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { - WeakAttribute(base: self) - } - - @_alwaysEmitIntoClient - public var attribute: AnyAttribute? { - get { - let attribute = __AGWeakAttributeGetAttribute(self) - return attribute == .nil ? nil : attribute - } - set { - self = AnyWeakAttribute(newValue) - } - } + @_alwaysEmitIntoClient + public init(_ attribute: AnyAttribute?) { + self = __AGCreateWeakAttribute(attribute ?? .nil) + } + + @_alwaysEmitIntoClient + public init(_ weakAttribute: AttributeGraph.WeakAttribute) { + self = weakAttribute.base + } + + @_alwaysEmitIntoClient + public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { + WeakAttribute(base: self) + } + + @_alwaysEmitIntoClient + public var attribute: AnyAttribute? { + get { + let attribute = __AGWeakAttributeGetAttribute(self) + return attribute == .nil ? nil : attribute + } + set { + self = AnyWeakAttribute(newValue) + } + } } extension AttributeGraph.AnyWeakAttribute: Hashable { - @_alwaysEmitIntoClient - public func hash(into hasher: inout Swift.Hasher) { - hasher.combine(raw_attribute) - hasher.combine(subgraph_id) - } + @_alwaysEmitIntoClient + public func hash(into hasher: inout Swift.Hasher) { + hasher.combine(raw_attribute) + hasher.combine(subgraph_id) + } - @_alwaysEmitIntoClient - public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { - lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id - } + @_alwaysEmitIntoClient + public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { + lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id + } - @_alwaysEmitIntoClient - public var hashValue: Int { - _hashValue(for: self) - } + @_alwaysEmitIntoClient + public var hashValue: Int { + _hashValue(for: self) + } } extension AttributeGraph.AnyWeakAttribute: CustomStringConvertible { - @_alwaysEmitIntoClient - public var description: String { - attribute?.description ?? "nil" - } + @_alwaysEmitIntoClient + public var description: String { + attribute?.description ?? "nil" + } } - // MARK: - WeakAttribute @frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - @usableFromInline - internal var base: AnyWeakAttribute - @_alwaysEmitIntoClient - public init(base: AnyWeakAttribute) { self.base = base } - public init() - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public var wrappedValue: Value? { get } - public var projectedValue: AttributeGraph.Attribute?{ get set } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { get } - public var attribute: AttributeGraph.Attribute? { get set _modify } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? + @usableFromInline + internal var base: AnyWeakAttribute + @_alwaysEmitIntoClient + public init(base: AnyWeakAttribute) { self.base = base } + public init() + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public var wrappedValue: Value? { get } + public var projectedValue: AttributeGraph.Attribute? { get set } + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { + get + } + public var attribute: AttributeGraph.Attribute? { get set _modify } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? } extension AttributeGraph.WeakAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.WeakAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - OptionalAttribute @frozen public struct AnyOptionalAttribute { - public init() - public init(_ attribute: AnyAttribute) - public init(_ attribute: AnyAttribute?) - public init(_ attribute: AttributeGraph.OptionalAttribute) - public var identifier: AnyAttribute - public static var current: AttributeGraph.AnyOptionalAttribute { get } - public var attribute: AnyAttribute? { get set } - public func map(_ body: (AnyAttribute) -> Value) -> Value? - public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute + public init() + public init(_ attribute: AnyAttribute) + public init(_ attribute: AnyAttribute?) + public init(_ attribute: AttributeGraph.OptionalAttribute) + public var identifier: AnyAttribute + public static var current: AttributeGraph.AnyOptionalAttribute { get } + public var attribute: AnyAttribute? { get set } + public func map(_ body: (AnyAttribute) -> Value) -> Value? + public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute } extension AttributeGraph.AnyOptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.AnyOptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } @frozen @propertyWrapper @dynamicMemberLookup public struct OptionalAttribute { - public var base: AttributeGraph.AnyOptionalAttribute - public init() - public init(base: AttributeGraph.AnyOptionalAttribute) - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public var attribute: AttributeGraph.Attribute? { get set } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? - public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? - public var wrappedValue: Value? { get } - public var projectedValue: Attribute? { get set _modify } - public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } + public var base: AttributeGraph.AnyOptionalAttribute + public init() + public init(base: AttributeGraph.AnyOptionalAttribute) + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public init(_ weakAttribute: AttributeGraph.WeakAttribute) + public var attribute: AttributeGraph.Attribute? { get set } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? + public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? + public var wrappedValue: Value? { get } + public var projectedValue: Attribute? { get set _modify } + public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } } extension AttributeGraph.OptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - IndirectAttribute @@ -257,36 +269,37 @@ extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { - public let identifier: AnyAttribute - public init(source: AttributeGraph.Attribute) - public var source: AttributeGraph.Attribute { - get - nonmutating set - nonmutating _modify - } - public var dependency: AnyAttribute? { - get - nonmutating set - } - public var value: Value { - get - nonmutating set - nonmutating _modify - } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public var wrappedValue: Value { - get - nonmutating set - nonmutating _modify - } - public var projectedValue: AttributeGraph.Attribute { get } - public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } + public let identifier: AnyAttribute + public init(source: AttributeGraph.Attribute) + public var source: AttributeGraph.Attribute { + get + nonmutating set + nonmutating _modify + } + public var dependency: AnyAttribute? { + get + nonmutating set + } + public var value: Value { + get + nonmutating set + nonmutating _modify + } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public var wrappedValue: Value { + get + nonmutating set + nonmutating _modify + } + public var projectedValue: AttributeGraph.Attribute { get } + public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } } extension AttributeGraph.IndirectAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } // MARK: - _AttributeBody @@ -317,17 +330,17 @@ public protocol AttributeBodyVisitor { @frozen public struct External { - public init() + public init() } extension AttributeGraph.External: AttributeGraph._AttributeBody { - public static var comparisonMode: AGComparisonMode { get } - public static var flags: AGAttributeTypeFlags { get } - public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static var comparisonMode: AGComparisonMode { get } + public static var flags: AGAttributeTypeFlags { get } + public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) } extension AttributeGraph.External: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - Focus @@ -336,28 +349,28 @@ extension AttributeGraph.External: Swift.CustomStringConvertible { public struct Focus { public var root: Attribute public var keyPath: KeyPath - + public init(root: Attribute, keyPath: KeyPath) } extension AttributeGraph.Focus: AttributeGraph.Rule { - public var value: Self.Value { get } - public static var flags: AGAttributeTypeFlags { get } + public var value: Self.Value { get } + public static var flags: AGAttributeTypeFlags { get } } extension AttributeGraph.Focus: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - ObservedAttribute public protocol ObservedAttribute: AttributeGraph._AttributeBody { - func destroy() + func destroy() } extension AttributeGraph.ObservedAttribute { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { get } + public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) + public static var _hasDestroySelf: Swift.Bool { get } } // MARK: - Graph Related @@ -365,65 +378,69 @@ extension AttributeGraph.ObservedAttribute { // MARK: - AGGraph extension AttributeGraph.AGGraph { - public static func typeIndex( - ctx: AGGraphContext, - body: AttributeGraph._AttributeBody.Type, - valueType: Metadata, - flags: AGAttributeTypeFlags, - update: AttributeUpdateBlock - ) -> Int + public static func typeIndex( + ctx: AGUnownedGraphRef, + body: AttributeGraph._AttributeBody.Type, + valueType: Metadata, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) -> Int } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphStartProfiling") - public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStartProfiling") + public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) - @_silgen_name("AGGraphStopProfiling") - public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStopProfiling") + public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphSetInvalidationCallback") - public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) + @_silgen_name("AGGraphSetInvalidationCallback") + public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) - @_silgen_name("AGGraphSetUpdateCallback") - public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) + @_silgen_name("AGGraphSetUpdateCallback") + public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) } extension AttributeGraph.AGGraph { - @_transparent - @inline(__always) - public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: ._10)) } + @_transparent + @inline(__always) + public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: .mainThreadUpdateCount)) } } extension AttributeGraph.AGGraph { - public static func withoutUpdate(_ body: () -> Value) -> Value + public static func withoutUpdate(_ body: () -> Value) -> Value } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphGetOutputValue") - @inline(__always) - @inlinable - public static func outputValue() -> Swift.UnsafePointer? + @_silgen_name("AGGraphGetOutputValue") + @inline(__always) + @inlinable + public static func outputValue() -> Swift.UnsafePointer? - @_silgen_name("AGGraphSetOutputValue") - @inline(__always) - @inlinable - public static func setOutputValue(_ value: Swift.UnsafePointer) + @_silgen_name("AGGraphSetOutputValue") + @inline(__always) + @inlinable + public static func setOutputValue(_ value: Swift.UnsafePointer) } // MARK: - AGSubgraph extension AttributeGraph.AGSubgraph { - public func addObserver(_ observer: () -> Void) -> Swift.Int - public func apply(_ body: () -> Value) -> Value - public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) + public func addObserver(_ observer: () -> Void) -> Swift.Int + public func apply(_ body: () -> Value) -> Value + public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) } extension AttributeGraph.AGSubgraph { - public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) - public static func endTreeElement(value: AttributeGraph.Attribute) - public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) + public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) + public static func endTreeElement(value: AttributeGraph.Attribute) + public static func addTreeValue( + _ value: AttributeGraph.Attribute, + forKey key: Swift.UnsafePointer, + flags: Swift.UInt32 + ) } // MARK: - Rule Related @@ -438,97 +455,114 @@ public protocol Rule: AttributeGraph._AttributeBody { extension AttributeGraph.Rule { public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.Rule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } } extension AttributeGraph.Rule where Self: Swift.Hashable { - public func cachedValueIfExists( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value? + public func cachedValueIfExists( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value? - public func cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value + public func cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value - public static func _cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute?, - hashValue: Swift.Int, - bodyPtr: Swift.UnsafeRawPointer, - update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> () - ) -> Swift.UnsafePointer + public static func _cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute?, + hashValue: Swift.Int, + bodyPtr: Swift.UnsafeRawPointer, + update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void + ) -> Swift.UnsafePointer } // MARK: - StateRule public protocol StatefulRule: AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Value? { get } - mutating func updateValue() + associatedtype Value + static var initialValue: Value? { get } + mutating func updateValue() } extension AttributeGraph.StatefulRule { - public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static var initialValue: Self.Value? { get } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.StatefulRule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool { get } } // MARK: - RuleContext @frozen public struct RuleContext { - public var attribute: AttributeGraph.Attribute - public init(attribute: AttributeGraph.Attribute) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) + public var attribute: AttributeGraph.Attribute + public init(attribute: AttributeGraph.Attribute) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) } // MARK: - AnyRuleContext @frozen public struct AnyRuleContext { - public var attribute: AnyAttribute - public init(attribute: AnyAttribute) - public init(_ context: AttributeGraph.RuleContext) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) - public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext + public var attribute: AnyAttribute + public init(attribute: AnyAttribute) + public init(_ context: AttributeGraph.RuleContext) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) + public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext } // MARK: - Runtime Related // MARK: - CompareValues -public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = ._3) -> Swift.Bool +extension AGComparisonOptions { + public init(mode: AGComparisonMode) +} + +public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = .equatableAlways) -> Swift.Bool public func compareValues(_ lhs: A, _ rhs: A, options: AGComparisonOptions) -> Swift.Bool // MARK: - Metadata +public func forEachField( + of type: Any.Type, + do body: (UnsafePointer, Int, Any.Type) -> Void +) + extension Metadata: Swift.CustomStringConvertible { public init(_ type: Any.Type) public var type: Any.Type { get } @@ -539,83 +573,97 @@ extension Metadata: Swift.CustomStringConvertible { ) -> Bool } +// MARK: - Signature + +extension Signature: Swift.Equatable {} + // MARK: - TupleType extension TupleType { - @_transparent + @_transparent public init(_ types: [Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) } - - @_transparent + + @_transparent public init(_ type: Any.Type) { - self.init(rawValue: unsafeBitCast(type, to: UnsafePointer<_Metadata>.self)) + self.init(rawValue: unsafeBitCast(type, to: OpaquePointer.self)) } - - @_transparent + + @_transparent public var isEmpty: Bool { count == 0 } - @_transparent - public var indices: Range { 0 ..< count } - - @_transparent + @_transparent + public var indices: Range { 0.. Any.Type { elementType(at: index).type } - - @_transparent + + @_transparent public func offset(at index: Int, as type: T.Type) -> Int { elementOffset(at: index, type: Metadata(type)) } - - @_transparent - public func setElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, from srcValue: UnsafePointer, options: CopyOptions) { + + @_transparent + public func setElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + from srcValue: UnsafePointer, + options: CopyOptions + ) { __AGTupleSetElement(self, tupleValue, index, srcValue, Metadata(T.self), options) } - - @_transparent - public func getElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, to dstValue: UnsafeMutablePointer, options: CopyOptions) { + + @_transparent + public func getElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + to dstValue: UnsafeMutablePointer, + options: CopyOptions + ) { __AGTupleGetElement(self, tupleValue, index, dstValue, Metadata(T.self), options) } } @_silgen_name("AGTupleWithBuffer") -public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> ()) +public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> Void) // MARK: - UnsafeTuple extension UnsafeTuple { - @_transparent + @_transparent public var count: Int { type.count } - - @_transparent - public var isEmpty: Bool { type.isEmpty } - - @_transparent - public var indices: Range { type.indices } - - @_transparent + + @_transparent + public var isEmpty: Bool { type.isEmpty } + + @_transparent + public var indices: Range { type.indices } + + @_transparent public func address(as _: T.Type = T.self) -> UnsafePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { address(of: index, as: T.self) } } @@ -630,61 +678,61 @@ extension UnsafeTuple { /*private*/ public func slowDealloc(_ ptr: UnsafeMutableRawPointer, _ size: Int, _ alignMask: Int) extension UnsafeMutableTuple { - @_transparent + @_transparent public init(with tupleType: TupleType) { self.init(type: tupleType, value: slowAlloc(tupleType.size, -1)) } - @_transparent + @_transparent public func initialize(at index: Int, to element: T) { withUnsafePointer(to: element) { elementPointer in type.setElement(in: value, at: index, from: elementPointer, options: .initCopy) } } - @_transparent + @_transparent public func deinitialize() { type.destroy(value) } - @_transparent + @_transparent public func deinitialize(at index: Int) { type.destroy(value, at: index) } - @_transparent + @_transparent public func deallocate(initialized: Bool) { if initialized { deinitialize() } slowDealloc(value, -1, -1) - } - @_transparent + } + @_transparent public var count: Int { type.count } - @_transparent + @_transparent public var isEmpty: Bool { type.isEmpty } - @_transparent + @_transparent public var indices: Range { type.indices } - - @_transparent + + @_transparent public func address(as _: T.Type = T.self) -> UnsafeMutablePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafeMutablePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { UnsafePointer(address(as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { UnsafePointer(address(of: index, as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(of: index, as: T.self) } @@ -724,30 +772,41 @@ public func AGTypeApplyFields2( @frozen public struct PointerOffset { - public var byteOffset: Swift.Int - public init(byteOffset: Swift.Int) + public var byteOffset: Swift.Int + public init(byteOffset: Swift.Int) } extension AttributeGraph.PointerOffset { - public static func + (_ lhs: AttributeGraph.PointerOffset, _ rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset + public static func + ( + _ lhs: AttributeGraph.PointerOffset, + _ rhs: AttributeGraph.PointerOffset + ) -> AttributeGraph.PointerOffset } extension AttributeGraph.PointerOffset { - public static func invalidScenePointer() -> Swift.UnsafeMutablePointer - public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset - public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset + public static func invalidScenePointer() -> Swift.UnsafeMutablePointer + public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset + public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset< + Base, Member + > } extension AttributeGraph.PointerOffset where Base == Member { - public init() + public init() } extension Swift.UnsafePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - } - public static func + (_ lhs: Swift.UnsafePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + } + public static func + ( + _ lhs: Swift.UnsafePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafePointer } extension Swift.UnsafeMutablePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - nonmutating unsafeMutableAddress - } - public static func + (_ lhs: Swift.UnsafeMutablePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + nonmutating unsafeMutableAddress + } + public static func + ( + _ lhs: Swift.UnsafeMutablePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafeMutablePointer } diff --git a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGAttributeType.h b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGAttributeType.h index 4229ac2..0579f04 100644 --- a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGAttributeType.h +++ b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGAttributeType.h @@ -1,6 +1,6 @@ // // AGAttributeType.h -// +// // // Created by Kyle on 2024/2/17. // @@ -8,15 +8,35 @@ #ifndef AGAttributeType_h #define AGAttributeType_h +#include "AGAttributeTypeFlags.h" #include "AGBase.h" #include "AGTypeID.h" AG_ASSUME_NONNULL_BEGIN +typedef struct AGClosureStorage { + void *function; + void *context; +} AGClosureStorage; + +typedef struct AGAttributeVTable { +} AGAttributeVTable; + typedef struct AGAttributeType { AGTypeID typeID; AGTypeID valueTypeID; - // TODO + + AGClosureStorage updateClosure; + + AGAttributeVTable *_Nullable callbacks; + AGAttributeTypeFlags flags; + + // set after construction + uint32_t offset; + const unsigned char *_Nullable layout; + + AGTypeID initialTypeID; + void *initialBodyTypeID; } AGAttributeType; AG_ASSUME_NONNULL_END diff --git a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGCompareValues.h b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGCompareValues.h index 2fc6604..398c60b 100644 --- a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGCompareValues.h +++ b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGCompareValues.h @@ -12,9 +12,15 @@ #include "AGComparisonMode.h" AG_EXTERN_C_BEGIN + AG_EXPORT AG_REFINED_FOR_SWIFT bool AGCompareValues(const void *lhs, const void *rhs, const void *type, const AGComparisonMode comparisonMode); + +AG_EXPORT +AG_REFINED_FOR_SWIFT +const unsigned char *_Nullable AGPrefetchCompareValues(AGTypeID type, AGComparisonOptions options, uint32_t priority); + AG_EXTERN_C_END #endif /* AGCompareValues_h */ diff --git a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGComparisonMode.h b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGComparisonMode.h index b4a5b9f..ec83f07 100644 --- a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGComparisonMode.h +++ b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGComparisonMode.h @@ -10,19 +10,19 @@ #include "AGBase.h" -typedef AG_OPTIONS(uint32_t, AGComparisonMode) { - AGComparisonMode_0 = 0, - AGComparisonMode_1 = 1 << 0, - AGComparisonMode_2 = 1 << 1, - AGComparisonMode_3 = AGComparisonMode_1 | AGComparisonMode_2, +typedef AG_ENUM(uint8_t, AGComparisonMode){ + AGComparisonModeBitwise = 0, + AGComparisonModeIndirect = 1, + AGComparisonModeEquatableUnlessPOD = 2, + AGComparisonModeEquatableAlways = 3, }; -typedef AG_OPTIONS(uint32_t, AGComparisonOptions) { - AGComparisonOptions_0 = 0, - AGComparisonOptions_1 = 1 << 0, - AGComparisonOptions_2 = 1 << 1, - AGComparisonOptions_3 = AGComparisonOptions_1 | AGComparisonOptions_2, +typedef AG_OPTIONS(uint32_t, AGComparisonOptions){ + AGComparisonOptionsComparisonModeMask = 0xff, + + AGComparisonOptionsCopyOnWrite = 1 << 8, + AGComparisonOptionsFetchLayoutsSynchronously = 1 << 9, + AGComparisonOptionsReportFailures = 1ul << 31, // -1 signed int }; #endif /* AGComparisonMode_h */ - diff --git a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGCounterQueryType.h b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGCounterQueryType.h deleted file mode 100644 index 2a60455..0000000 --- a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGCounterQueryType.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// AGCounterQueryType.h -// -// -// Created by Kyle on 2024/3/8. -// - -#ifndef AGCounterQueryType_h -#define AGCounterQueryType_h - -#include "AGBase.h" - -typedef AG_ENUM(uint32_t, AGCounterQueryType) { - AGCounterQueryType_0, - AGCounterQueryType_1, - AGCounterQueryType_2, - AGCounterQueryType_3, - AGCounterQueryType_4, - AGCounterQueryType_5, - AGCounterQueryType_6, - AGCounterQueryType_7, - AGCounterQueryType_8, - AGCounterQueryType_9, - AGCounterQueryType_10, -}; - -#endif /* AGCounterQueryType_h */ diff --git a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraph.h b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraph.h index 1bd7674..65eedf4 100644 --- a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraph.h +++ b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraph.h @@ -10,17 +10,19 @@ #include "AGBase.h" #include "CFRuntime.h" -#include "AGCounterQueryType.h" +#include "AGGraphCounterQuery.h" // Note: Place all structure declaration in a single place to avoid header cycle dependency typedef struct AG_BRIDGED_TYPE(id) AGGraphStorage * AGGraphRef; -typedef struct AG_BRIDGED_TYPE(id) AGGraphContextStorage * AGGraphContextRef; typedef struct AG_BRIDGED_TYPE(id) AGSubgraphStorage * AGSubgraphRef; +typedef void * AGUnownedGraphRef; +typedef struct AGGraphContextStorage * AGUnownedGraphContextRef; + struct AGGraphStorage; -struct AGGraphContextStorage; struct AGSubgraphStorage; +struct AGGraphContextStorage; typedef uint32_t AGAttribute AG_SWIFT_STRUCT AG_SWIFT_NAME(AnyAttribute); @@ -68,7 +70,7 @@ void AGGraphSetContext(AGGraphRef graph, const void * _Nullable context) AG_SWIF AG_EXPORT AG_REFINED_FOR_SWIFT -AGGraphContextRef AGGraphGetGraphContext(AGGraphRef graph) AG_SWIFT_NAME(getter:AGGraphRef.graphContext(self:)); +AGUnownedGraphRef AGGraphGetGraphContext(AGGraphRef graph) AG_SWIFT_NAME(getter:AGGraphRef.graphContext(self:)); AG_EXPORT AG_REFINED_FOR_SWIFT @@ -92,7 +94,7 @@ void AGGraphSetUpdateCallback(AGGraphRef graph, AG_EXPORT AG_REFINED_FOR_SWIFT -uint64_t AGGraphGetCounter(AGGraphRef graph, AGCounterQueryType query) AG_SWIFT_NAME(AGGraphRef.counter(self:for:)); +uint64_t AGGraphGetCounter(AGGraphRef graph, AGGraphCounterQuery query) AG_SWIFT_NAME(AGGraphRef.counter(self:for:)); AG_EXPORT AG_REFINED_FOR_SWIFT diff --git a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraphContext.h b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraphContext.h index eee32d0..4d6e84f 100644 --- a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraphContext.h +++ b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraphContext.h @@ -19,7 +19,7 @@ AG_EXTERN_C_BEGIN AG_EXPORT AG_REFINED_FOR_SWIFT -AGGraphRef AGGraphContextGetGraph(AGGraphContextRef context) AG_SWIFT_NAME(getter:AGGraphContextRef.graph(self:)); +AGGraphRef AGGraphContextGetGraph(AGUnownedGraphContextRef context) AG_SWIFT_NAME(getter:AGUnownedGraphContextRef.graph(self:)); AG_EXTERN_C_END diff --git a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraphCounterQuery.h b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraphCounterQuery.h new file mode 100644 index 0000000..6fd06d3 --- /dev/null +++ b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGGraphCounterQuery.h @@ -0,0 +1,30 @@ +// +// AGCounterQueryType.h +// +// +// Created by Kyle on 2024/3/8. +// + +#ifndef AGGraphCounterQuery_h +#define AGGraphCounterQuery_h + +#include "AGBase.h" + +typedef AG_ENUM(uint32_t, AGGraphCounterQuery){ + AGGraphCounterQueryNodeCount, + AGGraphCounterQueryTransactionCount, + AGGraphCounterQueryUpdateCount, + AGGraphCounterQueryChangeCount, + AGGraphCounterQueryContextID, + AGGraphCounterQueryGraphID, + AGGraphCounterQueryContextThreadUpdating, + AGGraphCounterQueryThreadUpdating, + AGGraphCounterQueryContextNeedsUpdate, + AGGraphCounterQueryNeedsUpdate, + AGGraphCounterQueryMainThreadUpdateCount, + AGGraphCounterQueryNodeTotalCount, + AGGraphCounterQuerySubgraphCount, + AGGraphCounterQuerySubgraphTotalCount, +}; + +#endif /* AGGraphCounterQuery_h */ diff --git a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGSubgraph.h b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGSubgraph.h index 8cf9f2c..461a8b2 100644 --- a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGSubgraph.h +++ b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGSubgraph.h @@ -43,7 +43,7 @@ void AGSubgraphSetCurrent(_Nullable AGSubgraphRef cf_subgraph) AG_SWIFT_NAME(set AG_EXPORT AG_REFINED_FOR_SWIFT -_Nullable AGGraphContextRef AGSubgraphGetCurrentGraphContext(void) AG_SWIFT_NAME(getter:AGSubgraphRef.currentGraphContext()); +_Nullable AGUnownedGraphRef AGSubgraphGetCurrentGraphContext(void) AG_SWIFT_NAME(getter:AGSubgraphRef.currentGraphContext()); AG_EXPORT AG_REFINED_FOR_SWIFT diff --git a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGTypeID.h b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGTypeID.h index 002b5f4..585248c 100644 --- a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGTypeID.h +++ b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGTypeID.h @@ -10,10 +10,7 @@ AG_ASSUME_NONNULL_BEGIN -typedef struct AG_SWIFT_NAME(_Metadata) AGSwiftMetadata { -} AGSwiftMetadata; - -typedef const AGSwiftMetadata *AGTypeID AG_SWIFT_STRUCT AG_SWIFT_NAME(Metadata); +typedef const struct AGSwiftMetadata *AGTypeID AG_SWIFT_STRUCT AG_SWIFT_NAME(Metadata); #if ATTRIBUTEGRAPH_RELEASE >= ATTRIBUTEGRAPH_RELEASE_2024 @@ -35,11 +32,11 @@ typedef AG_CLOSED_ENUM(uint32_t, AGTypeKind) { AGTypeKindMetatype, } AG_SWIFT_NAME(Metadata.Kind); -typedef AG_OPTIONS(uint32_t, AGTypeApplyOptions) { - AGTypeApplyOptions_0 = 0, - AGTypeApplyOptions_1 = 1 << 0, - AGTypeApplyOptions_2 = 1 << 1, - AGTypeApplyOptions_4 = 1 << 2, +typedef AG_OPTIONS(uint32_t, AGTypeApplyOptions){ + AGTypeApplyOptionsEnumerateStructFields = 0, + AGTypeApplyOptionsEnumerateClassFields = 1 << 0, + AGTypeApplyOptionsContinueAfterUnknownField = 1 << 1, + AGTypeApplyOptionsEnumerateEnumCases = 1 << 2, }; AG_EXTERN_C_BEGIN diff --git a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h index 5341208..eea48a1 100644 --- a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h +++ b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AttributeGraph-umbrella.h @@ -8,10 +8,10 @@ #include "AGChangedValueFlags.h" #include "AGCompareValues.h" #include "AGComparisonMode.h" -#include "AGCounterQueryType.h" #include "AGDebugServer.h" #include "AGGraph.h" #include "AGGraphContext.h" +#include "AGGraphCounterQuery.h" #include "AGGraphDescription.h" #include "AGInputOptions.h" #include "AGSearchOptions.h" diff --git a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-macos.swiftinterface b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-macos.swiftinterface index aacbf77..4c3fc76 100644 --- a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-macos.swiftinterface +++ b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-macos.swiftinterface @@ -1,6 +1,6 @@ // swift-interface-format-version: 1.0 -// swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) -// swift-module-flags: -target arm64-apple-macos12.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name AttributeGraph +// swift-compiler-version: Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3) +// swift-module-flags: -target arm64-apple-macos12.0 -enable-objc-interop -enable-library-evolution -swift-version 6 -enforce-exclusivity=checked -O -module-name AttributeGraph // swift-module-flags-ignorable: -enable-bare-slash-regex @_exported import AttributeGraph import Foundation @@ -13,27 +13,27 @@ import _StringProcessing // MARK: - AnyAttribute extension AttributeGraph.AnyAttribute { - public init(_ attribute: AttributeGraph.Attribute) - public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute - public static var current: AnyAttribute? { get } - public func unsafeOffset(at offset: Int) -> AnyAttribute - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - public func visitBody(_ visitor: inout Visitor); - public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> ()) - public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var _bodyType: Any.Type { get } - public var _bodyPointer: UnsafeRawPointer { get } - public var valueType: Any.Type { get } - public var indirectDependency: AnyAttribute? { - get - nonmutating set - } + public init(_ attribute: AttributeGraph.Attribute) + public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute + public static var current: AnyAttribute? { get } + public func unsafeOffset(at offset: Int) -> AnyAttribute + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + public func visitBody(_ visitor: inout Visitor) + public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + public var _bodyType: Any.Type { get } + public var _bodyPointer: UnsafeRawPointer { get } + public var valueType: Any.Type { get } + public var indirectDependency: AnyAttribute? { + get + nonmutating set + } } extension AttributeGraph.AnyAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } public typealias AttributeUpdateBlock = () -> ((Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void) @@ -48,66 +48,74 @@ public struct Attribute { public init(identifier: AnyAttribute) public init(_ attribute: AttributeGraph.Attribute) - public init(value: Value) - public init(type: Value.Type) - public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: AGAttributeTypeFlags, update: AttributeUpdateBlock) - public var wrappedValue: Value { - unsafeAddress - nonmutating set - } - public var projectedValue: AttributeGraph.Attribute { get set } - + public init(value: Value) + public init(type: Value.Type) + public init( + body: Swift.UnsafePointer, + value: Swift.UnsafePointer?, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) + public var wrappedValue: Value { + unsafeAddress + nonmutating set + } + public var projectedValue: AttributeGraph.Attribute { get set } + public subscript(dynamicMember _: Swift.KeyPath) -> AttributeGraph.Attribute { get } public subscript(keyPath _: Swift.KeyPath) -> AttributeGraph.Attribute { get } - public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) -> AttributeGraph.Attribute { get } - - public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute - public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute - public func applying(offset: AttributeGraph.PointerOffset) -> AttributeGraph.Attribute - public func visitBody(_ visitor: inout Body) - public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) - public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - - public var graph: AGGraph { get } - public var subgraph: AGSubgraph { get } - - public var value: Value { - unsafeAddress - nonmutating set - } - public var valueState: AGValueState { get } - public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public func setValue(_ value: Value) -> Bool - public var hasValue: Bool { get } - public func updateValue() - public func prefetchValue() - public func invalidateValue() - public func validate() - - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - - public var flags: AGAttributeFlags { - get - nonmutating set - } - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + { get } + + public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute + public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute + public func applying(offset: AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + public func visitBody(_ visitor: inout Body) + public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + + public var graph: AGGraph { get } + public var subgraph: AGSubgraph { get } + + public var value: Value { + unsafeAddress + nonmutating set + } + public var valueState: AGValueState { get } + public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public func setValue(_ value: Value) -> Bool + public var hasValue: Bool { get } + public func updateValue() + public func prefetchValue() + public func invalidateValue() + public func validate() + + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + + public var flags: AGAttributeFlags { + get + nonmutating set + } + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) } extension AttributeGraph.Attribute: Swift.Hashable { public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool + public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool public var hashValue: Swift.Int { get } } extension AttributeGraph.Attribute: Swift.CustomStringConvertible { - public var description: String { get } + public var description: String { get } } extension AttributeGraph.Attribute { - public init(_ rule: R) where R.Value == Value - public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value } // MARK: - AnyWeakAttribute @@ -115,140 +123,144 @@ extension AttributeGraph.Attribute { public typealias AnyWeakAttribute = AGWeakAttribute extension AttributeGraph.AnyWeakAttribute { - @_alwaysEmitIntoClient - public init(_ attribute: AnyAttribute?) { - self = __AGCreateWeakAttribute(attribute ?? .nil) - } - - @_alwaysEmitIntoClient - public init(_ weakAttribute: AttributeGraph.WeakAttribute) { - self = weakAttribute.base - } - - @_alwaysEmitIntoClient - public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { - WeakAttribute(base: self) - } - - @_alwaysEmitIntoClient - public var attribute: AnyAttribute? { - get { - let attribute = __AGWeakAttributeGetAttribute(self) - return attribute == .nil ? nil : attribute - } - set { - self = AnyWeakAttribute(newValue) - } - } + @_alwaysEmitIntoClient + public init(_ attribute: AnyAttribute?) { + self = __AGCreateWeakAttribute(attribute ?? .nil) + } + + @_alwaysEmitIntoClient + public init(_ weakAttribute: AttributeGraph.WeakAttribute) { + self = weakAttribute.base + } + + @_alwaysEmitIntoClient + public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { + WeakAttribute(base: self) + } + + @_alwaysEmitIntoClient + public var attribute: AnyAttribute? { + get { + let attribute = __AGWeakAttributeGetAttribute(self) + return attribute == .nil ? nil : attribute + } + set { + self = AnyWeakAttribute(newValue) + } + } } extension AttributeGraph.AnyWeakAttribute: Hashable { - @_alwaysEmitIntoClient - public func hash(into hasher: inout Swift.Hasher) { - hasher.combine(raw_attribute) - hasher.combine(subgraph_id) - } + @_alwaysEmitIntoClient + public func hash(into hasher: inout Swift.Hasher) { + hasher.combine(raw_attribute) + hasher.combine(subgraph_id) + } - @_alwaysEmitIntoClient - public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { - lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id - } + @_alwaysEmitIntoClient + public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { + lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id + } - @_alwaysEmitIntoClient - public var hashValue: Int { - _hashValue(for: self) - } + @_alwaysEmitIntoClient + public var hashValue: Int { + _hashValue(for: self) + } } extension AttributeGraph.AnyWeakAttribute: CustomStringConvertible { - @_alwaysEmitIntoClient - public var description: String { - attribute?.description ?? "nil" - } + @_alwaysEmitIntoClient + public var description: String { + attribute?.description ?? "nil" + } } - // MARK: - WeakAttribute @frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - @usableFromInline - internal var base: AnyWeakAttribute - @_alwaysEmitIntoClient - public init(base: AnyWeakAttribute) { self.base = base } - public init() - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public var wrappedValue: Value? { get } - public var projectedValue: AttributeGraph.Attribute?{ get set } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { get } - public var attribute: AttributeGraph.Attribute? { get set _modify } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? + @usableFromInline + internal var base: AnyWeakAttribute + @_alwaysEmitIntoClient + public init(base: AnyWeakAttribute) { self.base = base } + public init() + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public var wrappedValue: Value? { get } + public var projectedValue: AttributeGraph.Attribute? { get set } + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { + get + } + public var attribute: AttributeGraph.Attribute? { get set _modify } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? } extension AttributeGraph.WeakAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.WeakAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - OptionalAttribute @frozen public struct AnyOptionalAttribute { - public init() - public init(_ attribute: AnyAttribute) - public init(_ attribute: AnyAttribute?) - public init(_ attribute: AttributeGraph.OptionalAttribute) - public var identifier: AnyAttribute - public static var current: AttributeGraph.AnyOptionalAttribute { get } - public var attribute: AnyAttribute? { get set } - public func map(_ body: (AnyAttribute) -> Value) -> Value? - public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute + public init() + public init(_ attribute: AnyAttribute) + public init(_ attribute: AnyAttribute?) + public init(_ attribute: AttributeGraph.OptionalAttribute) + public var identifier: AnyAttribute + public static var current: AttributeGraph.AnyOptionalAttribute { get } + public var attribute: AnyAttribute? { get set } + public func map(_ body: (AnyAttribute) -> Value) -> Value? + public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute } extension AttributeGraph.AnyOptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.AnyOptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } @frozen @propertyWrapper @dynamicMemberLookup public struct OptionalAttribute { - public var base: AttributeGraph.AnyOptionalAttribute - public init() - public init(base: AttributeGraph.AnyOptionalAttribute) - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public var attribute: AttributeGraph.Attribute? { get set } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? - public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? - public var wrappedValue: Value? { get } - public var projectedValue: Attribute? { get set _modify } - public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } + public var base: AttributeGraph.AnyOptionalAttribute + public init() + public init(base: AttributeGraph.AnyOptionalAttribute) + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public init(_ weakAttribute: AttributeGraph.WeakAttribute) + public var attribute: AttributeGraph.Attribute? { get set } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? + public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? + public var wrappedValue: Value? { get } + public var projectedValue: Attribute? { get set _modify } + public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } } extension AttributeGraph.OptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - IndirectAttribute @@ -257,36 +269,37 @@ extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { - public let identifier: AnyAttribute - public init(source: AttributeGraph.Attribute) - public var source: AttributeGraph.Attribute { - get - nonmutating set - nonmutating _modify - } - public var dependency: AnyAttribute? { - get - nonmutating set - } - public var value: Value { - get - nonmutating set - nonmutating _modify - } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public var wrappedValue: Value { - get - nonmutating set - nonmutating _modify - } - public var projectedValue: AttributeGraph.Attribute { get } - public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } + public let identifier: AnyAttribute + public init(source: AttributeGraph.Attribute) + public var source: AttributeGraph.Attribute { + get + nonmutating set + nonmutating _modify + } + public var dependency: AnyAttribute? { + get + nonmutating set + } + public var value: Value { + get + nonmutating set + nonmutating _modify + } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public var wrappedValue: Value { + get + nonmutating set + nonmutating _modify + } + public var projectedValue: AttributeGraph.Attribute { get } + public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } } extension AttributeGraph.IndirectAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } // MARK: - _AttributeBody @@ -317,17 +330,17 @@ public protocol AttributeBodyVisitor { @frozen public struct External { - public init() + public init() } extension AttributeGraph.External: AttributeGraph._AttributeBody { - public static var comparisonMode: AGComparisonMode { get } - public static var flags: AGAttributeTypeFlags { get } - public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static var comparisonMode: AGComparisonMode { get } + public static var flags: AGAttributeTypeFlags { get } + public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) } extension AttributeGraph.External: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - Focus @@ -336,28 +349,28 @@ extension AttributeGraph.External: Swift.CustomStringConvertible { public struct Focus { public var root: Attribute public var keyPath: KeyPath - + public init(root: Attribute, keyPath: KeyPath) } extension AttributeGraph.Focus: AttributeGraph.Rule { - public var value: Self.Value { get } - public static var flags: AGAttributeTypeFlags { get } + public var value: Self.Value { get } + public static var flags: AGAttributeTypeFlags { get } } extension AttributeGraph.Focus: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - ObservedAttribute public protocol ObservedAttribute: AttributeGraph._AttributeBody { - func destroy() + func destroy() } extension AttributeGraph.ObservedAttribute { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { get } + public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) + public static var _hasDestroySelf: Swift.Bool { get } } // MARK: - Graph Related @@ -365,65 +378,69 @@ extension AttributeGraph.ObservedAttribute { // MARK: - AGGraph extension AttributeGraph.AGGraph { - public static func typeIndex( - ctx: AGGraphContext, - body: AttributeGraph._AttributeBody.Type, - valueType: Metadata, - flags: AGAttributeTypeFlags, - update: AttributeUpdateBlock - ) -> Int + public static func typeIndex( + ctx: AGUnownedGraphRef, + body: AttributeGraph._AttributeBody.Type, + valueType: Metadata, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) -> Int } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphStartProfiling") - public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStartProfiling") + public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) - @_silgen_name("AGGraphStopProfiling") - public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStopProfiling") + public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphSetInvalidationCallback") - public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) + @_silgen_name("AGGraphSetInvalidationCallback") + public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) - @_silgen_name("AGGraphSetUpdateCallback") - public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) + @_silgen_name("AGGraphSetUpdateCallback") + public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) } extension AttributeGraph.AGGraph { - @_transparent - @inline(__always) - public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: ._10)) } + @_transparent + @inline(__always) + public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: .mainThreadUpdateCount)) } } extension AttributeGraph.AGGraph { - public static func withoutUpdate(_ body: () -> Value) -> Value + public static func withoutUpdate(_ body: () -> Value) -> Value } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphGetOutputValue") - @inline(__always) - @inlinable - public static func outputValue() -> Swift.UnsafePointer? + @_silgen_name("AGGraphGetOutputValue") + @inline(__always) + @inlinable + public static func outputValue() -> Swift.UnsafePointer? - @_silgen_name("AGGraphSetOutputValue") - @inline(__always) - @inlinable - public static func setOutputValue(_ value: Swift.UnsafePointer) + @_silgen_name("AGGraphSetOutputValue") + @inline(__always) + @inlinable + public static func setOutputValue(_ value: Swift.UnsafePointer) } // MARK: - AGSubgraph extension AttributeGraph.AGSubgraph { - public func addObserver(_ observer: () -> Void) -> Swift.Int - public func apply(_ body: () -> Value) -> Value - public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) + public func addObserver(_ observer: () -> Void) -> Swift.Int + public func apply(_ body: () -> Value) -> Value + public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) } extension AttributeGraph.AGSubgraph { - public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) - public static func endTreeElement(value: AttributeGraph.Attribute) - public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) + public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) + public static func endTreeElement(value: AttributeGraph.Attribute) + public static func addTreeValue( + _ value: AttributeGraph.Attribute, + forKey key: Swift.UnsafePointer, + flags: Swift.UInt32 + ) } // MARK: - Rule Related @@ -438,97 +455,114 @@ public protocol Rule: AttributeGraph._AttributeBody { extension AttributeGraph.Rule { public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.Rule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } } extension AttributeGraph.Rule where Self: Swift.Hashable { - public func cachedValueIfExists( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value? + public func cachedValueIfExists( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value? - public func cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value + public func cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value - public static func _cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute?, - hashValue: Swift.Int, - bodyPtr: Swift.UnsafeRawPointer, - update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> () - ) -> Swift.UnsafePointer + public static func _cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute?, + hashValue: Swift.Int, + bodyPtr: Swift.UnsafeRawPointer, + update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void + ) -> Swift.UnsafePointer } // MARK: - StateRule public protocol StatefulRule: AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Value? { get } - mutating func updateValue() + associatedtype Value + static var initialValue: Value? { get } + mutating func updateValue() } extension AttributeGraph.StatefulRule { - public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static var initialValue: Self.Value? { get } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.StatefulRule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool { get } } // MARK: - RuleContext @frozen public struct RuleContext { - public var attribute: AttributeGraph.Attribute - public init(attribute: AttributeGraph.Attribute) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) + public var attribute: AttributeGraph.Attribute + public init(attribute: AttributeGraph.Attribute) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) } // MARK: - AnyRuleContext @frozen public struct AnyRuleContext { - public var attribute: AnyAttribute - public init(attribute: AnyAttribute) - public init(_ context: AttributeGraph.RuleContext) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) - public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext + public var attribute: AnyAttribute + public init(attribute: AnyAttribute) + public init(_ context: AttributeGraph.RuleContext) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) + public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext } // MARK: - Runtime Related // MARK: - CompareValues -public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = ._3) -> Swift.Bool +extension AGComparisonOptions { + public init(mode: AGComparisonMode) +} + +public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = .equatableAlways) -> Swift.Bool public func compareValues(_ lhs: A, _ rhs: A, options: AGComparisonOptions) -> Swift.Bool // MARK: - Metadata +public func forEachField( + of type: Any.Type, + do body: (UnsafePointer, Int, Any.Type) -> Void +) + extension Metadata: Swift.CustomStringConvertible { public init(_ type: Any.Type) public var type: Any.Type { get } @@ -539,83 +573,97 @@ extension Metadata: Swift.CustomStringConvertible { ) -> Bool } +// MARK: - Signature + +extension Signature: Swift.Equatable {} + // MARK: - TupleType extension TupleType { - @_transparent + @_transparent public init(_ types: [Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) } - - @_transparent + + @_transparent public init(_ type: Any.Type) { - self.init(rawValue: unsafeBitCast(type, to: UnsafePointer<_Metadata>.self)) + self.init(rawValue: unsafeBitCast(type, to: OpaquePointer.self)) } - - @_transparent + + @_transparent public var isEmpty: Bool { count == 0 } - @_transparent - public var indices: Range { 0 ..< count } - - @_transparent + @_transparent + public var indices: Range { 0.. Any.Type { elementType(at: index).type } - - @_transparent + + @_transparent public func offset(at index: Int, as type: T.Type) -> Int { elementOffset(at: index, type: Metadata(type)) } - - @_transparent - public func setElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, from srcValue: UnsafePointer, options: CopyOptions) { + + @_transparent + public func setElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + from srcValue: UnsafePointer, + options: CopyOptions + ) { __AGTupleSetElement(self, tupleValue, index, srcValue, Metadata(T.self), options) } - - @_transparent - public func getElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, to dstValue: UnsafeMutablePointer, options: CopyOptions) { + + @_transparent + public func getElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + to dstValue: UnsafeMutablePointer, + options: CopyOptions + ) { __AGTupleGetElement(self, tupleValue, index, dstValue, Metadata(T.self), options) } } @_silgen_name("AGTupleWithBuffer") -public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> ()) +public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> Void) // MARK: - UnsafeTuple extension UnsafeTuple { - @_transparent + @_transparent public var count: Int { type.count } - - @_transparent - public var isEmpty: Bool { type.isEmpty } - - @_transparent - public var indices: Range { type.indices } - - @_transparent + + @_transparent + public var isEmpty: Bool { type.isEmpty } + + @_transparent + public var indices: Range { type.indices } + + @_transparent public func address(as _: T.Type = T.self) -> UnsafePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { address(of: index, as: T.self) } } @@ -630,61 +678,61 @@ extension UnsafeTuple { /*private*/ public func slowDealloc(_ ptr: UnsafeMutableRawPointer, _ size: Int, _ alignMask: Int) extension UnsafeMutableTuple { - @_transparent + @_transparent public init(with tupleType: TupleType) { self.init(type: tupleType, value: slowAlloc(tupleType.size, -1)) } - @_transparent + @_transparent public func initialize(at index: Int, to element: T) { withUnsafePointer(to: element) { elementPointer in type.setElement(in: value, at: index, from: elementPointer, options: .initCopy) } } - @_transparent + @_transparent public func deinitialize() { type.destroy(value) } - @_transparent + @_transparent public func deinitialize(at index: Int) { type.destroy(value, at: index) } - @_transparent + @_transparent public func deallocate(initialized: Bool) { if initialized { deinitialize() } slowDealloc(value, -1, -1) - } - @_transparent + } + @_transparent public var count: Int { type.count } - @_transparent + @_transparent public var isEmpty: Bool { type.isEmpty } - @_transparent + @_transparent public var indices: Range { type.indices } - - @_transparent + + @_transparent public func address(as _: T.Type = T.self) -> UnsafeMutablePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafeMutablePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { UnsafePointer(address(as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { UnsafePointer(address(of: index, as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(of: index, as: T.self) } @@ -724,30 +772,41 @@ public func AGTypeApplyFields2( @frozen public struct PointerOffset { - public var byteOffset: Swift.Int - public init(byteOffset: Swift.Int) + public var byteOffset: Swift.Int + public init(byteOffset: Swift.Int) } extension AttributeGraph.PointerOffset { - public static func + (_ lhs: AttributeGraph.PointerOffset, _ rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset + public static func + ( + _ lhs: AttributeGraph.PointerOffset, + _ rhs: AttributeGraph.PointerOffset + ) -> AttributeGraph.PointerOffset } extension AttributeGraph.PointerOffset { - public static func invalidScenePointer() -> Swift.UnsafeMutablePointer - public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset - public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset + public static func invalidScenePointer() -> Swift.UnsafeMutablePointer + public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset + public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset< + Base, Member + > } extension AttributeGraph.PointerOffset where Base == Member { - public init() + public init() } extension Swift.UnsafePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - } - public static func + (_ lhs: Swift.UnsafePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + } + public static func + ( + _ lhs: Swift.UnsafePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafePointer } extension Swift.UnsafeMutablePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - nonmutating unsafeMutableAddress - } - public static func + (_ lhs: Swift.UnsafeMutablePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + nonmutating unsafeMutableAddress + } + public static func + ( + _ lhs: Swift.UnsafeMutablePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafeMutablePointer } diff --git a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64e-apple-macos.swiftinterface b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64e-apple-macos.swiftinterface index 2010087..4a13662 100644 --- a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64e-apple-macos.swiftinterface +++ b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64e-apple-macos.swiftinterface @@ -1,6 +1,6 @@ // swift-interface-format-version: 1.0 -// swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) -// swift-module-flags: -target arm64e-apple-macos12.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name AttributeGraph +// swift-compiler-version: Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3) +// swift-module-flags: -target arm64e-apple-macos12.0 -enable-objc-interop -enable-library-evolution -swift-version 6 -enforce-exclusivity=checked -O -module-name AttributeGraph // swift-module-flags-ignorable: -enable-bare-slash-regex @_exported import AttributeGraph import Foundation @@ -13,27 +13,27 @@ import _StringProcessing // MARK: - AnyAttribute extension AttributeGraph.AnyAttribute { - public init(_ attribute: AttributeGraph.Attribute) - public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute - public static var current: AnyAttribute? { get } - public func unsafeOffset(at offset: Int) -> AnyAttribute - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - public func visitBody(_ visitor: inout Visitor); - public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> ()) - public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var _bodyType: Any.Type { get } - public var _bodyPointer: UnsafeRawPointer { get } - public var valueType: Any.Type { get } - public var indirectDependency: AnyAttribute? { - get - nonmutating set - } + public init(_ attribute: AttributeGraph.Attribute) + public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute + public static var current: AnyAttribute? { get } + public func unsafeOffset(at offset: Int) -> AnyAttribute + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + public func visitBody(_ visitor: inout Visitor) + public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + public var _bodyType: Any.Type { get } + public var _bodyPointer: UnsafeRawPointer { get } + public var valueType: Any.Type { get } + public var indirectDependency: AnyAttribute? { + get + nonmutating set + } } extension AttributeGraph.AnyAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } public typealias AttributeUpdateBlock = () -> ((Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void) @@ -48,66 +48,74 @@ public struct Attribute { public init(identifier: AnyAttribute) public init(_ attribute: AttributeGraph.Attribute) - public init(value: Value) - public init(type: Value.Type) - public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: AGAttributeTypeFlags, update: AttributeUpdateBlock) - public var wrappedValue: Value { - unsafeAddress - nonmutating set - } - public var projectedValue: AttributeGraph.Attribute { get set } - + public init(value: Value) + public init(type: Value.Type) + public init( + body: Swift.UnsafePointer, + value: Swift.UnsafePointer?, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) + public var wrappedValue: Value { + unsafeAddress + nonmutating set + } + public var projectedValue: AttributeGraph.Attribute { get set } + public subscript(dynamicMember _: Swift.KeyPath) -> AttributeGraph.Attribute { get } public subscript(keyPath _: Swift.KeyPath) -> AttributeGraph.Attribute { get } - public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) -> AttributeGraph.Attribute { get } - - public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute - public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute - public func applying(offset: AttributeGraph.PointerOffset) -> AttributeGraph.Attribute - public func visitBody(_ visitor: inout Body) - public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) - public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - - public var graph: AGGraph { get } - public var subgraph: AGSubgraph { get } - - public var value: Value { - unsafeAddress - nonmutating set - } - public var valueState: AGValueState { get } - public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public func setValue(_ value: Value) -> Bool - public var hasValue: Bool { get } - public func updateValue() - public func prefetchValue() - public func invalidateValue() - public func validate() - - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - - public var flags: AGAttributeFlags { - get - nonmutating set - } - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + { get } + + public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute + public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute + public func applying(offset: AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + public func visitBody(_ visitor: inout Body) + public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + + public var graph: AGGraph { get } + public var subgraph: AGSubgraph { get } + + public var value: Value { + unsafeAddress + nonmutating set + } + public var valueState: AGValueState { get } + public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public func setValue(_ value: Value) -> Bool + public var hasValue: Bool { get } + public func updateValue() + public func prefetchValue() + public func invalidateValue() + public func validate() + + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + + public var flags: AGAttributeFlags { + get + nonmutating set + } + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) } extension AttributeGraph.Attribute: Swift.Hashable { public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool + public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool public var hashValue: Swift.Int { get } } extension AttributeGraph.Attribute: Swift.CustomStringConvertible { - public var description: String { get } + public var description: String { get } } extension AttributeGraph.Attribute { - public init(_ rule: R) where R.Value == Value - public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value } // MARK: - AnyWeakAttribute @@ -115,140 +123,144 @@ extension AttributeGraph.Attribute { public typealias AnyWeakAttribute = AGWeakAttribute extension AttributeGraph.AnyWeakAttribute { - @_alwaysEmitIntoClient - public init(_ attribute: AnyAttribute?) { - self = __AGCreateWeakAttribute(attribute ?? .nil) - } - - @_alwaysEmitIntoClient - public init(_ weakAttribute: AttributeGraph.WeakAttribute) { - self = weakAttribute.base - } - - @_alwaysEmitIntoClient - public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { - WeakAttribute(base: self) - } - - @_alwaysEmitIntoClient - public var attribute: AnyAttribute? { - get { - let attribute = __AGWeakAttributeGetAttribute(self) - return attribute == .nil ? nil : attribute - } - set { - self = AnyWeakAttribute(newValue) - } - } + @_alwaysEmitIntoClient + public init(_ attribute: AnyAttribute?) { + self = __AGCreateWeakAttribute(attribute ?? .nil) + } + + @_alwaysEmitIntoClient + public init(_ weakAttribute: AttributeGraph.WeakAttribute) { + self = weakAttribute.base + } + + @_alwaysEmitIntoClient + public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { + WeakAttribute(base: self) + } + + @_alwaysEmitIntoClient + public var attribute: AnyAttribute? { + get { + let attribute = __AGWeakAttributeGetAttribute(self) + return attribute == .nil ? nil : attribute + } + set { + self = AnyWeakAttribute(newValue) + } + } } extension AttributeGraph.AnyWeakAttribute: Hashable { - @_alwaysEmitIntoClient - public func hash(into hasher: inout Swift.Hasher) { - hasher.combine(raw_attribute) - hasher.combine(subgraph_id) - } + @_alwaysEmitIntoClient + public func hash(into hasher: inout Swift.Hasher) { + hasher.combine(raw_attribute) + hasher.combine(subgraph_id) + } - @_alwaysEmitIntoClient - public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { - lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id - } + @_alwaysEmitIntoClient + public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { + lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id + } - @_alwaysEmitIntoClient - public var hashValue: Int { - _hashValue(for: self) - } + @_alwaysEmitIntoClient + public var hashValue: Int { + _hashValue(for: self) + } } extension AttributeGraph.AnyWeakAttribute: CustomStringConvertible { - @_alwaysEmitIntoClient - public var description: String { - attribute?.description ?? "nil" - } + @_alwaysEmitIntoClient + public var description: String { + attribute?.description ?? "nil" + } } - // MARK: - WeakAttribute @frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - @usableFromInline - internal var base: AnyWeakAttribute - @_alwaysEmitIntoClient - public init(base: AnyWeakAttribute) { self.base = base } - public init() - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public var wrappedValue: Value? { get } - public var projectedValue: AttributeGraph.Attribute?{ get set } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { get } - public var attribute: AttributeGraph.Attribute? { get set _modify } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? + @usableFromInline + internal var base: AnyWeakAttribute + @_alwaysEmitIntoClient + public init(base: AnyWeakAttribute) { self.base = base } + public init() + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public var wrappedValue: Value? { get } + public var projectedValue: AttributeGraph.Attribute? { get set } + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { + get + } + public var attribute: AttributeGraph.Attribute? { get set _modify } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? } extension AttributeGraph.WeakAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.WeakAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - OptionalAttribute @frozen public struct AnyOptionalAttribute { - public init() - public init(_ attribute: AnyAttribute) - public init(_ attribute: AnyAttribute?) - public init(_ attribute: AttributeGraph.OptionalAttribute) - public var identifier: AnyAttribute - public static var current: AttributeGraph.AnyOptionalAttribute { get } - public var attribute: AnyAttribute? { get set } - public func map(_ body: (AnyAttribute) -> Value) -> Value? - public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute + public init() + public init(_ attribute: AnyAttribute) + public init(_ attribute: AnyAttribute?) + public init(_ attribute: AttributeGraph.OptionalAttribute) + public var identifier: AnyAttribute + public static var current: AttributeGraph.AnyOptionalAttribute { get } + public var attribute: AnyAttribute? { get set } + public func map(_ body: (AnyAttribute) -> Value) -> Value? + public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute } extension AttributeGraph.AnyOptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.AnyOptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } @frozen @propertyWrapper @dynamicMemberLookup public struct OptionalAttribute { - public var base: AttributeGraph.AnyOptionalAttribute - public init() - public init(base: AttributeGraph.AnyOptionalAttribute) - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public var attribute: AttributeGraph.Attribute? { get set } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? - public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? - public var wrappedValue: Value? { get } - public var projectedValue: Attribute? { get set _modify } - public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } + public var base: AttributeGraph.AnyOptionalAttribute + public init() + public init(base: AttributeGraph.AnyOptionalAttribute) + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public init(_ weakAttribute: AttributeGraph.WeakAttribute) + public var attribute: AttributeGraph.Attribute? { get set } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? + public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? + public var wrappedValue: Value? { get } + public var projectedValue: Attribute? { get set _modify } + public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } } extension AttributeGraph.OptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - IndirectAttribute @@ -257,36 +269,37 @@ extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { - public let identifier: AnyAttribute - public init(source: AttributeGraph.Attribute) - public var source: AttributeGraph.Attribute { - get - nonmutating set - nonmutating _modify - } - public var dependency: AnyAttribute? { - get - nonmutating set - } - public var value: Value { - get - nonmutating set - nonmutating _modify - } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public var wrappedValue: Value { - get - nonmutating set - nonmutating _modify - } - public var projectedValue: AttributeGraph.Attribute { get } - public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } + public let identifier: AnyAttribute + public init(source: AttributeGraph.Attribute) + public var source: AttributeGraph.Attribute { + get + nonmutating set + nonmutating _modify + } + public var dependency: AnyAttribute? { + get + nonmutating set + } + public var value: Value { + get + nonmutating set + nonmutating _modify + } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public var wrappedValue: Value { + get + nonmutating set + nonmutating _modify + } + public var projectedValue: AttributeGraph.Attribute { get } + public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } } extension AttributeGraph.IndirectAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } // MARK: - _AttributeBody @@ -317,17 +330,17 @@ public protocol AttributeBodyVisitor { @frozen public struct External { - public init() + public init() } extension AttributeGraph.External: AttributeGraph._AttributeBody { - public static var comparisonMode: AGComparisonMode { get } - public static var flags: AGAttributeTypeFlags { get } - public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static var comparisonMode: AGComparisonMode { get } + public static var flags: AGAttributeTypeFlags { get } + public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) } extension AttributeGraph.External: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - Focus @@ -336,28 +349,28 @@ extension AttributeGraph.External: Swift.CustomStringConvertible { public struct Focus { public var root: Attribute public var keyPath: KeyPath - + public init(root: Attribute, keyPath: KeyPath) } extension AttributeGraph.Focus: AttributeGraph.Rule { - public var value: Self.Value { get } - public static var flags: AGAttributeTypeFlags { get } + public var value: Self.Value { get } + public static var flags: AGAttributeTypeFlags { get } } extension AttributeGraph.Focus: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - ObservedAttribute public protocol ObservedAttribute: AttributeGraph._AttributeBody { - func destroy() + func destroy() } extension AttributeGraph.ObservedAttribute { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { get } + public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) + public static var _hasDestroySelf: Swift.Bool { get } } // MARK: - Graph Related @@ -365,65 +378,69 @@ extension AttributeGraph.ObservedAttribute { // MARK: - AGGraph extension AttributeGraph.AGGraph { - public static func typeIndex( - ctx: AGGraphContext, - body: AttributeGraph._AttributeBody.Type, - valueType: Metadata, - flags: AGAttributeTypeFlags, - update: AttributeUpdateBlock - ) -> Int + public static func typeIndex( + ctx: AGUnownedGraphRef, + body: AttributeGraph._AttributeBody.Type, + valueType: Metadata, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) -> Int } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphStartProfiling") - public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStartProfiling") + public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) - @_silgen_name("AGGraphStopProfiling") - public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStopProfiling") + public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphSetInvalidationCallback") - public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) + @_silgen_name("AGGraphSetInvalidationCallback") + public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) - @_silgen_name("AGGraphSetUpdateCallback") - public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) + @_silgen_name("AGGraphSetUpdateCallback") + public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) } extension AttributeGraph.AGGraph { - @_transparent - @inline(__always) - public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: ._10)) } + @_transparent + @inline(__always) + public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: .mainThreadUpdateCount)) } } extension AttributeGraph.AGGraph { - public static func withoutUpdate(_ body: () -> Value) -> Value + public static func withoutUpdate(_ body: () -> Value) -> Value } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphGetOutputValue") - @inline(__always) - @inlinable - public static func outputValue() -> Swift.UnsafePointer? + @_silgen_name("AGGraphGetOutputValue") + @inline(__always) + @inlinable + public static func outputValue() -> Swift.UnsafePointer? - @_silgen_name("AGGraphSetOutputValue") - @inline(__always) - @inlinable - public static func setOutputValue(_ value: Swift.UnsafePointer) + @_silgen_name("AGGraphSetOutputValue") + @inline(__always) + @inlinable + public static func setOutputValue(_ value: Swift.UnsafePointer) } // MARK: - AGSubgraph extension AttributeGraph.AGSubgraph { - public func addObserver(_ observer: () -> Void) -> Swift.Int - public func apply(_ body: () -> Value) -> Value - public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) + public func addObserver(_ observer: () -> Void) -> Swift.Int + public func apply(_ body: () -> Value) -> Value + public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) } extension AttributeGraph.AGSubgraph { - public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) - public static func endTreeElement(value: AttributeGraph.Attribute) - public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) + public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) + public static func endTreeElement(value: AttributeGraph.Attribute) + public static func addTreeValue( + _ value: AttributeGraph.Attribute, + forKey key: Swift.UnsafePointer, + flags: Swift.UInt32 + ) } // MARK: - Rule Related @@ -438,97 +455,114 @@ public protocol Rule: AttributeGraph._AttributeBody { extension AttributeGraph.Rule { public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.Rule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } } extension AttributeGraph.Rule where Self: Swift.Hashable { - public func cachedValueIfExists( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value? + public func cachedValueIfExists( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value? - public func cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value + public func cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value - public static func _cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute?, - hashValue: Swift.Int, - bodyPtr: Swift.UnsafeRawPointer, - update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> () - ) -> Swift.UnsafePointer + public static func _cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute?, + hashValue: Swift.Int, + bodyPtr: Swift.UnsafeRawPointer, + update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void + ) -> Swift.UnsafePointer } // MARK: - StateRule public protocol StatefulRule: AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Value? { get } - mutating func updateValue() + associatedtype Value + static var initialValue: Value? { get } + mutating func updateValue() } extension AttributeGraph.StatefulRule { - public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static var initialValue: Self.Value? { get } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.StatefulRule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool { get } } // MARK: - RuleContext @frozen public struct RuleContext { - public var attribute: AttributeGraph.Attribute - public init(attribute: AttributeGraph.Attribute) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) + public var attribute: AttributeGraph.Attribute + public init(attribute: AttributeGraph.Attribute) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) } // MARK: - AnyRuleContext @frozen public struct AnyRuleContext { - public var attribute: AnyAttribute - public init(attribute: AnyAttribute) - public init(_ context: AttributeGraph.RuleContext) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) - public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext + public var attribute: AnyAttribute + public init(attribute: AnyAttribute) + public init(_ context: AttributeGraph.RuleContext) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) + public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext } // MARK: - Runtime Related // MARK: - CompareValues -public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = ._3) -> Swift.Bool +extension AGComparisonOptions { + public init(mode: AGComparisonMode) +} + +public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = .equatableAlways) -> Swift.Bool public func compareValues(_ lhs: A, _ rhs: A, options: AGComparisonOptions) -> Swift.Bool // MARK: - Metadata +public func forEachField( + of type: Any.Type, + do body: (UnsafePointer, Int, Any.Type) -> Void +) + extension Metadata: Swift.CustomStringConvertible { public init(_ type: Any.Type) public var type: Any.Type { get } @@ -539,83 +573,97 @@ extension Metadata: Swift.CustomStringConvertible { ) -> Bool } +// MARK: - Signature + +extension Signature: Swift.Equatable {} + // MARK: - TupleType extension TupleType { - @_transparent + @_transparent public init(_ types: [Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) } - - @_transparent + + @_transparent public init(_ type: Any.Type) { - self.init(rawValue: unsafeBitCast(type, to: UnsafePointer<_Metadata>.self)) + self.init(rawValue: unsafeBitCast(type, to: OpaquePointer.self)) } - - @_transparent + + @_transparent public var isEmpty: Bool { count == 0 } - @_transparent - public var indices: Range { 0 ..< count } - - @_transparent + @_transparent + public var indices: Range { 0.. Any.Type { elementType(at: index).type } - - @_transparent + + @_transparent public func offset(at index: Int, as type: T.Type) -> Int { elementOffset(at: index, type: Metadata(type)) } - - @_transparent - public func setElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, from srcValue: UnsafePointer, options: CopyOptions) { + + @_transparent + public func setElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + from srcValue: UnsafePointer, + options: CopyOptions + ) { __AGTupleSetElement(self, tupleValue, index, srcValue, Metadata(T.self), options) } - - @_transparent - public func getElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, to dstValue: UnsafeMutablePointer, options: CopyOptions) { + + @_transparent + public func getElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + to dstValue: UnsafeMutablePointer, + options: CopyOptions + ) { __AGTupleGetElement(self, tupleValue, index, dstValue, Metadata(T.self), options) } } @_silgen_name("AGTupleWithBuffer") -public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> ()) +public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> Void) // MARK: - UnsafeTuple extension UnsafeTuple { - @_transparent + @_transparent public var count: Int { type.count } - - @_transparent - public var isEmpty: Bool { type.isEmpty } - - @_transparent - public var indices: Range { type.indices } - - @_transparent + + @_transparent + public var isEmpty: Bool { type.isEmpty } + + @_transparent + public var indices: Range { type.indices } + + @_transparent public func address(as _: T.Type = T.self) -> UnsafePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { address(of: index, as: T.self) } } @@ -630,61 +678,61 @@ extension UnsafeTuple { /*private*/ public func slowDealloc(_ ptr: UnsafeMutableRawPointer, _ size: Int, _ alignMask: Int) extension UnsafeMutableTuple { - @_transparent + @_transparent public init(with tupleType: TupleType) { self.init(type: tupleType, value: slowAlloc(tupleType.size, -1)) } - @_transparent + @_transparent public func initialize(at index: Int, to element: T) { withUnsafePointer(to: element) { elementPointer in type.setElement(in: value, at: index, from: elementPointer, options: .initCopy) } } - @_transparent + @_transparent public func deinitialize() { type.destroy(value) } - @_transparent + @_transparent public func deinitialize(at index: Int) { type.destroy(value, at: index) } - @_transparent + @_transparent public func deallocate(initialized: Bool) { if initialized { deinitialize() } slowDealloc(value, -1, -1) - } - @_transparent + } + @_transparent public var count: Int { type.count } - @_transparent + @_transparent public var isEmpty: Bool { type.isEmpty } - @_transparent + @_transparent public var indices: Range { type.indices } - - @_transparent + + @_transparent public func address(as _: T.Type = T.self) -> UnsafeMutablePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafeMutablePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { UnsafePointer(address(as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { UnsafePointer(address(of: index, as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(of: index, as: T.self) } @@ -724,30 +772,41 @@ public func AGTypeApplyFields2( @frozen public struct PointerOffset { - public var byteOffset: Swift.Int - public init(byteOffset: Swift.Int) + public var byteOffset: Swift.Int + public init(byteOffset: Swift.Int) } extension AttributeGraph.PointerOffset { - public static func + (_ lhs: AttributeGraph.PointerOffset, _ rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset + public static func + ( + _ lhs: AttributeGraph.PointerOffset, + _ rhs: AttributeGraph.PointerOffset + ) -> AttributeGraph.PointerOffset } extension AttributeGraph.PointerOffset { - public static func invalidScenePointer() -> Swift.UnsafeMutablePointer - public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset - public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset + public static func invalidScenePointer() -> Swift.UnsafeMutablePointer + public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset + public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset< + Base, Member + > } extension AttributeGraph.PointerOffset where Base == Member { - public init() + public init() } extension Swift.UnsafePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - } - public static func + (_ lhs: Swift.UnsafePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + } + public static func + ( + _ lhs: Swift.UnsafePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafePointer } extension Swift.UnsafeMutablePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - nonmutating unsafeMutableAddress - } - public static func + (_ lhs: Swift.UnsafeMutablePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + nonmutating unsafeMutableAddress + } + public static func + ( + _ lhs: Swift.UnsafeMutablePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafeMutablePointer } diff --git a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-macos.swiftinterface b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-macos.swiftinterface index 778068d..641e380 100644 --- a/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-macos.swiftinterface +++ b/AG/2024/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-macos.swiftinterface @@ -1,6 +1,6 @@ // swift-interface-format-version: 1.0 -// swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) -// swift-module-flags: -target x86_64-apple-macos12.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name AttributeGraph +// swift-compiler-version: Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3) +// swift-module-flags: -target x86_64-apple-macos12.0 -enable-objc-interop -enable-library-evolution -swift-version 6 -enforce-exclusivity=checked -O -module-name AttributeGraph // swift-module-flags-ignorable: -enable-bare-slash-regex @_exported import AttributeGraph import Foundation @@ -13,27 +13,27 @@ import _StringProcessing // MARK: - AnyAttribute extension AttributeGraph.AnyAttribute { - public init(_ attribute: AttributeGraph.Attribute) - public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute - public static var current: AnyAttribute? { get } - public func unsafeOffset(at offset: Int) -> AnyAttribute - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - public func visitBody(_ visitor: inout Visitor); - public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> ()) - public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var _bodyType: Any.Type { get } - public var _bodyPointer: UnsafeRawPointer { get } - public var valueType: Any.Type { get } - public var indirectDependency: AnyAttribute? { - get - nonmutating set - } + public init(_ attribute: AttributeGraph.Attribute) + public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute + public static var current: AnyAttribute? { get } + public func unsafeOffset(at offset: Int) -> AnyAttribute + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + public func visitBody(_ visitor: inout Visitor) + public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + public var _bodyType: Any.Type { get } + public var _bodyPointer: UnsafeRawPointer { get } + public var valueType: Any.Type { get } + public var indirectDependency: AnyAttribute? { + get + nonmutating set + } } extension AttributeGraph.AnyAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } public typealias AttributeUpdateBlock = () -> ((Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void) @@ -48,66 +48,74 @@ public struct Attribute { public init(identifier: AnyAttribute) public init(_ attribute: AttributeGraph.Attribute) - public init(value: Value) - public init(type: Value.Type) - public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: AGAttributeTypeFlags, update: AttributeUpdateBlock) - public var wrappedValue: Value { - unsafeAddress - nonmutating set - } - public var projectedValue: AttributeGraph.Attribute { get set } - + public init(value: Value) + public init(type: Value.Type) + public init( + body: Swift.UnsafePointer, + value: Swift.UnsafePointer?, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) + public var wrappedValue: Value { + unsafeAddress + nonmutating set + } + public var projectedValue: AttributeGraph.Attribute { get set } + public subscript(dynamicMember _: Swift.KeyPath) -> AttributeGraph.Attribute { get } public subscript(keyPath _: Swift.KeyPath) -> AttributeGraph.Attribute { get } - public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) -> AttributeGraph.Attribute { get } - - public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute - public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute - public func applying(offset: AttributeGraph.PointerOffset) -> AttributeGraph.Attribute - public func visitBody(_ visitor: inout Body) - public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) - public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - - public var graph: AGGraph { get } - public var subgraph: AGSubgraph { get } - - public var value: Value { - unsafeAddress - nonmutating set - } - public var valueState: AGValueState { get } - public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public func setValue(_ value: Value) -> Bool - public var hasValue: Bool { get } - public func updateValue() - public func prefetchValue() - public func invalidateValue() - public func validate() - - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - - public var flags: AGAttributeFlags { - get - nonmutating set - } - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + { get } + + public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute + public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute + public func applying(offset: AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + public func visitBody(_ visitor: inout Body) + public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + + public var graph: AGGraph { get } + public var subgraph: AGSubgraph { get } + + public var value: Value { + unsafeAddress + nonmutating set + } + public var valueState: AGValueState { get } + public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public func setValue(_ value: Value) -> Bool + public var hasValue: Bool { get } + public func updateValue() + public func prefetchValue() + public func invalidateValue() + public func validate() + + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + + public var flags: AGAttributeFlags { + get + nonmutating set + } + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) } extension AttributeGraph.Attribute: Swift.Hashable { public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool + public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool public var hashValue: Swift.Int { get } } extension AttributeGraph.Attribute: Swift.CustomStringConvertible { - public var description: String { get } + public var description: String { get } } extension AttributeGraph.Attribute { - public init(_ rule: R) where R.Value == Value - public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value } // MARK: - AnyWeakAttribute @@ -115,140 +123,144 @@ extension AttributeGraph.Attribute { public typealias AnyWeakAttribute = AGWeakAttribute extension AttributeGraph.AnyWeakAttribute { - @_alwaysEmitIntoClient - public init(_ attribute: AnyAttribute?) { - self = __AGCreateWeakAttribute(attribute ?? .nil) - } - - @_alwaysEmitIntoClient - public init(_ weakAttribute: AttributeGraph.WeakAttribute) { - self = weakAttribute.base - } - - @_alwaysEmitIntoClient - public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { - WeakAttribute(base: self) - } - - @_alwaysEmitIntoClient - public var attribute: AnyAttribute? { - get { - let attribute = __AGWeakAttributeGetAttribute(self) - return attribute == .nil ? nil : attribute - } - set { - self = AnyWeakAttribute(newValue) - } - } + @_alwaysEmitIntoClient + public init(_ attribute: AnyAttribute?) { + self = __AGCreateWeakAttribute(attribute ?? .nil) + } + + @_alwaysEmitIntoClient + public init(_ weakAttribute: AttributeGraph.WeakAttribute) { + self = weakAttribute.base + } + + @_alwaysEmitIntoClient + public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { + WeakAttribute(base: self) + } + + @_alwaysEmitIntoClient + public var attribute: AnyAttribute? { + get { + let attribute = __AGWeakAttributeGetAttribute(self) + return attribute == .nil ? nil : attribute + } + set { + self = AnyWeakAttribute(newValue) + } + } } extension AttributeGraph.AnyWeakAttribute: Hashable { - @_alwaysEmitIntoClient - public func hash(into hasher: inout Swift.Hasher) { - hasher.combine(raw_attribute) - hasher.combine(subgraph_id) - } + @_alwaysEmitIntoClient + public func hash(into hasher: inout Swift.Hasher) { + hasher.combine(raw_attribute) + hasher.combine(subgraph_id) + } - @_alwaysEmitIntoClient - public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { - lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id - } + @_alwaysEmitIntoClient + public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { + lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id + } - @_alwaysEmitIntoClient - public var hashValue: Int { - _hashValue(for: self) - } + @_alwaysEmitIntoClient + public var hashValue: Int { + _hashValue(for: self) + } } extension AttributeGraph.AnyWeakAttribute: CustomStringConvertible { - @_alwaysEmitIntoClient - public var description: String { - attribute?.description ?? "nil" - } + @_alwaysEmitIntoClient + public var description: String { + attribute?.description ?? "nil" + } } - // MARK: - WeakAttribute @frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - @usableFromInline - internal var base: AnyWeakAttribute - @_alwaysEmitIntoClient - public init(base: AnyWeakAttribute) { self.base = base } - public init() - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public var wrappedValue: Value? { get } - public var projectedValue: AttributeGraph.Attribute?{ get set } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { get } - public var attribute: AttributeGraph.Attribute? { get set _modify } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? + @usableFromInline + internal var base: AnyWeakAttribute + @_alwaysEmitIntoClient + public init(base: AnyWeakAttribute) { self.base = base } + public init() + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public var wrappedValue: Value? { get } + public var projectedValue: AttributeGraph.Attribute? { get set } + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { + get + } + public var attribute: AttributeGraph.Attribute? { get set _modify } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? } extension AttributeGraph.WeakAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.WeakAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - OptionalAttribute @frozen public struct AnyOptionalAttribute { - public init() - public init(_ attribute: AnyAttribute) - public init(_ attribute: AnyAttribute?) - public init(_ attribute: AttributeGraph.OptionalAttribute) - public var identifier: AnyAttribute - public static var current: AttributeGraph.AnyOptionalAttribute { get } - public var attribute: AnyAttribute? { get set } - public func map(_ body: (AnyAttribute) -> Value) -> Value? - public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute + public init() + public init(_ attribute: AnyAttribute) + public init(_ attribute: AnyAttribute?) + public init(_ attribute: AttributeGraph.OptionalAttribute) + public var identifier: AnyAttribute + public static var current: AttributeGraph.AnyOptionalAttribute { get } + public var attribute: AnyAttribute? { get set } + public func map(_ body: (AnyAttribute) -> Value) -> Value? + public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute } extension AttributeGraph.AnyOptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.AnyOptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } @frozen @propertyWrapper @dynamicMemberLookup public struct OptionalAttribute { - public var base: AttributeGraph.AnyOptionalAttribute - public init() - public init(base: AttributeGraph.AnyOptionalAttribute) - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public var attribute: AttributeGraph.Attribute? { get set } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? - public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? - public var wrappedValue: Value? { get } - public var projectedValue: Attribute? { get set _modify } - public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } + public var base: AttributeGraph.AnyOptionalAttribute + public init() + public init(base: AttributeGraph.AnyOptionalAttribute) + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public init(_ weakAttribute: AttributeGraph.WeakAttribute) + public var attribute: AttributeGraph.Attribute? { get set } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? + public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? + public var wrappedValue: Value? { get } + public var projectedValue: Attribute? { get set _modify } + public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } } extension AttributeGraph.OptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - IndirectAttribute @@ -257,36 +269,37 @@ extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { - public let identifier: AnyAttribute - public init(source: AttributeGraph.Attribute) - public var source: AttributeGraph.Attribute { - get - nonmutating set - nonmutating _modify - } - public var dependency: AnyAttribute? { - get - nonmutating set - } - public var value: Value { - get - nonmutating set - nonmutating _modify - } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public var wrappedValue: Value { - get - nonmutating set - nonmutating _modify - } - public var projectedValue: AttributeGraph.Attribute { get } - public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } + public let identifier: AnyAttribute + public init(source: AttributeGraph.Attribute) + public var source: AttributeGraph.Attribute { + get + nonmutating set + nonmutating _modify + } + public var dependency: AnyAttribute? { + get + nonmutating set + } + public var value: Value { + get + nonmutating set + nonmutating _modify + } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public var wrappedValue: Value { + get + nonmutating set + nonmutating _modify + } + public var projectedValue: AttributeGraph.Attribute { get } + public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } } extension AttributeGraph.IndirectAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } // MARK: - _AttributeBody @@ -317,17 +330,17 @@ public protocol AttributeBodyVisitor { @frozen public struct External { - public init() + public init() } extension AttributeGraph.External: AttributeGraph._AttributeBody { - public static var comparisonMode: AGComparisonMode { get } - public static var flags: AGAttributeTypeFlags { get } - public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static var comparisonMode: AGComparisonMode { get } + public static var flags: AGAttributeTypeFlags { get } + public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) } extension AttributeGraph.External: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - Focus @@ -336,28 +349,28 @@ extension AttributeGraph.External: Swift.CustomStringConvertible { public struct Focus { public var root: Attribute public var keyPath: KeyPath - + public init(root: Attribute, keyPath: KeyPath) } extension AttributeGraph.Focus: AttributeGraph.Rule { - public var value: Self.Value { get } - public static var flags: AGAttributeTypeFlags { get } + public var value: Self.Value { get } + public static var flags: AGAttributeTypeFlags { get } } extension AttributeGraph.Focus: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - ObservedAttribute public protocol ObservedAttribute: AttributeGraph._AttributeBody { - func destroy() + func destroy() } extension AttributeGraph.ObservedAttribute { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { get } + public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) + public static var _hasDestroySelf: Swift.Bool { get } } // MARK: - Graph Related @@ -365,65 +378,69 @@ extension AttributeGraph.ObservedAttribute { // MARK: - AGGraph extension AttributeGraph.AGGraph { - public static func typeIndex( - ctx: AGGraphContext, - body: AttributeGraph._AttributeBody.Type, - valueType: Metadata, - flags: AGAttributeTypeFlags, - update: AttributeUpdateBlock - ) -> Int + public static func typeIndex( + ctx: AGUnownedGraphRef, + body: AttributeGraph._AttributeBody.Type, + valueType: Metadata, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) -> Int } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphStartProfiling") - public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStartProfiling") + public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) - @_silgen_name("AGGraphStopProfiling") - public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStopProfiling") + public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphSetInvalidationCallback") - public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) + @_silgen_name("AGGraphSetInvalidationCallback") + public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) - @_silgen_name("AGGraphSetUpdateCallback") - public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) + @_silgen_name("AGGraphSetUpdateCallback") + public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) } extension AttributeGraph.AGGraph { - @_transparent - @inline(__always) - public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: ._10)) } + @_transparent + @inline(__always) + public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: .mainThreadUpdateCount)) } } extension AttributeGraph.AGGraph { - public static func withoutUpdate(_ body: () -> Value) -> Value + public static func withoutUpdate(_ body: () -> Value) -> Value } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphGetOutputValue") - @inline(__always) - @inlinable - public static func outputValue() -> Swift.UnsafePointer? + @_silgen_name("AGGraphGetOutputValue") + @inline(__always) + @inlinable + public static func outputValue() -> Swift.UnsafePointer? - @_silgen_name("AGGraphSetOutputValue") - @inline(__always) - @inlinable - public static func setOutputValue(_ value: Swift.UnsafePointer) + @_silgen_name("AGGraphSetOutputValue") + @inline(__always) + @inlinable + public static func setOutputValue(_ value: Swift.UnsafePointer) } // MARK: - AGSubgraph extension AttributeGraph.AGSubgraph { - public func addObserver(_ observer: () -> Void) -> Swift.Int - public func apply(_ body: () -> Value) -> Value - public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) + public func addObserver(_ observer: () -> Void) -> Swift.Int + public func apply(_ body: () -> Value) -> Value + public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) } extension AttributeGraph.AGSubgraph { - public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) - public static func endTreeElement(value: AttributeGraph.Attribute) - public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) + public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) + public static func endTreeElement(value: AttributeGraph.Attribute) + public static func addTreeValue( + _ value: AttributeGraph.Attribute, + forKey key: Swift.UnsafePointer, + flags: Swift.UInt32 + ) } // MARK: - Rule Related @@ -438,97 +455,114 @@ public protocol Rule: AttributeGraph._AttributeBody { extension AttributeGraph.Rule { public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.Rule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } } extension AttributeGraph.Rule where Self: Swift.Hashable { - public func cachedValueIfExists( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value? + public func cachedValueIfExists( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value? - public func cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value + public func cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value - public static func _cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute?, - hashValue: Swift.Int, - bodyPtr: Swift.UnsafeRawPointer, - update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> () - ) -> Swift.UnsafePointer + public static func _cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute?, + hashValue: Swift.Int, + bodyPtr: Swift.UnsafeRawPointer, + update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void + ) -> Swift.UnsafePointer } // MARK: - StateRule public protocol StatefulRule: AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Value? { get } - mutating func updateValue() + associatedtype Value + static var initialValue: Value? { get } + mutating func updateValue() } extension AttributeGraph.StatefulRule { - public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static var initialValue: Self.Value? { get } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.StatefulRule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool { get } } // MARK: - RuleContext @frozen public struct RuleContext { - public var attribute: AttributeGraph.Attribute - public init(attribute: AttributeGraph.Attribute) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) + public var attribute: AttributeGraph.Attribute + public init(attribute: AttributeGraph.Attribute) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) } // MARK: - AnyRuleContext @frozen public struct AnyRuleContext { - public var attribute: AnyAttribute - public init(attribute: AnyAttribute) - public init(_ context: AttributeGraph.RuleContext) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) - public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext + public var attribute: AnyAttribute + public init(attribute: AnyAttribute) + public init(_ context: AttributeGraph.RuleContext) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) + public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext } // MARK: - Runtime Related // MARK: - CompareValues -public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = ._3) -> Swift.Bool +extension AGComparisonOptions { + public init(mode: AGComparisonMode) +} + +public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = .equatableAlways) -> Swift.Bool public func compareValues(_ lhs: A, _ rhs: A, options: AGComparisonOptions) -> Swift.Bool // MARK: - Metadata +public func forEachField( + of type: Any.Type, + do body: (UnsafePointer, Int, Any.Type) -> Void +) + extension Metadata: Swift.CustomStringConvertible { public init(_ type: Any.Type) public var type: Any.Type { get } @@ -539,83 +573,97 @@ extension Metadata: Swift.CustomStringConvertible { ) -> Bool } +// MARK: - Signature + +extension Signature: Swift.Equatable {} + // MARK: - TupleType extension TupleType { - @_transparent + @_transparent public init(_ types: [Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) } - - @_transparent + + @_transparent public init(_ type: Any.Type) { - self.init(rawValue: unsafeBitCast(type, to: UnsafePointer<_Metadata>.self)) + self.init(rawValue: unsafeBitCast(type, to: OpaquePointer.self)) } - - @_transparent + + @_transparent public var isEmpty: Bool { count == 0 } - @_transparent - public var indices: Range { 0 ..< count } - - @_transparent + @_transparent + public var indices: Range { 0.. Any.Type { elementType(at: index).type } - - @_transparent + + @_transparent public func offset(at index: Int, as type: T.Type) -> Int { elementOffset(at: index, type: Metadata(type)) } - - @_transparent - public func setElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, from srcValue: UnsafePointer, options: CopyOptions) { + + @_transparent + public func setElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + from srcValue: UnsafePointer, + options: CopyOptions + ) { __AGTupleSetElement(self, tupleValue, index, srcValue, Metadata(T.self), options) } - - @_transparent - public func getElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, to dstValue: UnsafeMutablePointer, options: CopyOptions) { + + @_transparent + public func getElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + to dstValue: UnsafeMutablePointer, + options: CopyOptions + ) { __AGTupleGetElement(self, tupleValue, index, dstValue, Metadata(T.self), options) } } @_silgen_name("AGTupleWithBuffer") -public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> ()) +public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> Void) // MARK: - UnsafeTuple extension UnsafeTuple { - @_transparent + @_transparent public var count: Int { type.count } - - @_transparent - public var isEmpty: Bool { type.isEmpty } - - @_transparent - public var indices: Range { type.indices } - - @_transparent + + @_transparent + public var isEmpty: Bool { type.isEmpty } + + @_transparent + public var indices: Range { type.indices } + + @_transparent public func address(as _: T.Type = T.self) -> UnsafePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { address(of: index, as: T.self) } } @@ -630,61 +678,61 @@ extension UnsafeTuple { /*private*/ public func slowDealloc(_ ptr: UnsafeMutableRawPointer, _ size: Int, _ alignMask: Int) extension UnsafeMutableTuple { - @_transparent + @_transparent public init(with tupleType: TupleType) { self.init(type: tupleType, value: slowAlloc(tupleType.size, -1)) } - @_transparent + @_transparent public func initialize(at index: Int, to element: T) { withUnsafePointer(to: element) { elementPointer in type.setElement(in: value, at: index, from: elementPointer, options: .initCopy) } } - @_transparent + @_transparent public func deinitialize() { type.destroy(value) } - @_transparent + @_transparent public func deinitialize(at index: Int) { type.destroy(value, at: index) } - @_transparent + @_transparent public func deallocate(initialized: Bool) { if initialized { deinitialize() } slowDealloc(value, -1, -1) - } - @_transparent + } + @_transparent public var count: Int { type.count } - @_transparent + @_transparent public var isEmpty: Bool { type.isEmpty } - @_transparent + @_transparent public var indices: Range { type.indices } - - @_transparent + + @_transparent public func address(as _: T.Type = T.self) -> UnsafeMutablePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafeMutablePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { UnsafePointer(address(as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { UnsafePointer(address(of: index, as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(of: index, as: T.self) } @@ -724,30 +772,41 @@ public func AGTypeApplyFields2( @frozen public struct PointerOffset { - public var byteOffset: Swift.Int - public init(byteOffset: Swift.Int) + public var byteOffset: Swift.Int + public init(byteOffset: Swift.Int) } extension AttributeGraph.PointerOffset { - public static func + (_ lhs: AttributeGraph.PointerOffset, _ rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset + public static func + ( + _ lhs: AttributeGraph.PointerOffset, + _ rhs: AttributeGraph.PointerOffset + ) -> AttributeGraph.PointerOffset } extension AttributeGraph.PointerOffset { - public static func invalidScenePointer() -> Swift.UnsafeMutablePointer - public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset - public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset + public static func invalidScenePointer() -> Swift.UnsafeMutablePointer + public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset + public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset< + Base, Member + > } extension AttributeGraph.PointerOffset where Base == Member { - public init() + public init() } extension Swift.UnsafePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - } - public static func + (_ lhs: Swift.UnsafePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + } + public static func + ( + _ lhs: Swift.UnsafePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafePointer } extension Swift.UnsafeMutablePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - nonmutating unsafeMutableAddress - } - public static func + (_ lhs: Swift.UnsafeMutablePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + nonmutating unsafeMutableAddress + } + public static func + ( + _ lhs: Swift.UnsafeMutablePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafeMutablePointer } diff --git a/AG/2024/Sources/Headers/AGAttributeType.h b/AG/2024/Sources/Headers/AGAttributeType.h index 4229ac2..0579f04 100644 --- a/AG/2024/Sources/Headers/AGAttributeType.h +++ b/AG/2024/Sources/Headers/AGAttributeType.h @@ -1,6 +1,6 @@ // // AGAttributeType.h -// +// // // Created by Kyle on 2024/2/17. // @@ -8,15 +8,35 @@ #ifndef AGAttributeType_h #define AGAttributeType_h +#include "AGAttributeTypeFlags.h" #include "AGBase.h" #include "AGTypeID.h" AG_ASSUME_NONNULL_BEGIN +typedef struct AGClosureStorage { + void *function; + void *context; +} AGClosureStorage; + +typedef struct AGAttributeVTable { +} AGAttributeVTable; + typedef struct AGAttributeType { AGTypeID typeID; AGTypeID valueTypeID; - // TODO + + AGClosureStorage updateClosure; + + AGAttributeVTable *_Nullable callbacks; + AGAttributeTypeFlags flags; + + // set after construction + uint32_t offset; + const unsigned char *_Nullable layout; + + AGTypeID initialTypeID; + void *initialBodyTypeID; } AGAttributeType; AG_ASSUME_NONNULL_END diff --git a/AG/2024/Sources/Headers/AGCompareValues.h b/AG/2024/Sources/Headers/AGCompareValues.h index 2fc6604..398c60b 100644 --- a/AG/2024/Sources/Headers/AGCompareValues.h +++ b/AG/2024/Sources/Headers/AGCompareValues.h @@ -12,9 +12,15 @@ #include "AGComparisonMode.h" AG_EXTERN_C_BEGIN + AG_EXPORT AG_REFINED_FOR_SWIFT bool AGCompareValues(const void *lhs, const void *rhs, const void *type, const AGComparisonMode comparisonMode); + +AG_EXPORT +AG_REFINED_FOR_SWIFT +const unsigned char *_Nullable AGPrefetchCompareValues(AGTypeID type, AGComparisonOptions options, uint32_t priority); + AG_EXTERN_C_END #endif /* AGCompareValues_h */ diff --git a/AG/2024/Sources/Headers/AGComparisonMode.h b/AG/2024/Sources/Headers/AGComparisonMode.h index b4a5b9f..ec83f07 100644 --- a/AG/2024/Sources/Headers/AGComparisonMode.h +++ b/AG/2024/Sources/Headers/AGComparisonMode.h @@ -10,19 +10,19 @@ #include "AGBase.h" -typedef AG_OPTIONS(uint32_t, AGComparisonMode) { - AGComparisonMode_0 = 0, - AGComparisonMode_1 = 1 << 0, - AGComparisonMode_2 = 1 << 1, - AGComparisonMode_3 = AGComparisonMode_1 | AGComparisonMode_2, +typedef AG_ENUM(uint8_t, AGComparisonMode){ + AGComparisonModeBitwise = 0, + AGComparisonModeIndirect = 1, + AGComparisonModeEquatableUnlessPOD = 2, + AGComparisonModeEquatableAlways = 3, }; -typedef AG_OPTIONS(uint32_t, AGComparisonOptions) { - AGComparisonOptions_0 = 0, - AGComparisonOptions_1 = 1 << 0, - AGComparisonOptions_2 = 1 << 1, - AGComparisonOptions_3 = AGComparisonOptions_1 | AGComparisonOptions_2, +typedef AG_OPTIONS(uint32_t, AGComparisonOptions){ + AGComparisonOptionsComparisonModeMask = 0xff, + + AGComparisonOptionsCopyOnWrite = 1 << 8, + AGComparisonOptionsFetchLayoutsSynchronously = 1 << 9, + AGComparisonOptionsReportFailures = 1ul << 31, // -1 signed int }; #endif /* AGComparisonMode_h */ - diff --git a/AG/2024/Sources/Headers/AGCounterQueryType.h b/AG/2024/Sources/Headers/AGCounterQueryType.h deleted file mode 100644 index 2a60455..0000000 --- a/AG/2024/Sources/Headers/AGCounterQueryType.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// AGCounterQueryType.h -// -// -// Created by Kyle on 2024/3/8. -// - -#ifndef AGCounterQueryType_h -#define AGCounterQueryType_h - -#include "AGBase.h" - -typedef AG_ENUM(uint32_t, AGCounterQueryType) { - AGCounterQueryType_0, - AGCounterQueryType_1, - AGCounterQueryType_2, - AGCounterQueryType_3, - AGCounterQueryType_4, - AGCounterQueryType_5, - AGCounterQueryType_6, - AGCounterQueryType_7, - AGCounterQueryType_8, - AGCounterQueryType_9, - AGCounterQueryType_10, -}; - -#endif /* AGCounterQueryType_h */ diff --git a/AG/2024/Sources/Headers/AGGraph.h b/AG/2024/Sources/Headers/AGGraph.h index 1bd7674..65eedf4 100644 --- a/AG/2024/Sources/Headers/AGGraph.h +++ b/AG/2024/Sources/Headers/AGGraph.h @@ -10,17 +10,19 @@ #include "AGBase.h" #include "CFRuntime.h" -#include "AGCounterQueryType.h" +#include "AGGraphCounterQuery.h" // Note: Place all structure declaration in a single place to avoid header cycle dependency typedef struct AG_BRIDGED_TYPE(id) AGGraphStorage * AGGraphRef; -typedef struct AG_BRIDGED_TYPE(id) AGGraphContextStorage * AGGraphContextRef; typedef struct AG_BRIDGED_TYPE(id) AGSubgraphStorage * AGSubgraphRef; +typedef void * AGUnownedGraphRef; +typedef struct AGGraphContextStorage * AGUnownedGraphContextRef; + struct AGGraphStorage; -struct AGGraphContextStorage; struct AGSubgraphStorage; +struct AGGraphContextStorage; typedef uint32_t AGAttribute AG_SWIFT_STRUCT AG_SWIFT_NAME(AnyAttribute); @@ -68,7 +70,7 @@ void AGGraphSetContext(AGGraphRef graph, const void * _Nullable context) AG_SWIF AG_EXPORT AG_REFINED_FOR_SWIFT -AGGraphContextRef AGGraphGetGraphContext(AGGraphRef graph) AG_SWIFT_NAME(getter:AGGraphRef.graphContext(self:)); +AGUnownedGraphRef AGGraphGetGraphContext(AGGraphRef graph) AG_SWIFT_NAME(getter:AGGraphRef.graphContext(self:)); AG_EXPORT AG_REFINED_FOR_SWIFT @@ -92,7 +94,7 @@ void AGGraphSetUpdateCallback(AGGraphRef graph, AG_EXPORT AG_REFINED_FOR_SWIFT -uint64_t AGGraphGetCounter(AGGraphRef graph, AGCounterQueryType query) AG_SWIFT_NAME(AGGraphRef.counter(self:for:)); +uint64_t AGGraphGetCounter(AGGraphRef graph, AGGraphCounterQuery query) AG_SWIFT_NAME(AGGraphRef.counter(self:for:)); AG_EXPORT AG_REFINED_FOR_SWIFT diff --git a/AG/2024/Sources/Headers/AGGraphContext.h b/AG/2024/Sources/Headers/AGGraphContext.h index eee32d0..4d6e84f 100644 --- a/AG/2024/Sources/Headers/AGGraphContext.h +++ b/AG/2024/Sources/Headers/AGGraphContext.h @@ -19,7 +19,7 @@ AG_EXTERN_C_BEGIN AG_EXPORT AG_REFINED_FOR_SWIFT -AGGraphRef AGGraphContextGetGraph(AGGraphContextRef context) AG_SWIFT_NAME(getter:AGGraphContextRef.graph(self:)); +AGGraphRef AGGraphContextGetGraph(AGUnownedGraphContextRef context) AG_SWIFT_NAME(getter:AGUnownedGraphContextRef.graph(self:)); AG_EXTERN_C_END diff --git a/AG/2024/Sources/Headers/AGGraphCounterQuery.h b/AG/2024/Sources/Headers/AGGraphCounterQuery.h new file mode 100644 index 0000000..6fd06d3 --- /dev/null +++ b/AG/2024/Sources/Headers/AGGraphCounterQuery.h @@ -0,0 +1,30 @@ +// +// AGCounterQueryType.h +// +// +// Created by Kyle on 2024/3/8. +// + +#ifndef AGGraphCounterQuery_h +#define AGGraphCounterQuery_h + +#include "AGBase.h" + +typedef AG_ENUM(uint32_t, AGGraphCounterQuery){ + AGGraphCounterQueryNodeCount, + AGGraphCounterQueryTransactionCount, + AGGraphCounterQueryUpdateCount, + AGGraphCounterQueryChangeCount, + AGGraphCounterQueryContextID, + AGGraphCounterQueryGraphID, + AGGraphCounterQueryContextThreadUpdating, + AGGraphCounterQueryThreadUpdating, + AGGraphCounterQueryContextNeedsUpdate, + AGGraphCounterQueryNeedsUpdate, + AGGraphCounterQueryMainThreadUpdateCount, + AGGraphCounterQueryNodeTotalCount, + AGGraphCounterQuerySubgraphCount, + AGGraphCounterQuerySubgraphTotalCount, +}; + +#endif /* AGGraphCounterQuery_h */ diff --git a/AG/2024/Sources/Headers/AGSubgraph.h b/AG/2024/Sources/Headers/AGSubgraph.h index 8cf9f2c..461a8b2 100644 --- a/AG/2024/Sources/Headers/AGSubgraph.h +++ b/AG/2024/Sources/Headers/AGSubgraph.h @@ -43,7 +43,7 @@ void AGSubgraphSetCurrent(_Nullable AGSubgraphRef cf_subgraph) AG_SWIFT_NAME(set AG_EXPORT AG_REFINED_FOR_SWIFT -_Nullable AGGraphContextRef AGSubgraphGetCurrentGraphContext(void) AG_SWIFT_NAME(getter:AGSubgraphRef.currentGraphContext()); +_Nullable AGUnownedGraphRef AGSubgraphGetCurrentGraphContext(void) AG_SWIFT_NAME(getter:AGSubgraphRef.currentGraphContext()); AG_EXPORT AG_REFINED_FOR_SWIFT diff --git a/AG/2024/Sources/Headers/AGTypeID.h b/AG/2024/Sources/Headers/AGTypeID.h index 002b5f4..585248c 100644 --- a/AG/2024/Sources/Headers/AGTypeID.h +++ b/AG/2024/Sources/Headers/AGTypeID.h @@ -10,10 +10,7 @@ AG_ASSUME_NONNULL_BEGIN -typedef struct AG_SWIFT_NAME(_Metadata) AGSwiftMetadata { -} AGSwiftMetadata; - -typedef const AGSwiftMetadata *AGTypeID AG_SWIFT_STRUCT AG_SWIFT_NAME(Metadata); +typedef const struct AGSwiftMetadata *AGTypeID AG_SWIFT_STRUCT AG_SWIFT_NAME(Metadata); #if ATTRIBUTEGRAPH_RELEASE >= ATTRIBUTEGRAPH_RELEASE_2024 @@ -35,11 +32,11 @@ typedef AG_CLOSED_ENUM(uint32_t, AGTypeKind) { AGTypeKindMetatype, } AG_SWIFT_NAME(Metadata.Kind); -typedef AG_OPTIONS(uint32_t, AGTypeApplyOptions) { - AGTypeApplyOptions_0 = 0, - AGTypeApplyOptions_1 = 1 << 0, - AGTypeApplyOptions_2 = 1 << 1, - AGTypeApplyOptions_4 = 1 << 2, +typedef AG_OPTIONS(uint32_t, AGTypeApplyOptions){ + AGTypeApplyOptionsEnumerateStructFields = 0, + AGTypeApplyOptionsEnumerateClassFields = 1 << 0, + AGTypeApplyOptionsContinueAfterUnknownField = 1 << 1, + AGTypeApplyOptionsEnumerateEnumCases = 1 << 2, }; AG_EXTERN_C_BEGIN diff --git a/AG/2024/Sources/Headers/AttributeGraph-umbrella.h b/AG/2024/Sources/Headers/AttributeGraph-umbrella.h index 5341208..eea48a1 100644 --- a/AG/2024/Sources/Headers/AttributeGraph-umbrella.h +++ b/AG/2024/Sources/Headers/AttributeGraph-umbrella.h @@ -8,10 +8,10 @@ #include "AGChangedValueFlags.h" #include "AGCompareValues.h" #include "AGComparisonMode.h" -#include "AGCounterQueryType.h" #include "AGDebugServer.h" #include "AGGraph.h" #include "AGGraphContext.h" +#include "AGGraphCounterQuery.h" #include "AGGraphDescription.h" #include "AGInputOptions.h" #include "AGSearchOptions.h" diff --git a/AG/2024/Sources/Modules/AttributeGraph.swiftmodule/template.swiftinterface b/AG/2024/Sources/Modules/AttributeGraph.swiftmodule/template.swiftinterface index 6874495..a277de1 100644 --- a/AG/2024/Sources/Modules/AttributeGraph.swiftmodule/template.swiftinterface +++ b/AG/2024/Sources/Modules/AttributeGraph.swiftmodule/template.swiftinterface @@ -9,27 +9,27 @@ import _StringProcessing // MARK: - AnyAttribute extension AttributeGraph.AnyAttribute { - public init(_ attribute: AttributeGraph.Attribute) - public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute - public static var current: AnyAttribute? { get } - public func unsafeOffset(at offset: Int) -> AnyAttribute - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - public func visitBody(_ visitor: inout Visitor); - public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> ()) - public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var _bodyType: Any.Type { get } - public var _bodyPointer: UnsafeRawPointer { get } - public var valueType: Any.Type { get } - public var indirectDependency: AnyAttribute? { - get - nonmutating set - } + public init(_ attribute: AttributeGraph.Attribute) + public func unsafeCast(to type: Value.Type) -> AttributeGraph.Attribute + public static var current: AnyAttribute? { get } + public func unsafeOffset(at offset: Int) -> AnyAttribute + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + public func visitBody(_ visitor: inout Visitor) + public func mutateBody(as: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + public var _bodyType: Any.Type { get } + public var _bodyPointer: UnsafeRawPointer { get } + public var valueType: Any.Type { get } + public var indirectDependency: AnyAttribute? { + get + nonmutating set + } } extension AttributeGraph.AnyAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } public typealias AttributeUpdateBlock = () -> ((Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void) @@ -44,66 +44,74 @@ public struct Attribute { public init(identifier: AnyAttribute) public init(_ attribute: AttributeGraph.Attribute) - public init(value: Value) - public init(type: Value.Type) - public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: AGAttributeTypeFlags, update: AttributeUpdateBlock) - public var wrappedValue: Value { - unsafeAddress - nonmutating set - } - public var projectedValue: AttributeGraph.Attribute { get set } - + public init(value: Value) + public init(type: Value.Type) + public init( + body: Swift.UnsafePointer, + value: Swift.UnsafePointer?, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) + public var wrappedValue: Value { + unsafeAddress + nonmutating set + } + public var projectedValue: AttributeGraph.Attribute { get set } + public subscript(dynamicMember _: Swift.KeyPath) -> AttributeGraph.Attribute { get } public subscript(keyPath _: Swift.KeyPath) -> AttributeGraph.Attribute { get } - public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) -> AttributeGraph.Attribute { get } - - public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute - public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute - public func applying(offset: AttributeGraph.PointerOffset) -> AttributeGraph.Attribute - public func visitBody(_ visitor: inout Body) - public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) - public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - - public var graph: AGGraph { get } - public var subgraph: AGSubgraph { get } - - public var value: Value { - unsafeAddress - nonmutating set - } - public var valueState: AGValueState { get } - public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public func setValue(_ value: Value) -> Bool - public var hasValue: Bool { get } - public func updateValue() - public func prefetchValue() - public func invalidateValue() - public func validate() - - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) - - public var flags: AGAttributeFlags { - get - nonmutating set - } - public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) + public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + { get } + + public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute + public func unsafeOffset(at offset: Swift.Int, as type: Member.Type) -> AttributeGraph.Attribute + public func applying(offset: AttributeGraph.PointerOffset) + -> AttributeGraph.Attribute + public func visitBody(_ visitor: inout Body) + public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) + public func breadthFirstSearch(options: AGSearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + + public var graph: AGGraph { get } + public var subgraph: AGSubgraph { get } + + public var value: Value { + unsafeAddress + nonmutating set + } + public var valueState: AGValueState { get } + public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public func setValue(_ value: Value) -> Bool + public var hasValue: Bool { get } + public func updateValue() + public func prefetchValue() + public func invalidateValue() + public func validate() + + public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Int) + + public var flags: AGAttributeFlags { + get + nonmutating set + } + public func setFlags(_ newFlags: AGAttributeFlags, mask: AGAttributeFlags) } extension AttributeGraph.Attribute: Swift.Hashable { public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool + public static func == (lhs: AttributeGraph.Attribute, rhs: AttributeGraph.Attribute) -> Swift.Bool public var hashValue: Swift.Int { get } } extension AttributeGraph.Attribute: Swift.CustomStringConvertible { - public var description: String { get } + public var description: String { get } } extension AttributeGraph.Attribute { - public init(_ rule: R) where R.Value == Value - public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value + public init(_ rule: R) where R.Value == Value } // MARK: - AnyWeakAttribute @@ -111,140 +119,144 @@ extension AttributeGraph.Attribute { public typealias AnyWeakAttribute = AGWeakAttribute extension AttributeGraph.AnyWeakAttribute { - @_alwaysEmitIntoClient - public init(_ attribute: AnyAttribute?) { - self = __AGCreateWeakAttribute(attribute ?? .nil) - } - - @_alwaysEmitIntoClient - public init(_ weakAttribute: AttributeGraph.WeakAttribute) { - self = weakAttribute.base - } - - @_alwaysEmitIntoClient - public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { - WeakAttribute(base: self) - } - - @_alwaysEmitIntoClient - public var attribute: AnyAttribute? { - get { - let attribute = __AGWeakAttributeGetAttribute(self) - return attribute == .nil ? nil : attribute - } - set { - self = AnyWeakAttribute(newValue) - } - } + @_alwaysEmitIntoClient + public init(_ attribute: AnyAttribute?) { + self = __AGCreateWeakAttribute(attribute ?? .nil) + } + + @_alwaysEmitIntoClient + public init(_ weakAttribute: AttributeGraph.WeakAttribute) { + self = weakAttribute.base + } + + @_alwaysEmitIntoClient + public func unsafeCast(to type: Value.Type) -> AttributeGraph.WeakAttribute { + WeakAttribute(base: self) + } + + @_alwaysEmitIntoClient + public var attribute: AnyAttribute? { + get { + let attribute = __AGWeakAttributeGetAttribute(self) + return attribute == .nil ? nil : attribute + } + set { + self = AnyWeakAttribute(newValue) + } + } } extension AttributeGraph.AnyWeakAttribute: Hashable { - @_alwaysEmitIntoClient - public func hash(into hasher: inout Swift.Hasher) { - hasher.combine(raw_attribute) - hasher.combine(subgraph_id) - } + @_alwaysEmitIntoClient + public func hash(into hasher: inout Swift.Hasher) { + hasher.combine(raw_attribute) + hasher.combine(subgraph_id) + } - @_alwaysEmitIntoClient - public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { - lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id - } + @_alwaysEmitIntoClient + public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool { + lhs.raw_attribute == rhs.raw_attribute && lhs.subgraph_id == rhs.subgraph_id + } - @_alwaysEmitIntoClient - public var hashValue: Int { - _hashValue(for: self) - } + @_alwaysEmitIntoClient + public var hashValue: Int { + _hashValue(for: self) + } } extension AttributeGraph.AnyWeakAttribute: CustomStringConvertible { - @_alwaysEmitIntoClient - public var description: String { - attribute?.description ?? "nil" - } + @_alwaysEmitIntoClient + public var description: String { + attribute?.description ?? "nil" + } } - // MARK: - WeakAttribute @frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - @usableFromInline - internal var base: AnyWeakAttribute - @_alwaysEmitIntoClient - public init(base: AnyWeakAttribute) { self.base = base } - public init() - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public var wrappedValue: Value? { get } - public var projectedValue: AttributeGraph.Attribute?{ get set } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { get } - public var attribute: AttributeGraph.Attribute? { get set _modify } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? + @usableFromInline + internal var base: AnyWeakAttribute + @_alwaysEmitIntoClient + public init(base: AnyWeakAttribute) { self.base = base } + public init() + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public var wrappedValue: Value? { get } + public var projectedValue: AttributeGraph.Attribute? { get set } + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { + get + } + public var attribute: AttributeGraph.Attribute? { get set _modify } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? } extension AttributeGraph.WeakAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.WeakAttribute, rhs: AttributeGraph.WeakAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.WeakAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - OptionalAttribute @frozen public struct AnyOptionalAttribute { - public init() - public init(_ attribute: AnyAttribute) - public init(_ attribute: AnyAttribute?) - public init(_ attribute: AttributeGraph.OptionalAttribute) - public var identifier: AnyAttribute - public static var current: AttributeGraph.AnyOptionalAttribute { get } - public var attribute: AnyAttribute? { get set } - public func map(_ body: (AnyAttribute) -> Value) -> Value? - public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute + public init() + public init(_ attribute: AnyAttribute) + public init(_ attribute: AnyAttribute?) + public init(_ attribute: AttributeGraph.OptionalAttribute) + public var identifier: AnyAttribute + public static var current: AttributeGraph.AnyOptionalAttribute { get } + public var attribute: AnyAttribute? { get set } + public func map(_ body: (AnyAttribute) -> Value) -> Value? + public func unsafeCast(to type: Value.Type) -> AttributeGraph.OptionalAttribute } extension AttributeGraph.AnyOptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.AnyOptionalAttribute, rhs: AttributeGraph.AnyOptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.AnyOptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } @frozen @propertyWrapper @dynamicMemberLookup public struct OptionalAttribute { - public var base: AttributeGraph.AnyOptionalAttribute - public init() - public init(base: AttributeGraph.AnyOptionalAttribute) - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public var attribute: AttributeGraph.Attribute? { get set } - public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? - public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? - public var wrappedValue: Value? { get } - public var projectedValue: Attribute? { get set _modify } - public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } + public var base: AttributeGraph.AnyOptionalAttribute + public init() + public init(base: AttributeGraph.AnyOptionalAttribute) + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public init(_ weakAttribute: AttributeGraph.WeakAttribute) + public var attribute: AttributeGraph.Attribute? { get set } + public var value: Value? { get } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool)? + public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? + public var wrappedValue: Value? { get } + public var projectedValue: Attribute? { get set _modify } + public subscript(dynamicMember keyPath: KeyPath) -> Attribute? { get } } extension AttributeGraph.OptionalAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.OptionalAttribute, rhs: AttributeGraph.OptionalAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - IndirectAttribute @@ -253,36 +265,37 @@ extension AttributeGraph.OptionalAttribute: Swift.CustomStringConvertible { @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { - public let identifier: AnyAttribute - public init(source: AttributeGraph.Attribute) - public var source: AttributeGraph.Attribute { - get - nonmutating set - nonmutating _modify - } - public var dependency: AnyAttribute? { - get - nonmutating set - } - public var value: Value { - get - nonmutating set - nonmutating _modify - } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) - public var wrappedValue: Value { - get - nonmutating set - nonmutating _modify - } - public var projectedValue: AttributeGraph.Attribute { get } - public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } + public let identifier: AnyAttribute + public init(source: AttributeGraph.Attribute) + public var source: AttributeGraph.Attribute { + get + nonmutating set + nonmutating _modify + } + public var dependency: AnyAttribute? { + get + nonmutating set + } + public var value: Value { + get + nonmutating set + nonmutating _modify + } + public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Bool) + public var wrappedValue: Value { + get + nonmutating set + nonmutating _modify + } + public var projectedValue: AttributeGraph.Attribute { get } + public subscript(dynamicMember keyPath: KeyPath) -> AttributeGraph.Attribute { get } } extension AttributeGraph.IndirectAttribute: Swift.Hashable { - public func hash(into hasher: inout Swift.Hasher) - public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) -> Swift.Bool - public var hashValue: Swift.Int { get } + public func hash(into hasher: inout Swift.Hasher) + public static func == (lhs: AttributeGraph.IndirectAttribute, rhs: AttributeGraph.IndirectAttribute) + -> Swift.Bool + public var hashValue: Swift.Int { get } } // MARK: - _AttributeBody @@ -313,17 +326,17 @@ public protocol AttributeBodyVisitor { @frozen public struct External { - public init() + public init() } extension AttributeGraph.External: AttributeGraph._AttributeBody { - public static var comparisonMode: AGComparisonMode { get } - public static var flags: AGAttributeTypeFlags { get } - public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static var comparisonMode: AGComparisonMode { get } + public static var flags: AGAttributeTypeFlags { get } + public static func _update(_: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) } extension AttributeGraph.External: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - Focus @@ -332,28 +345,28 @@ extension AttributeGraph.External: Swift.CustomStringConvertible { public struct Focus { public var root: Attribute public var keyPath: KeyPath - + public init(root: Attribute, keyPath: KeyPath) } extension AttributeGraph.Focus: AttributeGraph.Rule { - public var value: Self.Value { get } - public static var flags: AGAttributeTypeFlags { get } + public var value: Self.Value { get } + public static var flags: AGAttributeTypeFlags { get } } extension AttributeGraph.Focus: Swift.CustomStringConvertible { - public var description: Swift.String { get } + public var description: Swift.String { get } } // MARK: - ObservedAttribute public protocol ObservedAttribute: AttributeGraph._AttributeBody { - func destroy() + func destroy() } extension AttributeGraph.ObservedAttribute { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { get } + public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) + public static var _hasDestroySelf: Swift.Bool { get } } // MARK: - Graph Related @@ -361,65 +374,69 @@ extension AttributeGraph.ObservedAttribute { // MARK: - AGGraph extension AttributeGraph.AGGraph { - public static func typeIndex( - ctx: AGGraphContext, - body: AttributeGraph._AttributeBody.Type, - valueType: Metadata, - flags: AGAttributeTypeFlags, - update: AttributeUpdateBlock - ) -> Int + public static func typeIndex( + ctx: AGUnownedGraphRef, + body: AttributeGraph._AttributeBody.Type, + valueType: Metadata, + flags: AGAttributeTypeFlags, + update: AttributeUpdateBlock + ) -> Int } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphStartProfiling") - public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStartProfiling") + public static func startProfiling(_ graph: AttributeGraph.AGGraph? = nil) - @_silgen_name("AGGraphStopProfiling") - public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) + @_silgen_name("AGGraphStopProfiling") + public static func stopProfiling(_ graph: AttributeGraph.AGGraph? = nil) } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphSetInvalidationCallback") - public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) + @_silgen_name("AGGraphSetInvalidationCallback") + public static func setInvalidationCallback(_ graph: AttributeGraph.AGGraph, callback: ((AnyAttribute) -> Void)?) - @_silgen_name("AGGraphSetUpdateCallback") - public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) + @_silgen_name("AGGraphSetUpdateCallback") + public static func setUpdateCallback(_ graph: AttributeGraph.AGGraph, callback: (() -> Void)?) } extension AttributeGraph.AGGraph { - @_transparent - @inline(__always) - public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: ._10)) } + @_transparent + @inline(__always) + public var mainUpdates: Swift.Int { Swift.numericCast(counter(for: .mainThreadUpdateCount)) } } extension AttributeGraph.AGGraph { - public static func withoutUpdate(_ body: () -> Value) -> Value + public static func withoutUpdate(_ body: () -> Value) -> Value } extension AttributeGraph.AGGraph { - @_silgen_name("AGGraphGetOutputValue") - @inline(__always) - @inlinable - public static func outputValue() -> Swift.UnsafePointer? + @_silgen_name("AGGraphGetOutputValue") + @inline(__always) + @inlinable + public static func outputValue() -> Swift.UnsafePointer? - @_silgen_name("AGGraphSetOutputValue") - @inline(__always) - @inlinable - public static func setOutputValue(_ value: Swift.UnsafePointer) + @_silgen_name("AGGraphSetOutputValue") + @inline(__always) + @inlinable + public static func setOutputValue(_ value: Swift.UnsafePointer) } // MARK: - AGSubgraph extension AttributeGraph.AGSubgraph { - public func addObserver(_ observer: () -> Void) -> Swift.Int - public func apply(_ body: () -> Value) -> Value - public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) + public func addObserver(_ observer: () -> Void) -> Swift.Int + public func apply(_ body: () -> Value) -> Value + public func forEach(_ flags: AGAttributeFlags, _ callback: (AnyAttribute) -> Void) } extension AttributeGraph.AGSubgraph { - public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) - public static func endTreeElement(value: AttributeGraph.Attribute) - public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) + public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) + public static func endTreeElement(value: AttributeGraph.Attribute) + public static func addTreeValue( + _ value: AttributeGraph.Attribute, + forKey key: Swift.UnsafePointer, + flags: Swift.UInt32 + ) } // MARK: - Rule Related @@ -434,97 +451,114 @@ public protocol Rule: AttributeGraph._AttributeBody { extension AttributeGraph.Rule { public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.Rule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } } extension AttributeGraph.Rule where Self: Swift.Hashable { - public func cachedValueIfExists( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value? + public func cachedValueIfExists( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value? - public func cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute? - ) -> Value + public func cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute? + ) -> Value - public static func _cachedValue( - options: AGCachedValueOptions = [], - owner: AnyAttribute?, - hashValue: Swift.Int, - bodyPtr: Swift.UnsafeRawPointer, - update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> () - ) -> Swift.UnsafePointer + public static func _cachedValue( + options: AGCachedValueOptions = [], + owner: AnyAttribute?, + hashValue: Swift.Int, + bodyPtr: Swift.UnsafeRawPointer, + update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Void + ) -> Swift.UnsafePointer } // MARK: - StateRule public protocol StatefulRule: AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Value? { get } - mutating func updateValue() + associatedtype Value + static var initialValue: Value? { get } + mutating func updateValue() } extension AttributeGraph.StatefulRule { - public static var initialValue: Self.Value? { get } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) + public static var initialValue: Self.Value? { get } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute: AnyAttribute) + public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) } extension AttributeGraph.StatefulRule { - public var attribute: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool { get } + public var attribute: AttributeGraph.Attribute { get } + public var context: AttributeGraph.RuleContext { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool { get } } // MARK: - RuleContext @frozen public struct RuleContext { - public var attribute: AttributeGraph.Attribute - public init(attribute: AttributeGraph.Attribute) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public var value: Value { unsafeAddress nonmutating set } - public var hasValue: Bool - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) + public var attribute: AttributeGraph.Attribute + public init(attribute: AttributeGraph.Attribute) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public var value: Value { unsafeAddress nonmutating set } + public var hasValue: Bool + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) } // MARK: - AnyRuleContext @frozen public struct AnyRuleContext { - public var attribute: AnyAttribute - public init(attribute: AnyAttribute) - public init(_ context: AttributeGraph.RuleContext) - public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Void) - public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext + public var attribute: AnyAttribute + public init(attribute: AnyAttribute) + public init(_ context: AttributeGraph.RuleContext) + public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress } + public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { get } + public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, flags: AGChangedValueFlags + ) + public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> ( + value: V, changed: Swift.Bool + ) + public func update(body: () -> Void) + public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext } // MARK: - Runtime Related // MARK: - CompareValues -public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = ._3) -> Swift.Bool +extension AGComparisonOptions { + public init(mode: AGComparisonMode) +} + +public func compareValues(_ lhs: A, _ rhs: A, mode: AGComparisonMode = .equatableAlways) -> Swift.Bool public func compareValues(_ lhs: A, _ rhs: A, options: AGComparisonOptions) -> Swift.Bool // MARK: - Metadata +public func forEachField( + of type: Any.Type, + do body: (UnsafePointer, Int, Any.Type) -> Void +) + extension Metadata: Swift.CustomStringConvertible { public init(_ type: Any.Type) public var type: Any.Type { get } @@ -535,83 +569,97 @@ extension Metadata: Swift.CustomStringConvertible { ) -> Bool } +// MARK: - Signature + +extension TypeSignature: Swift.Equatable {} + // MARK: - TupleType extension TupleType { - @_transparent + @_transparent public init(_ types: [Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) } - - @_transparent + + @_transparent public init(_ type: Any.Type) { - self.init(rawValue: unsafeBitCast(type, to: UnsafePointer<_Metadata>.self)) + self.init(rawValue: unsafeBitCast(type, to: OpaquePointer.self)) } - - @_transparent + + @_transparent public var isEmpty: Bool { count == 0 } - @_transparent - public var indices: Range { 0 ..< count } - - @_transparent + @_transparent + public var indices: Range { 0.. Any.Type { elementType(at: index).type } - - @_transparent + + @_transparent public func offset(at index: Int, as type: T.Type) -> Int { elementOffset(at: index, type: Metadata(type)) } - - @_transparent - public func setElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, from srcValue: UnsafePointer, options: CopyOptions) { + + @_transparent + public func setElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + from srcValue: UnsafePointer, + options: CopyOptions + ) { __AGTupleSetElement(self, tupleValue, index, srcValue, Metadata(T.self), options) } - - @_transparent - public func getElement(in tupleValue: UnsafeMutableRawPointer, at index: Int, to dstValue: UnsafeMutablePointer, options: CopyOptions) { + + @_transparent + public func getElement( + in tupleValue: UnsafeMutableRawPointer, + at index: Int, + to dstValue: UnsafeMutablePointer, + options: CopyOptions + ) { __AGTupleGetElement(self, tupleValue, index, dstValue, Metadata(T.self), options) } } @_silgen_name("AGTupleWithBuffer") -public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> ()) +public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> Void) // MARK: - UnsafeTuple extension UnsafeTuple { - @_transparent + @_transparent public var count: Int { type.count } - - @_transparent - public var isEmpty: Bool { type.isEmpty } - - @_transparent - public var indices: Range { type.indices } - - @_transparent + + @_transparent + public var isEmpty: Bool { type.isEmpty } + + @_transparent + public var indices: Range { type.indices } + + @_transparent public func address(as _: T.Type = T.self) -> UnsafePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { address(of: index, as: T.self) } } @@ -626,61 +674,61 @@ extension UnsafeTuple { /*private*/ public func slowDealloc(_ ptr: UnsafeMutableRawPointer, _ size: Int, _ alignMask: Int) extension UnsafeMutableTuple { - @_transparent + @_transparent public init(with tupleType: TupleType) { self.init(type: tupleType, value: slowAlloc(tupleType.size, -1)) } - @_transparent + @_transparent public func initialize(at index: Int, to element: T) { withUnsafePointer(to: element) { elementPointer in type.setElement(in: value, at: index, from: elementPointer, options: .initCopy) } } - @_transparent + @_transparent public func deinitialize() { type.destroy(value) } - @_transparent + @_transparent public func deinitialize(at index: Int) { type.destroy(value, at: index) } - @_transparent + @_transparent public func deallocate(initialized: Bool) { if initialized { deinitialize() } slowDealloc(value, -1, -1) - } - @_transparent + } + @_transparent public var count: Int { type.count } - @_transparent + @_transparent public var isEmpty: Bool { type.isEmpty } - @_transparent + @_transparent public var indices: Range { type.indices } - - @_transparent + + @_transparent public func address(as _: T.Type = T.self) -> UnsafeMutablePointer { guard type.type == T.self else { preconditionFailure() } return value.assumingMemoryBound(to: T.self) } - - @_transparent + + @_transparent public func address(of index: Int, as _: T.Type = T.self) -> UnsafeMutablePointer { value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) .assumingMemoryBound(to: T.self) } - + public subscript() -> T { @_transparent unsafeAddress { UnsafePointer(address(as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(as: T.self) } } - + public subscript(_ index: Int) -> T { @_transparent unsafeAddress { UnsafePointer(address(of: index, as: T.self)) } @_transparent nonmutating unsafeMutableAddress { address(of: index, as: T.self) } @@ -720,30 +768,41 @@ public func AGTypeApplyFields2( @frozen public struct PointerOffset { - public var byteOffset: Swift.Int - public init(byteOffset: Swift.Int) + public var byteOffset: Swift.Int + public init(byteOffset: Swift.Int) } extension AttributeGraph.PointerOffset { - public static func + (_ lhs: AttributeGraph.PointerOffset, _ rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset + public static func + ( + _ lhs: AttributeGraph.PointerOffset, + _ rhs: AttributeGraph.PointerOffset + ) -> AttributeGraph.PointerOffset } extension AttributeGraph.PointerOffset { - public static func invalidScenePointer() -> Swift.UnsafeMutablePointer - public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset - public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset + public static func invalidScenePointer() -> Swift.UnsafeMutablePointer + public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset + public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> PointerOffset< + Base, Member + > } extension AttributeGraph.PointerOffset where Base == Member { - public init() + public init() } extension Swift.UnsafePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - } - public static func + (_ lhs: Swift.UnsafePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + } + public static func + ( + _ lhs: Swift.UnsafePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafePointer } extension Swift.UnsafeMutablePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - nonmutating unsafeMutableAddress - } - public static func + (_ lhs: Swift.UnsafeMutablePointer, _ rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + nonmutating unsafeMutableAddress + } + public static func + ( + _ lhs: Swift.UnsafeMutablePointer, + _ rhs: AttributeGraph.PointerOffset + ) -> Swift.UnsafeMutablePointer } diff --git a/AG/update.sh b/AG/update.sh index 611d16b..7e11b02 100755 --- a/AG/update.sh +++ b/AG/update.sh @@ -16,8 +16,8 @@ generate_swiftinterface_header() { local target="$1" local result="" result+="// swift-interface-format-version: 1.0\n" - result+="// swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)\n" - result+="// swift-module-flags: -target $target -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name AttributeGraph\n" + result+="// swift-compiler-version: Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3)\n" + result+="// swift-module-flags: -target $target -enable-objc-interop -enable-library-evolution -swift-version 6 -enforce-exclusivity=checked -O -module-name AttributeGraph\n" result+="// swift-module-flags-ignorable: -enable-bare-slash-regex" echo -e $result