File tree Expand file tree Collapse file tree 4 files changed +24
-13
lines changed
include/OpenAttributeGraph Expand file tree Collapse file tree 4 files changed +24
-13
lines changed Original file line number Diff line number Diff line change @@ -114,11 +114,12 @@ public struct Attribute<Value> {
114114 }
115115 let index = Graph . typeIndex (
116116 ctx: context,
117- body: Body . self,
118- valueType: Metadata ( Value . self) ,
119- flags: flags,
120- update: update
121- )
117+ body: Metadata ( Body . self)
118+ ) {
119+ let pointer = UnsafeMutablePointer< _AttributeType> . allocate( capacity: 1 )
120+ // TODO
121+ return UnsafePointer ( pointer)
122+ }
122123 identifier = OAGGraphCreateAttribute ( index: index, body: body, value: value)
123124 #endif
124125 }
Original file line number Diff line number Diff line change 88public import OpenAttributeGraphCxx
99
1010extension Graph {
11+ @_silgen_name ( " OAGGraphInternAttributeType " )
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 ( " OAGGraphSetInvalidationCallback " )
Original file line number Diff line number Diff line change @@ -125,6 +125,13 @@ void OAGGraphInvalidate(OAGGraphRef graph) {
125125 graph->context .setInvalid (true );
126126}
127127
128+ uint32_t OAGGraphInternAttributeType (OAGUnownedGraphContextRef graph, OAGTypeID type,
129+ const OAGAttributeType *(*make_attribute_type)(const void *context OAG_SWIFT_CONTEXT) OAG_SWIFT_CC(swift),
130+ const void *context) {
131+ // TODO
132+ return 0 ;
133+ }
134+
128135void OAGGraphInvalidateAllValues (OAGGraphRef graph) {
129136 if (graph->context .isInvalid ()) {
130137 OAG::precondition_failure (" invalidated graph" );
Original file line number Diff line number Diff line change 77
88#include <OpenAttributeGraph/OAGBase.h>
99#include <OpenAttributeGraph/Private/CFRuntime.h>
10+ #include <OpenAttributeGraph/OAGAttributeType.h>
1011#include <OpenAttributeGraph/OAGGraphCounterQueryType.h>
1112
1213// Note: Place all structure declaration in a single place to avoid header cycle dependency
@@ -69,6 +70,12 @@ OAG_EXPORT
6970OAG_REFINED_FOR_SWIFT
7071void OAGGraphInvalidate (OAGGraphRef graph ) OAG_SWIFT_NAME (OAGGraphRef .invalidate (self :));
7172
73+ OAG_EXPORT
74+ OAG_REFINED_FOR_SWIFT
75+ uint32_t OAGGraphInternAttributeType (OAGUnownedGraphContextRef graph , OAGTypeID type ,
76+ const OAGAttributeType * _Nonnull (* _Nonnull make_attribute_type )(const void * _Nullable context OAG_SWIFT_CONTEXT ) OAG_SWIFT_CC (swift ),
77+ const void * _Nullable context );
78+
7279OAG_EXPORT
7380OAG_REFINED_FOR_SWIFT
7481void OAGGraphInvalidateAllValues (OAGGraphRef graph ) OAG_SWIFT_NAME (OAGGraphRef .invalidateAllValues (self :));
You can’t perform that action at this time.
0 commit comments