From 7a1ce76e663bb5eab753cfaa8d2e2cafdf44a21a Mon Sep 17 00:00:00 2001 From: Kyle Date: Fri, 5 Apr 2024 19:10:44 +0800 Subject: [PATCH] Add OGAttribute.source API --- .../AttributeGraph.framework/Headers/AGAttribute.h | 8 ++++---- .../AttributeGraph.framework/Headers/AGAttribute.h | 8 ++++---- .../AttributeGraph.framework/Headers/AGAttribute.h | 8 ++++---- AG/Sources/Headers/AGAttribute.h | 8 ++++---- .../OpenGraph/Attribute/Attribute/OGAttribute.swift | 6 +++--- .../Attribute/Indirect/IndirectAttribute.swift | 10 ++++------ Sources/_OpenGraph/Attribute/OGAttribute.h | 8 ++++---- 7 files changed, 27 insertions(+), 29 deletions(-) diff --git a/AG/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGAttribute.h b/AG/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGAttribute.h index dd014270..1645245f 100644 --- a/AG/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGAttribute.h +++ b/AG/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGAttribute.h @@ -72,19 +72,19 @@ void AGGraphMutateAttribute(AGAttribute attribute, AG_EXPORT AG_REFINED_FOR_SWIFT -AGAttribute AGGraphGetIndirectDependency(AGAttribute attribute); +AGAttribute AGGraphGetIndirectDependency(AGAttribute attribute) AG_SWIFT_NAME(getter:AGAttribute._indirectDependency(self:)); AG_EXPORT AG_REFINED_FOR_SWIFT -void AGGraphSetIndirectDependency(AGAttribute attribute1, AGAttribute attribute2); +void AGGraphSetIndirectDependency(AGAttribute attribute1, AGAttribute attribute2) AG_SWIFT_NAME(setter:AGAttribute._indirectDependency(self:_:)); AG_EXPORT AG_REFINED_FOR_SWIFT -AGAttribute AGGraphGetIndirectAttribute(AGAttribute attribute); +AGAttribute AGGraphGetIndirectAttribute(AGAttribute attribute) AG_SWIFT_NAME(getter:AGAttribute.source(self:)); AG_EXPORT AG_REFINED_FOR_SWIFT -void AGGraphSetIndirectAttribute(AGAttribute attribute1, AGAttribute attribute2); +void AGGraphSetIndirectAttribute(AGAttribute attribute1, AGAttribute attribute2) AG_SWIFT_NAME(setter:AGAttribute.source(self:_:)); AG_EXPORT AG_REFINED_FOR_SWIFT diff --git a/AG/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGAttribute.h b/AG/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGAttribute.h index dd014270..1645245f 100644 --- a/AG/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGAttribute.h +++ b/AG/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGAttribute.h @@ -72,19 +72,19 @@ void AGGraphMutateAttribute(AGAttribute attribute, AG_EXPORT AG_REFINED_FOR_SWIFT -AGAttribute AGGraphGetIndirectDependency(AGAttribute attribute); +AGAttribute AGGraphGetIndirectDependency(AGAttribute attribute) AG_SWIFT_NAME(getter:AGAttribute._indirectDependency(self:)); AG_EXPORT AG_REFINED_FOR_SWIFT -void AGGraphSetIndirectDependency(AGAttribute attribute1, AGAttribute attribute2); +void AGGraphSetIndirectDependency(AGAttribute attribute1, AGAttribute attribute2) AG_SWIFT_NAME(setter:AGAttribute._indirectDependency(self:_:)); AG_EXPORT AG_REFINED_FOR_SWIFT -AGAttribute AGGraphGetIndirectAttribute(AGAttribute attribute); +AGAttribute AGGraphGetIndirectAttribute(AGAttribute attribute) AG_SWIFT_NAME(getter:AGAttribute.source(self:)); AG_EXPORT AG_REFINED_FOR_SWIFT -void AGGraphSetIndirectAttribute(AGAttribute attribute1, AGAttribute attribute2); +void AGGraphSetIndirectAttribute(AGAttribute attribute1, AGAttribute attribute2) AG_SWIFT_NAME(setter:AGAttribute.source(self:_:)); AG_EXPORT AG_REFINED_FOR_SWIFT diff --git a/AG/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGAttribute.h b/AG/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGAttribute.h index dd014270..1645245f 100644 --- a/AG/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGAttribute.h +++ b/AG/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGAttribute.h @@ -72,19 +72,19 @@ void AGGraphMutateAttribute(AGAttribute attribute, AG_EXPORT AG_REFINED_FOR_SWIFT -AGAttribute AGGraphGetIndirectDependency(AGAttribute attribute); +AGAttribute AGGraphGetIndirectDependency(AGAttribute attribute) AG_SWIFT_NAME(getter:AGAttribute._indirectDependency(self:)); AG_EXPORT AG_REFINED_FOR_SWIFT -void AGGraphSetIndirectDependency(AGAttribute attribute1, AGAttribute attribute2); +void AGGraphSetIndirectDependency(AGAttribute attribute1, AGAttribute attribute2) AG_SWIFT_NAME(setter:AGAttribute._indirectDependency(self:_:)); AG_EXPORT AG_REFINED_FOR_SWIFT -AGAttribute AGGraphGetIndirectAttribute(AGAttribute attribute); +AGAttribute AGGraphGetIndirectAttribute(AGAttribute attribute) AG_SWIFT_NAME(getter:AGAttribute.source(self:)); AG_EXPORT AG_REFINED_FOR_SWIFT -void AGGraphSetIndirectAttribute(AGAttribute attribute1, AGAttribute attribute2); +void AGGraphSetIndirectAttribute(AGAttribute attribute1, AGAttribute attribute2) AG_SWIFT_NAME(setter:AGAttribute.source(self:_:)); AG_EXPORT AG_REFINED_FOR_SWIFT diff --git a/AG/Sources/Headers/AGAttribute.h b/AG/Sources/Headers/AGAttribute.h index dd014270..1645245f 100644 --- a/AG/Sources/Headers/AGAttribute.h +++ b/AG/Sources/Headers/AGAttribute.h @@ -72,19 +72,19 @@ void AGGraphMutateAttribute(AGAttribute attribute, AG_EXPORT AG_REFINED_FOR_SWIFT -AGAttribute AGGraphGetIndirectDependency(AGAttribute attribute); +AGAttribute AGGraphGetIndirectDependency(AGAttribute attribute) AG_SWIFT_NAME(getter:AGAttribute._indirectDependency(self:)); AG_EXPORT AG_REFINED_FOR_SWIFT -void AGGraphSetIndirectDependency(AGAttribute attribute1, AGAttribute attribute2); +void AGGraphSetIndirectDependency(AGAttribute attribute1, AGAttribute attribute2) AG_SWIFT_NAME(setter:AGAttribute._indirectDependency(self:_:)); AG_EXPORT AG_REFINED_FOR_SWIFT -AGAttribute AGGraphGetIndirectAttribute(AGAttribute attribute); +AGAttribute AGGraphGetIndirectAttribute(AGAttribute attribute) AG_SWIFT_NAME(getter:AGAttribute.source(self:)); AG_EXPORT AG_REFINED_FOR_SWIFT -void AGGraphSetIndirectAttribute(AGAttribute attribute1, AGAttribute attribute2); +void AGGraphSetIndirectAttribute(AGAttribute attribute1, AGAttribute attribute2) AG_SWIFT_NAME(setter:AGAttribute.source(self:_:)); AG_EXPORT AG_REFINED_FOR_SWIFT diff --git a/Sources/OpenGraph/Attribute/Attribute/OGAttribute.swift b/Sources/OpenGraph/Attribute/Attribute/OGAttribute.swift index bc561afa..62d4929e 100644 --- a/Sources/OpenGraph/Attribute/Attribute/OGAttribute.swift +++ b/Sources/OpenGraph/Attribute/Attribute/OGAttribute.swift @@ -67,13 +67,13 @@ extension OGAttribute { public var indirectDependency: OGAttribute? { get { - let indirectDependency = __OGGraphGetIndirectDependency(self) + let indirectDependency = _indirectDependency return indirectDependency == .nil ? nil : indirectDependency } nonmutating set { - __OGGraphSetIndirectDependency(self, newValue ?? .nil) + _indirectDependency = newValue ?? .nil } - } + } } // MARK: CustomStringConvertible diff --git a/Sources/OpenGraph/Attribute/Indirect/IndirectAttribute.swift b/Sources/OpenGraph/Attribute/Indirect/IndirectAttribute.swift index 4b25a116..19af35a4 100644 --- a/Sources/OpenGraph/Attribute/Indirect/IndirectAttribute.swift +++ b/Sources/OpenGraph/Attribute/Indirect/IndirectAttribute.swift @@ -16,10 +16,8 @@ public struct IndirectAttribute { } public var source: Attribute { - get { - Attribute(identifier: __OGGraphGetIndirectAttribute(identifier)) - } - nonmutating set { __OGGraphSetIndirectAttribute(identifier, newValue.identifier) } + get { Attribute(identifier: identifier.source) } + nonmutating set { identifier.source = newValue.identifier } nonmutating _modify { var value = source yield &value @@ -29,10 +27,10 @@ public struct IndirectAttribute { public var dependency: OGAttribute? { get { - let dependency = __OGGraphGetIndirectDependency(identifier) + let dependency = identifier._indirectDependency return dependency == .nil ? nil : dependency } - nonmutating set {__OGGraphSetIndirectDependency(identifier, newValue ?? .nil) } + nonmutating set { identifier._indirectDependency = newValue ?? .nil } nonmutating _modify { var value = dependency yield &value diff --git a/Sources/_OpenGraph/Attribute/OGAttribute.h b/Sources/_OpenGraph/Attribute/OGAttribute.h index 8597f7f3..9af1b3b9 100644 --- a/Sources/_OpenGraph/Attribute/OGAttribute.h +++ b/Sources/_OpenGraph/Attribute/OGAttribute.h @@ -72,19 +72,19 @@ void OGGraphMutateAttribute(OGAttribute attribute, OG_EXPORT OG_REFINED_FOR_SWIFT -OGAttribute OGGraphGetIndirectDependency(OGAttribute attribute); +OGAttribute OGGraphGetIndirectDependency(OGAttribute attribute) OG_SWIFT_NAME(getter:OGAttribute._indirectDependency(self:)); OG_EXPORT OG_REFINED_FOR_SWIFT -void OGGraphSetIndirectDependency(OGAttribute attribute1, OGAttribute attribute2); +void OGGraphSetIndirectDependency(OGAttribute attribute1, OGAttribute attribute2) OG_SWIFT_NAME(setter:OGAttribute._indirectDependency(self:_:)); OG_EXPORT OG_REFINED_FOR_SWIFT -OGAttribute OGGraphGetIndirectAttribute(OGAttribute attribute); +OGAttribute OGGraphGetIndirectAttribute(OGAttribute attribute) OG_SWIFT_NAME(getter:OGAttribute.source(self:)); OG_EXPORT OG_REFINED_FOR_SWIFT -void OGGraphSetIndirectAttribute(OGAttribute attribute1, OGAttribute attribute2); +void OGGraphSetIndirectAttribute(OGAttribute attribute1, OGAttribute attribute2) OG_SWIFT_NAME(setter:OGAttribute.source(self:_:)); OG_EXPORT OG_REFINED_FOR_SWIFT