Skip to content

Commit ec9c398

Browse files
authored
Add Subgraph tree record API (#62)
* Add OGSubgraphShouldRecordTree API * Add OGSubgraph tree element API * Add treeElementAPI check test case * Workaround duplicated XCTestScaffold issue * Fix CFRelease crash issue * Fix WASI build issue
1 parent b17046b commit ec9c398

File tree

25 files changed

+356
-44
lines changed

25 files changed

+356
-44
lines changed

AG/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGSubgraph.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,26 @@ AGUniqueID AGSubgraphAddObserver(AGSubgraphRef cf_subgraph,
8282
const void (*function)(const void * _Nullable context AG_SWIFT_CONTEXT) AG_SWIFT_CC(swift),
8383
const void * _Nullable context);
8484

85+
AG_EXPORT
86+
AG_REFINED_FOR_SWIFT
87+
bool AGSubgraphShouldRecordTree(void) AG_SWIFT_NAME(getter:AGSubgraphRef.shouldRecordTree());
88+
89+
AG_EXPORT
90+
AG_REFINED_FOR_SWIFT
91+
void AGSubgraphSetShouldRecordTree(void) AG_SWIFT_NAME(AGSubgraphRef.setShouldRecordTree());
92+
93+
AG_EXPORT
94+
AG_REFINED_FOR_SWIFT
95+
void AGSubgraphBeginTreeElement(AGAttribute attribute, AGTypeID type, uint32_t flags);
96+
97+
AG_EXPORT
98+
AG_REFINED_FOR_SWIFT
99+
void AGSubgraphAddTreeValue(AGAttribute attribute, AGTypeID type, const char * key, uint32_t flags);
100+
101+
AG_EXPORT
102+
AG_REFINED_FOR_SWIFT
103+
void AGSubgraphEndTreeElement(AGAttribute attribute);
104+
85105
AG_EXTERN_C_END
86106

87107
AG_ASSUME_NONNULL_END

AG/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios.swiftinterface

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,12 @@ extension AttributeGraph.AGSubgraph {
403403
public func forEach(_ flags: AGAttributeFlags, _ callback: (AGAttribute) -> Void)
404404
}
405405

406+
extension AttributeGraph.AGSubgraph {
407+
public static func beginTreeElement<Value>(value: AttributeGraph.Attribute<Value>, flags: Swift.UInt32)
408+
public static func endTreeElement<Value>(value: AttributeGraph.Attribute<Value>)
409+
public static func addTreeValue<Value>(_ value: AttributeGraph.Attribute<Value>, forKey key: Swift.UnsafePointer<Int8>, flags: Swift.UInt32)
410+
}
411+
406412
// MARK: - Rule Related
407413

408414
// MARK: - Rule

AG/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64e-apple-ios.swiftinterface

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,12 @@ extension AttributeGraph.AGSubgraph {
403403
public func forEach(_ flags: AGAttributeFlags, _ callback: (AGAttribute) -> Void)
404404
}
405405

406+
extension AttributeGraph.AGSubgraph {
407+
public static func beginTreeElement<Value>(value: AttributeGraph.Attribute<Value>, flags: Swift.UInt32)
408+
public static func endTreeElement<Value>(value: AttributeGraph.Attribute<Value>)
409+
public static func addTreeValue<Value>(_ value: AttributeGraph.Attribute<Value>, forKey key: Swift.UnsafePointer<Int8>, flags: Swift.UInt32)
410+
}
411+
406412
// MARK: - Rule Related
407413

408414
// MARK: - Rule

AG/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGSubgraph.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,26 @@ AGUniqueID AGSubgraphAddObserver(AGSubgraphRef cf_subgraph,
8282
const void (*function)(const void * _Nullable context AG_SWIFT_CONTEXT) AG_SWIFT_CC(swift),
8383
const void * _Nullable context);
8484

85+
AG_EXPORT
86+
AG_REFINED_FOR_SWIFT
87+
bool AGSubgraphShouldRecordTree(void) AG_SWIFT_NAME(getter:AGSubgraphRef.shouldRecordTree());
88+
89+
AG_EXPORT
90+
AG_REFINED_FOR_SWIFT
91+
void AGSubgraphSetShouldRecordTree(void) AG_SWIFT_NAME(AGSubgraphRef.setShouldRecordTree());
92+
93+
AG_EXPORT
94+
AG_REFINED_FOR_SWIFT
95+
void AGSubgraphBeginTreeElement(AGAttribute attribute, AGTypeID type, uint32_t flags);
96+
97+
AG_EXPORT
98+
AG_REFINED_FOR_SWIFT
99+
void AGSubgraphAddTreeValue(AGAttribute attribute, AGTypeID type, const char * key, uint32_t flags);
100+
101+
AG_EXPORT
102+
AG_REFINED_FOR_SWIFT
103+
void AGSubgraphEndTreeElement(AGAttribute attribute);
104+
85105
AG_EXTERN_C_END
86106

87107
AG_ASSUME_NONNULL_END

AG/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios-simulator.swiftinterface

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,12 @@ extension AttributeGraph.AGSubgraph {
403403
public func forEach(_ flags: AGAttributeFlags, _ callback: (AGAttribute) -> Void)
404404
}
405405

406+
extension AttributeGraph.AGSubgraph {
407+
public static func beginTreeElement<Value>(value: AttributeGraph.Attribute<Value>, flags: Swift.UInt32)
408+
public static func endTreeElement<Value>(value: AttributeGraph.Attribute<Value>)
409+
public static func addTreeValue<Value>(_ value: AttributeGraph.Attribute<Value>, forKey key: Swift.UnsafePointer<Int8>, flags: Swift.UInt32)
410+
}
411+
406412
// MARK: - Rule Related
407413

408414
// MARK: - Rule

AG/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-ios-simulator.swiftinterface

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,12 @@ extension AttributeGraph.AGSubgraph {
403403
public func forEach(_ flags: AGAttributeFlags, _ callback: (AGAttribute) -> Void)
404404
}
405405

406+
extension AttributeGraph.AGSubgraph {
407+
public static func beginTreeElement<Value>(value: AttributeGraph.Attribute<Value>, flags: Swift.UInt32)
408+
public static func endTreeElement<Value>(value: AttributeGraph.Attribute<Value>)
409+
public static func addTreeValue<Value>(_ value: AttributeGraph.Attribute<Value>, forKey key: Swift.UnsafePointer<Int8>, flags: Swift.UInt32)
410+
}
411+
406412
// MARK: - Rule Related
407413

408414
// MARK: - Rule

AG/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGSubgraph.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,26 @@ AGUniqueID AGSubgraphAddObserver(AGSubgraphRef cf_subgraph,
8282
const void (*function)(const void * _Nullable context AG_SWIFT_CONTEXT) AG_SWIFT_CC(swift),
8383
const void * _Nullable context);
8484

85+
AG_EXPORT
86+
AG_REFINED_FOR_SWIFT
87+
bool AGSubgraphShouldRecordTree(void) AG_SWIFT_NAME(getter:AGSubgraphRef.shouldRecordTree());
88+
89+
AG_EXPORT
90+
AG_REFINED_FOR_SWIFT
91+
void AGSubgraphSetShouldRecordTree(void) AG_SWIFT_NAME(AGSubgraphRef.setShouldRecordTree());
92+
93+
AG_EXPORT
94+
AG_REFINED_FOR_SWIFT
95+
void AGSubgraphBeginTreeElement(AGAttribute attribute, AGTypeID type, uint32_t flags);
96+
97+
AG_EXPORT
98+
AG_REFINED_FOR_SWIFT
99+
void AGSubgraphAddTreeValue(AGAttribute attribute, AGTypeID type, const char * key, uint32_t flags);
100+
101+
AG_EXPORT
102+
AG_REFINED_FOR_SWIFT
103+
void AGSubgraphEndTreeElement(AGAttribute attribute);
104+
85105
AG_EXTERN_C_END
86106

87107
AG_ASSUME_NONNULL_END

AG/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-macos.swiftinterface

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,12 @@ extension AttributeGraph.AGSubgraph {
403403
public func forEach(_ flags: AGAttributeFlags, _ callback: (AGAttribute) -> Void)
404404
}
405405

406+
extension AttributeGraph.AGSubgraph {
407+
public static func beginTreeElement<Value>(value: AttributeGraph.Attribute<Value>, flags: Swift.UInt32)
408+
public static func endTreeElement<Value>(value: AttributeGraph.Attribute<Value>)
409+
public static func addTreeValue<Value>(_ value: AttributeGraph.Attribute<Value>, forKey key: Swift.UnsafePointer<Int8>, flags: Swift.UInt32)
410+
}
411+
406412
// MARK: - Rule Related
407413

408414
// MARK: - Rule

AG/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64e-apple-macos.swiftinterface

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,12 @@ extension AttributeGraph.AGSubgraph {
403403
public func forEach(_ flags: AGAttributeFlags, _ callback: (AGAttribute) -> Void)
404404
}
405405

406+
extension AttributeGraph.AGSubgraph {
407+
public static func beginTreeElement<Value>(value: AttributeGraph.Attribute<Value>, flags: Swift.UInt32)
408+
public static func endTreeElement<Value>(value: AttributeGraph.Attribute<Value>)
409+
public static func addTreeValue<Value>(_ value: AttributeGraph.Attribute<Value>, forKey key: Swift.UnsafePointer<Int8>, flags: Swift.UInt32)
410+
}
411+
406412
// MARK: - Rule Related
407413

408414
// MARK: - Rule

AG/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-macos.swiftinterface

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,12 @@ extension AttributeGraph.AGSubgraph {
403403
public func forEach(_ flags: AGAttributeFlags, _ callback: (AGAttribute) -> Void)
404404
}
405405

406+
extension AttributeGraph.AGSubgraph {
407+
public static func beginTreeElement<Value>(value: AttributeGraph.Attribute<Value>, flags: Swift.UInt32)
408+
public static func endTreeElement<Value>(value: AttributeGraph.Attribute<Value>)
409+
public static func addTreeValue<Value>(_ value: AttributeGraph.Attribute<Value>, forKey key: Swift.UnsafePointer<Int8>, flags: Swift.UInt32)
410+
}
411+
406412
// MARK: - Rule Related
407413

408414
// MARK: - Rule

0 commit comments

Comments
 (0)