Skip to content

Commit da341ee

Browse files
committed
Add parent and child accessor functions for OGSubgraphRef
1 parent dfe4a15 commit da341ee

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

Sources/OpenGraphCxx/Graph/OGSubgraph.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,31 @@ void OGSubgraphRemoveChild(OGSubgraphRef parent, OGSubgraphRef child) {
136136
// TODO
137137
}
138138

139+
OGSubgraphRef OGSubgraphGetChild(OGSubgraphRef cf_subgraph, uint32_t index, uint8_t *_Nullable tag_out) {
140+
// TODO
141+
return nullptr;
142+
}
143+
144+
uint32_t OGSubgraphGetChildCount(OGSubgraphRef cf_subgraph) {
145+
// TODO
146+
return 0;
147+
}
148+
149+
OGSubgraphRef OGSubgraphGetParent(OGSubgraphRef cf_subgraph, int64_t index) {
150+
// TODO
151+
return nullptr;
152+
}
153+
154+
uint64_t OGSubgraphGetParentCount(OGSubgraphRef cf_subgraph) {
155+
// TODO
156+
return 0;
157+
}
158+
159+
bool OGSubgraphIsAncestor(OGSubgraphRef cf_subgraph, OGSubgraphRef other) {
160+
// TODO
161+
return false;
162+
}
163+
139164
void OGSubgraphApply(OGSubgraphRef cf_subgraph,
140165
OGAttributeFlags flags,
141166
const void (*function)(const void * _Nullable context OG_SWIFT_CONTEXT, OGAttribute attribute) OG_SWIFT_CC(swift),

Sources/OpenGraphCxx/include/OpenGraph/OGSubgraph.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,26 @@ OG_EXPORT
6868
OG_REFINED_FOR_SWIFT
6969
void OGSubgraphRemoveChild(OGSubgraphRef parent, OGSubgraphRef child) OG_SWIFT_NAME(OGSubgraphRef.removeChild(self:_:));
7070

71+
OG_EXPORT
72+
OG_REFINED_FOR_SWIFT
73+
OGSubgraphRef OGSubgraphGetChild(OGSubgraphRef cf_subgraph, uint32_t index, uint8_t *_Nullable tag_out) OG_SWIFT_NAME(OGSubgraphRef.child(self:at:tag:));
74+
75+
OG_EXPORT
76+
OG_REFINED_FOR_SWIFT
77+
uint32_t OGSubgraphGetChildCount(OGSubgraphRef cf_subgraph) OG_SWIFT_NAME(getter:OGSubgraphRef.childCount(self:));
78+
79+
OG_EXPORT
80+
OG_REFINED_FOR_SWIFT
81+
OGSubgraphRef OGSubgraphGetParent(OGSubgraphRef cf_subgraph, int64_t index) OG_SWIFT_NAME(OGSubgraphRef.parent(self:at:));
82+
83+
OG_EXPORT
84+
OG_REFINED_FOR_SWIFT
85+
uint64_t OGSubgraphGetParentCount(OGSubgraphRef cf_subgraph) OG_SWIFT_NAME(getter:OGSubgraphRef.parentCount(self:));
86+
87+
OG_EXPORT
88+
OG_REFINED_FOR_SWIFT
89+
bool OGSubgraphIsAncestor(OGSubgraphRef cf_subgraph, OGSubgraphRef other) OG_SWIFT_NAME(OGSubgraphRef.isAncestor(self:of:));
90+
7191
OG_EXPORT
7292
OG_REFINED_FOR_SWIFT
7393
bool OGSubgraphIntersects(OGSubgraphRef subgraph, OGAttributeFlags flags) OG_SWIFT_NAME(OGSubgraphRef.intersects(self:flags:));

0 commit comments

Comments
 (0)