File tree Expand file tree Collapse file tree 4 files changed +24
-13
lines changed Expand file tree Collapse file tree 4 files changed +24
-13
lines changed Original file line number Diff line number Diff line change @@ -50,11 +50,12 @@ public struct Attribute<Value> {
5050 }
5151 let index = Graph . typeIndex (
5252 ctx: context,
53- body: Body . self,
54- valueType: Metadata ( Value . self) ,
55- flags: flags,
56- update: update
57- )
53+ body: Metadata ( Body . self)
54+ ) {
55+ let pointer = UnsafeMutablePointer< _AttributeType> . allocate( capacity: 1 )
56+ // TODO
57+ return UnsafePointer ( pointer)
58+ }
5859 identifier = OGGraphCreateAttribute ( index: index, body: body, value: value)
5960 #endif
6061 }
Original file line number Diff line number Diff line change 88public import OpenGraphCxx
99
1010extension Graph {
11+ @_silgen_name ( " OGGraphInternAttributeType " )
1112 public static func typeIndex(
1213 ctx: UnownedGraphContext ,
13- body: _AttributeBody . Type ,
14- valueType: Metadata ,
15- flags: _AttributeType . Flags ,
16- update: AttributeUpdateBlock
17- ) -> Int {
18- // TODO: __AGGraphInternAttributeType
19- 0
20- }
14+ body: Metadata ,
15+ makeAttributeType: ( ) -> UnsafePointer < _AttributeType >
16+ ) -> Int
2117}
2218
2319@_silgen_name ( " OGGraphSetInvalidationCallback " )
Original file line number Diff line number Diff line change @@ -125,6 +125,13 @@ void OGGraphInvalidate(OGGraphRef graph) {
125125 graph->context .setInvalid (true );
126126}
127127
128+ uint32_t OGGraphInternAttributeType (OGUnownedGraphContextRef graph, OGTypeID type,
129+ const OGAttributeType *(*make_attribute_type)(const void *context OG_SWIFT_CONTEXT) OG_SWIFT_CC(swift),
130+ const void *context) {
131+ // TODO
132+ return 0 ;
133+ }
134+
128135void OGGraphInvalidateAllValues (OGGraphRef graph) {
129136 if (graph->context .isInvalid ()) {
130137 OG::precondition_failure (" invalidated graph" );
Original file line number Diff line number Diff line change 88#include <OpenGraph/OGBase.h>
99#include <OpenGraph/Private/CFRuntime.h>
1010#include <OpenGraph/OGGraphCounterQueryType.h>
11+ #include <OpenGraph/OGAttributeType.h>
1112
1213// Note: Place all structure declaration in a single place to avoid header cycle dependency
1314
@@ -69,6 +70,12 @@ OG_EXPORT
6970OG_REFINED_FOR_SWIFT
7071void OGGraphInvalidate (OGGraphRef graph ) OG_SWIFT_NAME (OGGraphRef .invalidate (self :));
7172
73+ OG_EXPORT
74+ OG_REFINED_FOR_SWIFT
75+ uint32_t OGGraphInternAttributeType (OGUnownedGraphContextRef graph , OGTypeID type ,
76+ const OGAttributeType * _Nonnull (* _Nonnull make_attribute_type )(const void * _Nullable context OG_SWIFT_CONTEXT ) OG_SWIFT_CC (swift ),
77+ const void * _Nullable context );
78+
7279OG_EXPORT
7380OG_REFINED_FOR_SWIFT
7481void OGGraphInvalidateAllValues (OGGraphRef graph ) OG_SWIFT_NAME (OGGraphRef .invalidateAllValues (self :));
You can’t perform that action at this time.
0 commit comments