HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_AttributeTypes.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * COMMENTS:
7  */
8 
9 #ifndef __PDG_ATTRIBUTE_TYPES_H__
10 #define __PDG_ATTRIBUTE_TYPES_H__
11 
12 #include <SYS/SYS_Types.h>
13 
14 /// Enumeration of possible attribute types
15 enum class PDG_AttributeType : int8
16 {
17  /// Undefined or uninitialized attribute type
18  eUndefined = -1,
19 
20  /// An array of `int` values
21  eIntegerArray = 0,
22 
23  /// An array of `fpreal` values
24  eFloatArray = 1,
25 
26  /// An array of `UT_StringHolder` values
27  eStringArray = 2,
28 
29  /// An array of `PDG_File` values, e.g. File info structs
30  eFileArray = 3,
31 
32  /// A single, opaque PyObject
33  ePythonObject = 4,
34 
35  /// A single PDG_ApplicationShim::Geometry instance
36  eGeometry = 5,
37 
38  /// An array of `UT_OptionsHolder` values
39  eDictArray = 6,
40 };
41 
42 /// Enumeration of extra attribute flags. Flags can be ORed together.
44 {
45  /// Covenience value, all flags off
46  eNoFlags = 0x0000,
47 
48  /// The attribute should not be copied onto downstream work items
49  eNoCopyFlag = 0x0001,
50 
51  /// The attribute's value should be exported to the job environment
52  eEnvExportFlag = 0x0002,
53 
54  /// The attribute is read-only and cannot be modified on this work item
55  eReadOnlyFlag = 0x0004,
56 
57  /// The attribute is for internal use, and will be accessed with other
58  /// API methods. It should not be displayed in the UI
59  eInternalFlag = 0x0008,
60 
61  /// The attribute contains a operator path
62  eOperatorFlag = 0x0010,
63 
64  /// The attribute contains a path that should be transfered to
65  /// remote machines when the work item cooks.
66  eTransferFlag = 0x0020,
67 
68  /// The attribute should be copied to internal dependent(s) within
69  /// the node, before the dependent(s) cooks
70  eDependentFlag = 0x0040,
71 
72  /// The attribute should not cause the owner to be dirtied if it
73  /// changes between cooks, e.g due to work item regeneration
74  eNoDirtyFlag = 0x0080,
75 
76  /// The attribute is not saved when the owner is serialized
77  eTransientFlag = 0x0100,
78 
79  /// The attribute is bound to a particular work item. This flag is
80  /// only relevant for global/graph attributes
81  eBoundFlag = 0x0200,
82 
83  /// The attribute should be treated as an extra input. If the file
84  /// changes on disk between cooks, the cache of the work items using
85  /// the file is invalided.
86  eInputFileFlag = 0x0400,
87 
88  /// The attribute is a numeric value, but should be treated as a time
89  /// stamp instead of a plain number when being displayed
90  eTimestampFlag = 0x0800,
91 
92  /// The attribute is a numeric value, but should be treated as a memory
93  /// size instead of a plain number when being displayed
94  eMemoryValueFlag = 0x1000,
95 
96  //// Covenience value, the bitwise OR of all other flags
97  eAllFlags = 0xFFFF
98 };
99 
100 /// Enumeration of attribute cast results
102 {
103  /// No cast error occured (success)
104  eSuccess,
105 
106  /// Cast failed due to a missing/undefined attribute
108 
109  /// Cast failed due to a type mismatch (string vs. int)
110  eErrorType,
111 
112  /// Cast failed due to an index being out of bounds
113  eErrorBounds,
114 
115  /// Cast failed due to an invalid tag (applies to files only)
116  eErrorTag,
117 };
118 
119 /// Enumeration of possible errors that could occur when attempting to
120 /// to construct an attribute reference
122 {
123  /// No error was specified, i.e. the ref is valid
124  eNone,
125 
126  /// An unspecified error occured - the ref is invalid
127  eUnspecified,
128 
129  /// The requested attribute was not found - the ref is invalid
130  eNotFound,
131 
132  /// The requested attribute was a readonly when attempting to create
133  /// a RW ref - the ref is invalid
134  eReadOnly,
135 
136  /// The requested attribute is internal, and therefore cannot be
137  /// removed by user code
138  eInternal,
139 
140  /// The entire attribute map is read only
142 
143  /// The requested attribute type did not match the attribute - the
144  /// ref is invalid
146 
147  /// The requested attribute is static and was not upgraded to dynamic
148  eTypeUpgrade,
149 
150  /// The requested attribute already exists, but the API call was
151  /// instruct to not overwrite existing values
152  eOverwrite,
153 
154  /// The ref is uninitialized and needs to be created at a later point
156 
157  /// The attribute doesn't support a flag that was passed to a SetFlag
158  /// call
159  eInvalidFlag,
160 
161  /// The attribute isn't an array type, but needs to be in order to
162  /// perform the specified operation
163  eTypeArray,
164 };
165 
166 /// Enumeration of different ways that attributes can be combined
168 {
169  /// The attribute should be excluded as it does not match any of
170  /// the patterns in the map
171  eIgnore,
172 
173  /// The attribute is flattened, i.e. the first value for the attrib
174  /// is used an no other values are selected.
175  eFirstValue,
176 
177  /// The attribute overwrites existing values, unless the destination
178  /// has its own modications
179  eLastValue,
180 
181  /// The unique values for the attribute are kept,
183 
184  /// The attribute values are concatenated together into an array
185  eAppendArray,
186 
187  /// The minimum value is kept
188  eMinimum,
189 
190  /// The maximum value is kept
191  eMaximum,
192 
193  /// The sum of the values is kept
194  eSum,
195 
196  /// The attribute values are averaged
197  eAverage,
198 
199  /// The most common value is kept
200  eMode,
201 
202  /// The middle value is kept
203  eMedian,
204 
205  /// The values are kept in sorted order
206  eSorted,
207 
208  /// The values are kept in sorted order, and made unique
210 };
211 
212 /// Enumerations of errors that can occur when merging attributes
214 {
215  /// No error occured
216  eNone,
217 
218  /// Mismatch between types
219  eType,
220 
221  /// Invalid merge operation for the attribute type
222  eInvalidOp,
223 
224  /// Mismatch between stride lengths
225  eStride,
226 };
227 
228 /// Enumeration of types of attribute that can be queried from work items
230 {
231  /// Index [numeric, string]
232  eIndexAttrib,
233  /// Frame [numeric, string]
234  eFrameAttrib,
235  /// Loop depth [numeric, string]
237  /// Work item unique id [numeric, string]
238  eIdAttrib,
239  /// Input result list size [numeric, string]
241  // Output result list size [numeric, string]
243 
244  /// Name [string]
245  eNameAttrib,
246  /// Label [string]
247  eLabelAttrib,
248  /// Log path [string]
249  eLogAttrib,
250 
251  /// Input result list [string]
252  eInputAttrib,
253  /// Input tag [string]
255 
256  /// Output result list [string]
258  /// Output tag [string]
260 
261  /// Scheduler name [string]
263  /// Node name [string]
264  eNodeName,
265 
266  /// Custom attribute name [numeric, string]
268 };
269 
270 /// Detrmines when to overwrite an attribute when requesting a writeable
271 /// reference to it.
273 {
274  /// Never overwrite the attribute
275  eNever,
276 
277  /// Only overwrite the attribute if the type matches
278  eMatch,
279 
280  /// Always overwrite the attribute. If the attribute exists with
281  /// different type, it will be removed and replaced with a new
282  /// attribute of the requested type.
283  eAlways
284 };
285 
286 /// Enumeration of the different ways that attributes can be saved
288 {
289  /// Flatten attributes, saving both dynamic and static as a mix
290  eFlatten,
291 
292  /// Save only static
293  eStatic,
294 
295  /// Save only dynamic
296  eDynamic,
297 
298  /// Save all attributes, including ones from the parent map that
299  /// are not directly owned by this map
300  eAll,
301 };
302 
303 /// Enumeration of merge strategies for handling collisions when
304 /// deserializing attributes into a map with existing attributes
306 {
307  /// The existing attribute is kept and the deserialized attribute is
308  /// discarded
309  eKeep,
310 
311  /// The existing attribute is replaced with the deserialized attribute
312  eReplace,
313 
314  /// Deserialization fails when an existing attribute is found with the
315  /// same name as the one being deserialized
316  eError
317 };
318 
319 /// Enumeration of attribute copy operations
321 {
322  /// Only copy if the existing attribute does not exist
323  eNew,
324 
325  /// Overwrites the attribute even if the type is different, destroying
326  /// the original data in the process
328 
329  /// Overwrite the existing attribute if the type matches
330  eOverwrite,
331 
332  /// Append to the existing attribute if it exists and matches
333  eAppend,
334 
335  /// Prepend to the existing attribute if it exists and matches
336  ePrepend,
337 
338  /// Update the values in place, and leave any extra array values beyond
339  /// the incoming range as-is
340  eUpdate,
341 };
342 
343 /// Enumeration of error levels when interacting with the attribute API. This
344 /// exists a convenience for custom nodes, the Python API, etc and is not used
345 /// internally by any of the attribute code.
346 ///
347 /// Specifies how an error should be reported to users when interacting with
348 /// an attribute API method.
350 {
351  /// Nothing is reported to the user
352  eQuiet,
353 
354  /// A warning is reported to the user
355  eWarning,
356 
357  /// An error is reported to the user
358  eError
359 };
360 
361 #endif /* __PDG_ATTRIBUTE_TYPES_H__ */
PDG_AttributeError
Only overwrite the attribute if the type matches.
Cast failed due to a missing/undefined attribute.
Loop depth [numeric, string].
unsigned short uint16
Definition: SYS_Types.h:38
Nothing is reported to the user.
PDG_AttributeIntrinsic
Enumeration of types of attribute that can be queried from work items.
Invalid merge operation for the attribute type.
The values are kept in sorted order.
Append to the existing attribute if it exists and matches.
Flatten attributes, saving both dynamic and static as a mix.
Never overwrite the attribute.
Undefined or uninitialized attribute type.
Input result list [string].
The attribute values are concatenated together into an array.
Output result list [string].
The existing attribute is replaced with the deserialized attribute.
The maximum value is kept.
Covenience value, all flags off.
PDG_AttributeOverwrite
Cast failed due to a type mismatch (string vs. int)
The values are kept in sorted order, and made unique.
A single PDG_ApplicationShim::Geometry instance.
No error was specified, i.e. the ref is valid.
PDG_AttributeErrorLevel
The middle value is kept.
Custom attribute name [numeric, string].
The sum of the values is kept.
PDG_AttributeCast
Enumeration of attribute cast results.
Frame [numeric, string].
The attribute is read-only and cannot be modified on this work item.
The most common value is kept.
PDG_AttributeType
Enumeration of possible attribute types.
Work item unique id [numeric, string].
An array of UT_StringHolder values.
The unique values for the attribute are kept,.
signed char int8
Definition: SYS_Types.h:35
PDG_AttributeMergeOp
Enumeration of different ways that attributes can be combined.
Mismatch between stride lengths.
PDG_AttributeFlag
Enumeration of extra attribute flags. Flags can be ORed together.
Mismatch between types.
An array of fpreal values.
Prepend to the existing attribute if it exists and matches.
PDG_AttributeSaveType
Enumeration of the different ways that attributes can be saved.
Cast failed due to an invalid tag (applies to files only)
The attribute should not be copied onto downstream work items.
The requested attribute is static and was not upgraded to dynamic.
The ref is uninitialized and needs to be created at a later point.
The attribute values are averaged.
An array of PDG_File values, e.g. File info structs.
No cast error occured (success)
PDG_AttributeCollision
A single, opaque PyObject.
The requested attribute was not found - the ref is invalid.
PDG_AttributeMergeError
Enumerations of errors that can occur when merging attributes.
The attribute's value should be exported to the job environment.
An array of int values.
The attribute is not saved when the owner is serialized.
Cast failed due to an index being out of bounds.
The minimum value is kept.
Input result list size [numeric, string].
The attribute contains a operator path.
Only copy if the existing attribute does not exist.
An array of UT_OptionsHolder values.
Index [numeric, string].
PDG_AttributeCopyOp
Enumeration of attribute copy operations.
A warning is reported to the user.
The entire attribute map is read only.
An unspecified error occured - the ref is invalid.