HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_WorkItemTypes.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_WORK_ITEM_TYPES_H__
10 #define __PDG_WORK_ITEM_TYPES_H__
11 
12 #include <UT/UT_Array.h>
13 #include <UT/UT_ArrayMap.h>
14 #include <UT/UT_ArraySet.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_Optional.h>
17 #include <UT/UT_UniquePtr.h>
18 
19 #include <SYS/SYS_Types.h>
20 
21 class PDG_BatchWorkItem;
22 class PDG_WorkItem;
23 class PDG_WorkItemData;
24 
25 /// Type def for registered type objects
27 
28 /// Type defs for unique work item IDs
35  std::pair<const PDG_WorkItem*, bool>>;
36 
37 /// Default, invalid work item ID value.
38 static constexpr PDG_WorkItemID PDG_WorkItemInvalidID = -1;
39 
40 /// Work item pointers
43 
44 /// Array, set and map of work items
47 
51 
52 /// Pair and array of work item pairs
53 using PDG_WorkItemPair = std::pair<PDG_WorkItem*, PDG_WorkItem*>;
55 
56 /// Array and set of batch work items
60 
61 /// Optional frame value, used when constructing work items and partitions
63 
64 /// Enumeration of activiation modes for the batch, i.e. the condition under
65 /// which the batch item is first submitted to the scheduler
67 {
68  /// The batch is scheduled once any of the subitems are ready to cook
69  eAny,
70 
71  /// The batch is scheduled once the first sub item is ready to cook
72  eFirst,
73 
74  /// The batch is scheduled once all of the subitems are ready to cook
75  eAll,
76 
77  /// The batch is scheduled once a specific number of subitems are ready
78  /// to cook
79  eFixed
80 };
81 
82 /// Enumeration of evaluation states that a work item can be in. Used when
83 /// checking if the subitem is able to evaluate yet.
85 {
86  /// The work item is blocked on a dependency
88 
89  /// The work item is ready to cook
90  eEvalReady,
91 
92  /// The work item has a failed dependency
94 };
95 
96 /// Enumeration of work item cache states, returned when checking if a work
97 /// item is cached with respect to a particular node
99 {
100  /// The work item's cache state is undefined, e.g. because it doesn't
101  /// exist or the node doesn't support caching
102  eUndefined,
103 
104  /// The cache state is always dirty, usually due to the node's caching
105  /// mode parameter
106  eDirtyAlways,
107 
108  /// The cache state is dirty because the work item has no files
109  eDirtyEmpty,
110 
111  /// The cache state is dirty because the work item has new files that
112  /// didn't exist on a previous cook
113  eDirtyNew,
114 
115  /// The cache state is dirty because the work item is stale with
116  /// respect to its input tasks
117  eDirtyStale,
118 
119  /// The cache state is dirty because an output file is missing on disk
121 
122  /// The cache is clean, assuming the parent task is also clean
124 
125  /// The cache is clean
126  eClean,
127 };
128 
129 /// Enumeration of work item log message types
131 {
132  /// Error log message
133  eLogError,
134 
135  /// Warning log message
136  eLogWarning,
137 
138  /// Plain log message
139  eLogMessage,
140 
141  /// Raw log data
142  eLogRaw,
143 };
144 
145 /// Enumeration of sort order types, currently used by the partitionItems
146 /// method
148 {
149  /// Explicitly chosen no sorting
150  eSortNone,
151 
152  /// Index based sorting
153  eSortIndex,
154 
155  /// Input ordering
157 
158  /// Order by a specific attribute value
160 
161  /// Order by the work item's frame value
162  eSortFrame,
163 };
164 
165 /// Enum of possible work item states
167 {
168  /// Undefined state, e.g. for uninitialized data. Work items should never
169  /// actually have this state
170  eUndefined,
171 
172  /// The item is uncooked and no cooked has been attempted yet
173  eUncooked,
174 
175  /// The item is uncooked and waiting on its dependencies to finish
176  /// cooking
177  eWaiting,
178 
179  /// The item has been sent to the scheduler(s), but might not yet
180  /// be executing
181  eScheduled,
182 
183  /// The item is cooking
184  eCooking,
185 
186  /// The item has finished cooking and succeeded
188 
189  /// The item has was marked as successfully cooked because it a cached
190  /// file was found on disk
191  eCookedCache,
192 
193  /// The item has finished cooking and failed
194  eCookedFail,
195 
196  /// The item has finished cooking by cancellation
198 
199  /// The item was dirty; it may have been cooked before, but not
200  /// necessarily. This is effectively the same as uncooked, but it
201  /// gives an indication that item may need additional cleanup or
202  /// repartitioning.
203  eDirty,
204 
205  /// The number of states
206  eStateCount,
207 };
208 
209 /// Enum of work item types
211 {
212  /// A static or dynamic work item that does real work, and has one
213  /// upstream parent
214  eRegular,
215 
216  /// A batch item, which consists of one or more subitems that are
217  /// Regular type items
218  eBatch,
219 
220  /// A partition, which has a list of upstream components
221  ePartition,
222 };
223 
224 /// Enum of work item runtime types
226 {
227  /// A regular work item, with normal running time
228  eRegular,
229 
230  /// A long running work item that's process may outlive the cooking state
231  /// of the work item
232  eLongRunning,
233 
234  /// A work item that cleans up another long running item
235  eCleanup
236 };
237 
238 /// Enumeration of work item cook types
240 {
241  /// The work item does its processing during the generation stage,
242  /// and doesn't "cook" in the traditional sense.
243  eGenerate,
244 
245  /// The work item cooks in process
246  eInProcess,
247 
248  /// The work item cooks out of process
250 
251  /// The work item cooks as a service
252  eService,
253 
254  /// Unspecified/automatic cook type
255  eAutomatic
256 };
257 
258 /// Enumeration of pending work item dirty states
260 {
261  /// The item does not require any sort of dirtying
262  eNone,
263 
264  /// The item needs to be dirtied, but not deleted
265  eDirty,
266 
267  /// the item needs to be deleted
268  eDelete
269 };
270 
271 #endif /* __PDG_WORK_ITEM_TYPES_H__ */
exint PDG_WorkItemID
Type defs for unique work item IDs.
PDG_BatchActivation
The cache is clean.
Custom service defintion.
Order by a specific attribute value.
int64 exint
Definition: SYS_Types.h:125
The cache state is dirty because an output file is missing on disk.
UT_Optional< fpreal > PDG_OptionalFrame
Optional frame value, used when constructing work items and partitions.
The item needs to be dirtied, but not deleted.
The cache state is dirty because the work item has no files.
PDG_WorkItemEvalState
PDG_WorkItemSortOrder
A regular node – default value.
std::optional< T > UT_Optional
Definition: UT_Optional.h:26
PDG_WorkItemPendingDirty
Enumeration of pending work item dirty states.
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
Explicitly chosen no sorting.
unsigned char uint8
Definition: SYS_Types.h:36
Unspecified/automatic cook type.
PDG_WorkItemType
Enum of work item types.
No error was specified, i.e. the ref is valid.
UT_UniquePtr< PDG_WorkItem > PDG_WorkItemPtr
Work item pointers.
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
PDG_WorkItemState
Enum of possible work item states.
The work item is blocked on a dependency.
The work item cooks out of process.
PDG_WorkItemCookType
Enumeration of work item cook types.
The work item cooks in process.
The batch is scheduled once any of the subitems are ready to cook.
Order by the work item's frame value.
PDG_WorkItemLogType
Enumeration of work item log message types.
PDG_WorkItemCacheState
UT_SharedPtr< PDG_WorkItemData > PDG_WorkItemDataPtr
Type def for registered type objects.
The item has finished cooking by cancellation.
The cache is clean, assuming the parent task is also clean.
The batch is scheduled once the first sub item is ready to cook.
std::pair< PDG_WorkItem *, PDG_WorkItem * > PDG_WorkItemPair
Pair and array of work item pairs.
The work item has a failed dependency.
PDG_WorkItemExecutionType
Enum of work item runtime types.
A work item that cleans up another long running item.
The work item is ready to cook.
the item needs to be deleted
The node is waiting on upstream nodes to make progress.
The number of states.
UT_UniquePtr< PDG_BatchWorkItem > PDG_BatchWorkItemPtr
The node is actively cooking work items.
The item has finished cooking and succeeded.
A partition, which has a list of upstream components.
The item has finished cooking and failed.