Skip to content

Commit 3e59f32

Browse files
committed
Add OGGraphTracing API
1 parent 896aef9 commit 3e59f32

File tree

6 files changed

+78
-5
lines changed

6 files changed

+78
-5
lines changed

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// OGGraphTracing.mm
3+
// OpenGraph_SPI
4+
5+
#include "OGGraphTracing.h"
6+
7+
void OGGraphStartTracing(_Nullable OGGraphRef graph, OGGraphTracingOptions options) {
8+
OGGraphStartTracing2(graph, options, nil);
9+
}
10+
11+
void OGGraphStartTracing2(_Nullable OGGraphRef graph, OGGraphTracingOptions options, _Nullable CFArrayRef array) {
12+
// TODO
13+
}
14+
15+
void OGGraphStopTracing(_Nullable OGGraphRef graph) {
16+
// TODO
17+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//
2+
// OGGraphTracing.h
3+
// OpenGraph_SPI
4+
5+
#ifndef OGGraphTracing_hpp
6+
#define OGGraphTracing_hpp
7+
8+
#include "OGBase.h"
9+
#include "OGGraph.h"
10+
11+
typedef OG_OPTIONS(uint32_t, OGGraphTracingOptions) {
12+
OGGraphTracingOptions_0 = 0,
13+
OGGraphTracingOptions_1 = 1 << 0,
14+
OGGraphTracingOptions_2 = 1 << 1,
15+
} OG_SWIFT_NAME(OGGraphRef.TracingOptions);
16+
17+
OG_ASSUME_NONNULL_BEGIN
18+
19+
OG_EXTERN_C_BEGIN
20+
21+
OG_EXPORT
22+
OG_REFINED_FOR_SWIFT
23+
void OGGraphStartTracing(_Nullable OGGraphRef graph, OGGraphTracingOptions options) OG_SWIFT_NAME(OGGraphRef.startTracing(_:options:));
24+
25+
OG_EXPORT
26+
OG_REFINED_FOR_SWIFT
27+
void OGGraphStartTracing2(_Nullable OGGraphRef graph, OGGraphTracingOptions options, _Nullable CFArrayRef array);
28+
29+
OG_EXPORT
30+
OG_REFINED_FOR_SWIFT
31+
void OGGraphStopTracing(_Nullable OGGraphRef graph) OG_SWIFT_NAME(OGGraphRef.stopTracing(_:));
32+
33+
OG_EXTERN_C_END
34+
35+
OG_ASSUME_NONNULL_END
36+
37+
#endif /* OGGraphTracing_hpp */

Sources/OpenGraph_SPI/include/OpenGraph-umbrella.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "OGDebugServer.h"
1313
#include "OGGraph.h"
1414
#include "OGGraphContext.h"
15+
#include "OGGraphTracing.h"
1516
#include "OGInputOptions.h"
1617
#include "OGSearchOptions.h"
1718
#include "OGSubgraph.h"

Tests/OpenGraphCompatibilityTests/Graph/GraphTests.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
//
22
// GraphTests.swift
3-
//
4-
//
5-
//
3+
// OpenGraphCompatibilityTests
64

75
import Testing
86
import Foundation
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// GraphTracingTests.swift
3+
// OpenGraphCompatibilityTests
4+
5+
import Testing
6+
7+
struct GraphTracingTests {
8+
@Test
9+
func tracing() {
10+
let graph = Graph()
11+
Graph.startTracing(graph, options: [])
12+
Graph.stopTracing(graph)
13+
}
14+
15+
@Test
16+
func tracingAll() {
17+
Graph.startTracing(nil, options: [])
18+
Graph.stopTracing(nil)
19+
}
20+
}

0 commit comments

Comments
 (0)