@@ -19,7 +19,7 @@ public struct Attribute<Value> {
1919 public init ( value: Value ) {
2020 self = withUnsafePointer ( to: value) { valuePointer in
2121 withUnsafePointer ( to: External < Value > ( ) ) { bodyPointer in
22- Attribute ( body: bodyPointer, value: valuePointer, flags: . _16 ) {
22+ Attribute ( body: bodyPointer, value: valuePointer, flags: . external ) {
2323 External< Value> . _update
2424 }
2525 }
@@ -28,7 +28,7 @@ public struct Attribute<Value> {
2828
2929 public init ( type _: Value . Type ) {
3030 self = withUnsafePointer ( to: External < Value > ( ) ) { bodyPointer in
31- Attribute ( body: bodyPointer, value: nil , flags: . _16 ) {
31+ Attribute ( body: bodyPointer, value: nil , flags: . external ) {
3232 External< Value> . _update
3333 }
3434 }
@@ -37,7 +37,7 @@ public struct Attribute<Value> {
3737 public init < Body: _AttributeBody > (
3838 body: UnsafePointer < Body > ,
3939 value: UnsafePointer < Value > ? ,
40- flags: OGAttributeTypeFlags = [ ] ,
40+ flags: _AttributeType . Flags = [ ] ,
4141 update: AttributeUpdateBlock
4242 ) {
4343 #if os(WASI)
@@ -120,7 +120,7 @@ public struct Attribute<Value> {
120120 identifier. mutateBody ( as: type, invalidating: invalidating, body)
121121 }
122122
123- public func breadthFirstSearch( options: OGSearchOptions = [ ] , _ body: ( AnyAttribute ) -> Bool ) -> Bool {
123+ public func breadthFirstSearch( options: SearchOptions = [ ] , _ body: ( AnyAttribute ) -> Bool ) -> Bool {
124124 identifier. breadthFirstSearch ( options: options, body)
125125 }
126126
@@ -152,21 +152,21 @@ public struct Attribute<Value> {
152152 nonmutating set { _ = setValue ( newValue) }
153153 }
154154
155- public var valueState : OGValueState { identifier. valueState }
155+ public var valueState : ValueState { identifier. valueState }
156156
157157 public func valueAndFlags( options: OGValueOptions = [ ] ) -> ( value: Value , flags: OGChangedValueFlags ) {
158158 let value = OGGraphGetValue ( identifier, options: options, type: Value . self)
159159 return (
160160 value. value. assumingMemoryBound ( to: Value . self) . pointee,
161- value. changed ? . _1 : [ ]
161+ value. flags
162162 )
163163 }
164164
165165 public func changedValue( options: OGValueOptions = [ ] ) -> ( value: Value , changed: Bool ) {
166166 let value = OGGraphGetValue ( identifier, options: options, type: Value . self)
167167 return (
168168 value. value. assumingMemoryBound ( to: Value . self) . pointee,
169- value. changed
169+ value. flags . contains ( . changed)
170170 )
171171 }
172172
@@ -194,12 +194,12 @@ public struct Attribute<Value> {
194194
195195 // MARK: - Flags
196196
197- public var flags : OGAttributeFlags {
197+ public var flags : Subgraph . Flags {
198198 get { identifier. flags }
199199 nonmutating set { identifier. flags = newValue }
200200 }
201201
202- public func setFlags( _ newFlags: OGAttributeFlags , mask: OGAttributeFlags ) {
202+ public func setFlags( _ newFlags: Subgraph . Flags , mask: Subgraph . Flags ) {
203203 identifier. setFlags ( newFlags, mask: mask)
204204 }
205205}
@@ -228,12 +228,6 @@ extension Attribute {
228228 }
229229}
230230
231- // TODO:
232- private struct AttributeType {
233- var graphType : OGAttributeType
234- var type : _AttributeBody . Type
235- }
236-
237231@_silgen_name ( " OGGraphCreateAttribute " )
238232@inline ( __always)
239233@inlinable
0 commit comments