-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathOAGAttribute.cpp
More file actions
207 lines (169 loc) · 5.83 KB
/
OAGAttribute.cpp
File metadata and controls
207 lines (169 loc) · 5.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
//
// OAGAttribute.cpp
// OpenAttributeGraphCxx
#include <OpenAttributeGraph/OAGAttribute.h>
#include <OpenAttributeGraphCxx/Attribute/AttributeID.hpp>
#include <OpenAttributeGraphCxx/Misc/assert.hpp>
#include <optional>
const OAGAttribute OAGAttributeNil = OAGAttribute(OAG::AttributeID::Kind::Null);
OAGAttribute OAGGraphGetCurrentAttribute(void) {
// TODO
return OAGAttributeNil;
}
bool OAGGraphCurrentAttributeWasModified(void) {
// TODO
return false;
}
namespace {
OAGAttribute create_offset_attribute(OAGAttribute attribute, uint64_t offset, std::optional<uint64_t> size) {
// TODO
return OAGAttributeNil;
}
}
OAGAttribute OAGGraphCreateOffsetAttribute(OAGAttribute attribute, long offset) {
return create_offset_attribute(attribute, offset, std::nullopt);
}
OAGAttribute OAGGraphCreateOffsetAttribute2(OAGAttribute attribute, long offset, uint64_t size) {
return create_offset_attribute(attribute, offset, std::optional(size));
}
namespace {
OAGAttribute create_indirect_attribute(OAGAttribute attribute, std::optional<uint64_t> size) {
// TODO
return OAGAttributeNil;
}
}
OAGAttribute OAGGraphCreateIndirectAttribute(OAGAttribute attribute) {
return create_indirect_attribute(attribute, std::nullopt);
}
OAGAttribute OAGGraphCreateIndirectAttribute2(OAGAttribute attribute, uint64_t size) {
return create_indirect_attribute(attribute, std::optional(size));
}
OAGAttributeFlags OAGGraphGetFlags(OAGAttribute attribute) {
const OAG::AttributeID id = OAG::AttributeID(attribute);
id.checkIsDirect();
// TODO: data/table
return OAGAttributeFlagsNone;
}
void OAGGraphSetFlags(OAGAttribute attribute, OAGAttributeFlags flags) {
const OAG::AttributeID id = OAG::AttributeID(attribute);
id.checkIsDirect();
// TODO: data/table
}
void OAGGraphAddInput(OAGAttribute attribute1, OAGAttribute attribute2, OAGInputOptions options, long token) {
const OAG::AttributeID id = OAG::AttributeID(attribute1);
id.checkIsDirect();
// TODO: data/table
}
const OAGAttributeInfo OAGGraphGetAttributeInfo(OAGAttribute attribute) {
const OAG::AttributeID id = OAG::AttributeID(attribute);
id.checkIsDirect();
// TODO
return { nullptr, nullptr };
}
void OAGGraphMutateAttribute(OAGAttribute attribute,
const OAGTypeID type,
bool invalidating,
const void (*function)(const void * _Nullable context OAG_SWIFT_CONTEXT, void *body) OAG_SWIFT_CC(swift),
const void * _Nullable context) {
const OAG::AttributeID id = OAG::AttributeID(attribute);
id.checkIsDirect();
// attribute_modify(AG::data::ptr<AG::Node>, AGSwiftMetadata const*, AG::ClosureFunction<void, void*>, bool
}
OAGAttribute OAGGraphGetIndirectDependency(OAGAttribute attribute) {
// TODO
return OAGAttributeNil;
}
void OAGGraphSetIndirectDependency(OAGAttribute attribute1, OAGAttribute attribute2) {
// TODO
}
OAGAttribute OAGGraphGetIndirectAttribute(OAGAttribute attribute) {
// TODO
return OAGAttributeNil;
}
void OAGGraphSetIndirectAttribute(OAGAttribute attribute1, OAGAttribute attribute2) {
// TODO
}
void OAGGraphResetIndirectAttribute(OAGAttribute attribute, bool non_nil) {
// TODO
}
OAGAttribute OAGGraphCreateAttribute(long index, const void *body, const void * value) {
// TODO
return OAGAttributeNil;
}
const OAGValue OAGGraphGetValue(OAGAttribute attribute, OAGValueOptions options, OAGTypeID type) {
// TODO
return OAGValue { nullptr, false };
}
bool OAGGraphSetValue(OAGAttribute attribute, const void *value, OAGTypeID type) {
// TODO
return false;
}
const OAGValue OAGGraphGetInputValue(OAGAttribute attribute, OAGAttribute inputAttribute, OAGValueOptions options, const OAGTypeID type) {
// TODO
return OAGValue { nullptr, false };
}
const void * _Nullable OAGGraphGetOutputValue(OAGTypeID type) {
// TODO
return nullptr;
}
void OAGGraphSetOutputValue(const void *value, const OAGTypeID type) {
// TODO
}
OAGValueState OAGGraphGetValueState(OAGAttribute attribute) {
// TODO
return {};
}
bool OAGGraphHasValue(OAGAttribute attribute) {
// TODO
return false;
}
void OAGGraphUpdateValue(OAGAttribute attribute) {
// TODO
}
void OAGGraphPrefetchValue(OAGAttribute attribute) {
// TODO
}
void OAGGraphInvalidateValue(OAGAttribute attribute) {
// TODO
}
void OAGGraphVerifyType(OAGAttribute attribute, OAGTypeID type) {
// TODO
}
OAGGraphRef OAGGraphGetAttributeGraph(OAGAttribute attribute) {
// TODO
return nullptr;
}
OAGSubgraphRef OAGGraphGetAttributeSubgraph(OAGAttribute attribute) {
OAGSubgraphRef subgraph = OAGGraphGetAttributeSubgraph2(attribute);
if (subgraph == nullptr) {
OAG::precondition_failure("no subgraph");
}
return subgraph;
}
_Nullable OAGSubgraphRef OAGGraphGetAttributeSubgraph2(OAGAttribute attribute) {
auto attribute_id = OAG::AttributeID(attribute);
// attribute_id.validate_data_offset();
// auto subgraph = attribute_id.subgraph();
// if (subgraph == nullptr) {
// OAG::precondition_failure("internal error");
// }
// return subgraph->to_cf();
// TODO
return nullptr;
}
const void * OAGGraphReadCachedAttribute(long hashValue, OAGTypeID bodyType, const void *bodyPointer, OAGTypeID valueType, OAGCachedValueOptions options, OAGAttribute attribute, bool unknown) {
// TODO
return nullptr;
}
const void * _Nullable OAGGraphReadCachedAttributeIfExists(long hashValue, OAGTypeID bodyType, const void *bodyPointer, OAGTypeID valueType, OAGCachedValueOptions options, OAGAttribute attribute, bool unknown) {
// TODO
return nullptr;
}
void OAGGraphWithUpdate(
OAGAttribute attribute,
void (* callback)(const void *context OAG_SWIFT_CONTEXT) OAG_SWIFT_CC(swift),
const void *context
) {
// TODO
callback(context);
}