Skip to content

Commit 4af225e

Browse files
committed
Update Metadata
1 parent dbf3f87 commit 4af225e

File tree

19 files changed

+65
-81
lines changed

19 files changed

+65
-81
lines changed

Package.resolved

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/OpenGraph/Attribute/Attribute/AnyAttribute.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ extension AnyAttribute {
4646
}
4747

4848
public func mutateBody<Value>(as type: Value.Type, invalidating: Bool, _ body: (inout Value) -> Void) {
49-
AnyAttribute.mutateAttribute(self, type: OGTypeID(type), invalidating: invalidating) { value in
49+
AnyAttribute.mutateAttribute(self, type: Metadata(type), invalidating: invalidating) { value in
5050
body(&value.assumingMemoryBound(to: Value.self).pointee)
5151
}
5252
}
@@ -92,7 +92,7 @@ extension AnyAttribute {
9292
@_silgen_name("OGGraphMutateAttribute")
9393
private static func mutateAttribute(
9494
_ attribute: AnyAttribute,
95-
type: OGTypeID,
95+
type: Metadata,
9696
invalidating: Bool,
9797
body: (UnsafeMutableRawPointer) -> Void
9898
)

Sources/OpenGraph/Attribute/Attribute/Attribute.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public struct Attribute<Value> {
5151
let index = OGGraph.typeIndex(
5252
ctx: context,
5353
body: Body.self,
54-
valueType: OGTypeID(Value.self),
54+
valueType: Metadata(Value.self),
5555
flags: flags,
5656
update: update
5757
)
@@ -180,7 +180,7 @@ public struct Attribute<Value> {
180180
public func updateValue() { identifier.updateValue() }
181181
public func prefetchValue() { identifier.prefetchValue() }
182182
public func invalidateValue() { identifier.invalidateValue() }
183-
public func validate() { identifier.verify(type: OGTypeID(Value.self)) }
183+
public func validate() { identifier.verify(type: Metadata(Value.self)) }
184184

185185
// MARK: - Input
186186

Sources/OpenGraph/Attribute/Attribute/External.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ extension External: _AttributeBody {
2121
// MARK: CustomStringConvertible
2222

2323
extension External: CustomStringConvertible {
24-
public var description: String { OGTypeID(Value.self).description }
24+
public var description: String { Metadata(Value.self).description }
2525
}

Sources/OpenGraph/Attribute/Attribute/Focus.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ extension Focus: Rule {
2525
// MARK: CustomStringConvertible
2626

2727
extension Focus: CustomStringConvertible {
28-
public var description: String { "\(OGTypeID(Value.self).description)" }
28+
public var description: String { "\(Metadata(Value.self).description)" }
2929
}

Sources/OpenGraph/Attribute/Rule/Rule.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ extension Rule where Self: Hashable {
7373
owner: AnyAttribute?
7474
) -> Value? {
7575
withUnsafePointer(to: self) { bodyPointer in
76-
let value = __OGGraphReadCachedAttributeIfExists(hashValue, OGTypeID(Self.self), bodyPointer, OGTypeID(Value.self), options, owner ?? .nil, false)
76+
let value = __OGGraphReadCachedAttributeIfExists(hashValue, Metadata(Self.self), bodyPointer, Metadata(Value.self), options, owner ?? .nil, false)
7777
guard let value else { return nil }
7878
return value.assumingMemoryBound(to: Value.self).pointee
7979
}
@@ -87,7 +87,7 @@ extension Rule where Self: Hashable {
8787
update: AttributeUpdateBlock
8888
) -> UnsafePointer<Value> {
8989
// TODO: pass closure here
90-
__OGGraphReadCachedAttribute(hashValue, OGTypeID(Self.self), bodyPtr, OGTypeID(Value.self), options, owner ?? .nil, false)
90+
__OGGraphReadCachedAttribute(hashValue, Metadata(Self.self), bodyPtr, Metadata(Value.self), options, owner ?? .nil, false)
9191
.assumingMemoryBound(to: Value.self)
9292
}
9393
}

Sources/OpenGraph/Graph/OGGraph.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ extension OGGraph {
1111
public static func typeIndex(
1212
ctx: OGGraphContext,
1313
body: _AttributeBody.Type,
14-
valueType: OGTypeID,
14+
valueType: Metadata,
1515
flags: OGAttributeTypeFlags,
1616
update: AttributeUpdateBlock
1717
) -> Int {

Sources/OpenGraph/Graph/OGSubgraph.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ extension OGSubgraph {
3535
extension OGSubgraph {
3636
public static func beginTreeElement<Value>(value: Attribute<Value>, flags: UInt32) {
3737
if shouldRecordTree {
38-
__OGSubgraphBeginTreeElement(value.identifier, OGTypeID(Value.self), flags)
38+
__OGSubgraphBeginTreeElement(value.identifier, Metadata(Value.self), flags)
3939
}
4040
}
4141

4242
public static func addTreeValue<Value>(_ value: Attribute<Value>, forKey key: UnsafePointer<Int8>, flags: UInt32) {
4343
if shouldRecordTree {
44-
__OGSubgraphAddTreeValue(value.identifier, OGTypeID(Value.self), key, flags)
44+
__OGSubgraphAddTreeValue(value.identifier, Metadata(Value.self), key, flags)
4545
}
4646
}
4747

Sources/OpenGraph/Runtime/OGTypeID.swift renamed to Sources/OpenGraph/Runtime/Metadata.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// OGTypeID.swift
2+
// Metadata.swift
33
// OpenGraph
44
//
55
// Audited for RELEASE_2021
@@ -23,7 +23,7 @@ public func OGTypeApplyFields2(
2323
body: (UnsafePointer<Int8>, Int, Any.Type) -> Bool
2424
) -> Bool
2525

26-
extension OGTypeID: Swift.Hashable, Swift.CustomStringConvertible {
26+
extension Metadata: Swift.Hashable, Swift.CustomStringConvertible {
2727
@inlinable
2828
@inline(__always)
2929
public init(_ type: Any.Type) {

Sources/OpenGraph/Runtime/OGTupleType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public import OpenGraph_SPI
88

99
@_silgen_name("OGTupleElementType")
1010
@inline(__always)
11-
private func OGTupleElementType(_ tupleType: OGTupleType, index: Int) -> OGTypeID
11+
private func OGTupleElementType(_ tupleType: OGTupleType, index: Int) -> Metadata
1212

1313
// TODO
1414
extension OGTupleType {

0 commit comments

Comments
 (0)