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 
162 /// Enumeration of different ways that attributes can be combined
164 {
165  /// The attribute should be excluded as it does not match any of
166  /// the patterns in the map
167  eIgnore,
168 
169  /// The attribute is flattened, i.e. the first value for the attrib
170  /// is used an no other values are selected.
171  eFirstValue,
172 
173  /// The attribute overwrites existing values, unless the destination
174  /// has its own modications
175  eLastValue,
176 
177  /// The unique values for the attribute are kept,
179 
180  /// The attribute values are concatenated together into an array
181  eAppendArray,
182 
183  /// The minimum value is kept
184  eMinimum,
185 
186  /// The maximum value is kept
187  eMaximum,
188 
189  /// The sum of the values is kept
190  eSum,
191 
192  /// The attribute values are averaged
193  eAverage,
194 
195  /// The most common value is kept
196  eMode,
197 
198  /// The middle value is kept
199  eMedian,
200 
201  /// The values are kept in sorted order
202  eSorted,
203 
204  /// The values are kept in sorted order, and made unique
206 };
207 
208 /// Enumerations of errors that can occur when merging attributes
210 {
211  /// No error occured
212  eNone,
213 
214  /// Mismatch between types
215  eType,
216 
217  /// Invalid merge operation for the attribute type
218  eInvalidOp,
219 
220  /// Mismatch between stride lengths
221  eStride,
222 };
223 
224 /// Enumeration of types of attribute that can be queried from work items
226 {
227  /// Index [numeric, string]
228  eIndexAttrib,
229  /// Frame [numeric, string]
230  eFrameAttrib,
231  /// Loop depth [numeric, string]
233  /// Work item unique id [numeric, string]
234  eIdAttrib,
235  /// Input result list size [numeric, string]
237  // Output result list size [numeric, string]
239 
240  /// Name [string]
241  eNameAttrib,
242  /// Label [string]
243  eLabelAttrib,
244  /// Log path [string]
245  eLogAttrib,
246 
247  /// Input result list [string]
248  eInputAttrib,
249  /// Input tag [string]
251 
252  /// Output result list [string]
254  /// Output tag [string]
256 
257  /// Scheduler name [string]
259  /// Node name [string]
260  eNodeName,
261 
262  /// Custom attribute name [numeric, string]
264 };
265 
266 /// Detrmines when to overwrite an attribute when requesting a writeable
267 /// reference to it.
269 {
270  /// Never overwrite the attribute
271  eNever,
272 
273  /// Only overwrite the attribute if the type matches
274  eMatch,
275 
276  /// Always overwrite the attribute. If the attribute exists with
277  /// different type, it will be removed and replaced with a new
278  /// attribute of the requested type.
279  eAlways
280 };
281 
282 /// Enumeration of the different ways that attributes can be saved
284 {
285  /// Flatten attributes, saving both dynamic and static as a mix
286  eFlatten,
287 
288  /// Save only static
289  eStatic,
290 
291  /// Save only dynamic
292  eDynamic,
293 
294  /// Save all attributes, including ones from the parent map that
295  /// are not directly owned by this map
296  eAll,
297 };
298 
299 /// Enumeration of merge strategies for handling collisions when
300 /// deserializing attributes into a map with existing attributes
302 {
303  /// The existing attribute is kept and the deserialized attribute is
304  /// discarded
305  eKeep,
306 
307  /// The existing attribute is replaced with the deserialized attribute
308  eReplace,
309 
310  /// Deserialization fails when an existing attribute is found with the
311  /// same name as the one being deserialized
312  eError
313 };
314 
315 #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
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.
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.
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.
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.
An array of UT_OptionsHolder values.
Index [numeric, string].
The entire attribute map is read only.
An unspecified error occured - the ref is invalid.