Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions AG/Sources/Headers/AGAttribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Sources/OpenGraph/Attribute/Attribute/OGAttribute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 4 additions & 6 deletions Sources/OpenGraph/Attribute/Indirect/IndirectAttribute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ public struct IndirectAttribute<Value> {
}

public var source: Attribute<Value> {
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
Expand All @@ -29,10 +27,10 @@ public struct IndirectAttribute<Value> {

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
Expand Down
8 changes: 4 additions & 4 deletions Sources/_OpenGraph/Attribute/OGAttribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down