HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_Node.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_NODE_H__
10 #define __PDG_NODE_H__
11 
12 #include "PDG_API.h"
13 
14 #include "PDG_EvaluationContext.h"
15 #include "PDG_EventEmitter.h"
16 #include "PDG_EventTypes.h"
17 #include "PDG_File.h"
18 #include "PDG_NodeInterface.h"
19 #include "PDG_NodeOptions.h"
20 #include "PDG_NodeStats.h"
21 #include "PDG_SchedulerTypes.h"
22 #include "PDG_ServiceTypes.h"
23 #include "PDG_SortOptions.h"
24 #include "PDG_WorkItemDirty.h"
25 #include "PDG_WorkItemTypes.h"
26 
27 #include <PDGE/PDGE_Dependency.h>
30 
31 #include <PDGT/PDGT_Value.h>
32 
33 #include <UT/UT_ArrayMap.h>
34 #include <UT/UT_ArrayStringMap.h>
35 #include <UT/UT_NonCopyable.h>
36 #include <UT/UT_RWLock.h>
37 #include <UT/UT_StringArray.h>
38 #include <UT/UT_StringHolder.h>
39 #include <UT/UT_StringMap.h>
40 #include <UT/UT_TBBSpinLock.h>
41 
42 #include <SYS/SYS_AtomicInt.h>
43 
44 class PDG_BatchWorkItem;
45 class PDG_Dependency;
46 class PDG_Filter;
47 class PDG_GraphContext;
48 struct PDG_MemoryInfo;
49 class PDG_NodeCallback;
51 class PDG_Scheduler;
52 class PDG_WorkItemHolder;
53 class PDG_WorkItem;
54 
55 class UT_JSONWriter;
56 
57 /**
58  * Base class for all nodes that keeps track of work items and helper
59  * data structures needed by sub classes. Defines several virtual methods
60  * that are implemented in concrete node subclasses.
61  */
63  public PDG_EventEmitter,
65 {
66 public:
67  /// Bypass state for the node
69  {
70  /// The node is not bypassed
72 
73  /// The node is in a bypassed subnetwork
75 
76  /// The node itself is bypassed
77  eBypassNode
78  };
79 
80 public:
81  PDG_Node(
82  PDG_GraphContext* context,
83  const UT_StringHolder& name,
84  const PDG_NodeCallbackType* type_object,
85  PDG_NodeID id = -1);
86 
87  ~PDG_Node() override;
88 
89  /// Returns the list of supported event types
90  const PDG_EventFilter& supportedEventTypes() const override;
91 
92  /// Returns the total memory usage of the node, including any work items
93  /// owned by it.
94  int64 getMemoryUsage(bool inclusive) const override;
95 
96  /// Returns the memory usage as a PDG_MemoryInfo struct
97  virtual void memoryInfo(PDG_MemoryInfo& memory_info,
98  bool inclusive) const;
99 
100  /// Returns the memory used by all work items in this node. Pass true
101  /// indicate that only attribute data should be counted.
102  int64 workItemMemory(bool attribs_only=false) const;
103 
104 
105  /// Returns this node's id, it matches the TOP node id
106  inline PDG_NodeID getId() const
107  { return myId; }
108 
109  /// Returns the node's unique name
110  const UT_StringHolder& name() const
111  { return myName; }
112 
113  /// Renames the node. No uniqueness validation is done on the new name -
114  /// a unique name should be acquired from the graph.
115  void rename(const UT_StringHolder& new_name);
116 
117  /// Returns the performance event path for the node. Returns true if the
118  /// path already includes work item information.
119  bool performancePath(
121  const UT_StringHolder& event_name,
122  const PDG_WorkItem* work_item) const;
123 
124 
125  /// Returns the node's type object
126  const PDG_NodeCallbackType* typeObject() const;
127 
128  /// Returns the node type, e.g. processor, mapper, etc
129  PDG_NodeType nodeType() const;
130 
131  /// Returns the sub type, e.g. normal, foreach begin, foreach end, etd
132  PDG_NodeSubtype nodeSubtype() const;
133 
134  /// Returns the current state of the node
135  PDG_NodeState nodeState() const;
136 
137  /// Returns the current cook progress of the node
138  fpreal nodeProgress() const;
139 
140  /// Returns the node's info object, which contains cook count and
141  /// description information.
142  const PDG_NodeOptions& nodeOptions(bool do_update);
143 
144  /// Returns the node's sort options struct
146  { return mySortOptions; }
147 
148  /// Returns the node's stat object
149  const PDG_NodeStats& stats() const
150  { return myNodeStats; }
152  { return myNodeStats; }
153 
154  /// Gets/sets the node callback - the underlying object used to implement
155  /// most of the node functionality. Can be a user defined C++ or Python
156  /// instance.
157  inline PDG_NodeCallback* callback() const
158  { return myCallback.get(); }
159  inline void setCallback(PDG_NodeCallbackPtr callback)
160  { myCallback = callback; }
161 
162  /// Gets/sets the per-node scheduler override
163  PDG_Scheduler* scheduler() const;
164  void setScheduler(PDG_Scheduler* scheduler);
165  void removeScheduler(PDG_Scheduler* scheduler);
166 
167  /// Gets/sets schedulers referenced by this node, but not used by it
168  /// directly.
170  { return mySchedulerReferences; }
172  { mySchedulerReferences.insert(scheduler); }
174  { mySchedulerReferences.clear(); }
175 
176  /// Returns the graph context that owns the node
177  inline PDG_GraphContext* context() const
178  { return myContext; }
179 
180  /// Returns the loop dpeth of the node
181  inline int loopDepth() const
182  { return myLoopDepth; }
183 
184  /// Returns the loop block's service reset conditoon
186  { return myLoopResetWhen; }
187 
188  /// Returns the loop block's service reset type
190  { return myLoopResetType; }
191 
192  /// Returns true if the node is an error handler
193  inline bool isErrorHandler() const
194  { return myIsErrorHandler; }
195 
196  /// Returns true if the node is in an error handler branch
197  inline bool isErrorHandlerBranch() const
198  { return myIsErrorHandlerBranch; }
199 
200  /// Sets the error handler flag on this node
201  inline void setIsErrorHandler(bool error_handler)
202  {
203  myIsErrorHandler = error_handler;
204  myIsErrorHandlerBranch = error_handler;
205  }
206 
207  /// Sets the error handler branch flag on this node
208  inline void setIsErrorHandlerBranch(bool error_handler)
209  { myIsErrorHandlerBranch = error_handler; }
210 
211  /// Clears and checks the error flag
212  inline bool hasErrors() const
213  { return myHasError; }
214 
215 
216  /// Returns true if this node is generating. This occurs when the atomic
217  /// generation counter is > 0
218  inline bool isGenerating() const
219  { return myActiveGenerates.relaxedLoad() > 0; }
220 
221  /// Returns true if this node is dynamic for the current evaluation, e.g.
222  /// if it should have the dynamic badge set in the UI. This means either
223  /// this node or an upstream input is dynamic in some way.
224  inline bool isDynamicEval() const
225  { return myIsDynamicEval; }
226 
227  /// Returns true if this node itself is strictly dynamic, i.e. the work item
228  /// generation requires input items to be cooked
229  inline bool isDynamicGeneration() const
230  { return myIsDynamicGen; }
231 
232  /// Returns true if this node should propagate the dynamic generation
233  /// state to downstream processors
234  inline bool isDynamicProp() const
235  { return myIsDynamicProp; }
236 
237  /// Returns true if this node can possibly create work items, based on
238  /// its input configuration
239  inline bool canHaveWorkItems() const
240  { return myCanHaveWorkItems; }
241 
242  /// Returns the name of the service that this node should use to cook
243  /// work items. Returns empty string if no service has been specified
244  /// in the node configuration
246  { return myServiceName; }
247 
248  /// Returns true if the node is inheriting it's service from a parent
249  /// service block.
250  bool useServiceBlock() const
251  { return myUseServiceBlock; }
252 
253  /// Returns true if this node should run its automatic regeneration logic
254  /// on the next cook. If this node has a callback with a custom
255  /// onRegenerate implementation, that will always be run regardless of
256  /// this flag
259  { return myRegenerateReason; }
260 
261  /// Sets the regenerate flag, to be called when the node should consider
262  /// running automatic regeneration logic during the cook
263  inline void setRegenerateReason(
265  { myRegenerateReason = reason; }
266 
267  /// Updates the regenerate flag, but only to mode that's higher in value
268  /// then the current one
271  {
272  if (reason > myRegenerateReason)
273  myRegenerateReason = reason;
274  }
275 
276  /// Sets the bypassed flag on this node
278  { myBypassState = state; }
279 
280  /// Updates the bypass flag of this node, if the new state is higher
282  {
283  if (state > myBypassState)
284  {
285  myBypassState = state;
286  return true;
287  }
288 
289  return false;
290  }
291 
292  // Returns the node's bypassed state
293  inline BypassState bypassState() const
294  { return myBypassState; }
295 
296  /// Returns true if the node is bypassed
297  inline bool isBypassed() const
298  { return (myBypassState != eBypassNone); }
299 
300  /// Returns true if the node is a leaf, i.e it has no descendant nodes
301  bool isLeaf() const;
302 
303  /// Returns true if the node is cooked, i.e. all wrappers and static items
304  /// are cooked.
305  bool isCooked() const;
306 
307 
308  /// Dirties the node by deleting all static and dynamic work items, and
309  /// dirtying (but not deleting) wrappers
310  void dirty(bool remove_outputs);
311 
312  /// Prepares a dirty operation that can be applied later
313  PDG_WorkItemDirty prepareDirty();
314 
315  /// Appends to an existing dirty operation
316  void appendDirty(PDG_WorkItemDirty* dirty_state);
317 
318 
319  /// Freezes all work items in the node and their associated attribute
320  /// data.
321  void freeze();
322 
323  /// Cooks the node. This is a utility method that calls the standard
324  /// cook logic on the the graph context
325  bool cook(bool blocking, UT_WorkBuffer& errors);
326 
327  /// Cancels any work items scheduled by this node
328  void cancel();
329 
330  /// Inserts a work item into the node after it has been deserialized. Based
331  /// on the type of the item, it will be added to the various structures
332  /// (wrapper list, partition maps, etc).
333  virtual void deserializeWorkItem(
334  PDG_WorkItemPtr& work_item);
335 
336  /// Inserts a batch work item into the node after it has been deserialized
337  void deserializeBatchWorkItem(
338  PDG_BatchWorkItemPtr& batch_item);
339 
340  /// Called after a work item is completely deserialized.
341  virtual void commitWorkItem(PDG_WorkItem* work_item);
342 
343  /// Returns the cache state of a work item in this node
344  virtual PDG_WorkItemCacheState
345  outputCacheState(
346  const PDG_WorkItem* work_item) const;
347 
348  /// Reserves a number of work item indices in a contiguous block, and
349  /// returns the first index value.
350  int reserveIndexBlock(int number);
351 
352 
353  /// Returns the node interface/template that describes the default
354  /// parameters and connections for the node
355  const PDG_NodeInterface* templateInterface() const override;
356 
357  /// Adds a custom/spare parameter to the node and returns a pointer to the
358  /// the parameter port.
359  PDG_Port* addCustomParameter(PDGT_Value::DataType type,
360  const UT_StringHolder& name,
361  const UT_StringHolder& label,
362  const UT_StringArray& tags,
363  int size);
364 
365  /// Returns node connectivity information
366  int connectionCount(
368  bool filter_bypassed=true,
369  bool filter_reference=true) const;
370  void connectedNodes(
371  PDG_NodeArray& nodes,
373  bool filter_bypassed=true,
374  bool filter_reference=true) const;
375  PDG_Node* firstConnectedNode(
377  bool filter_bypassed=true,
378  bool filter_reference=true) const;
379  void connectedAncestors(
380  PDG_NodeSet& nodes,
382  bool filter_bypassed=true,
383  bool filter_reference=true);
384 
385  /// Emits a node level error from the node as PDG_Event
386  void addError(
387  const UT_StringHolder& message)
388  const override;
389 
390  /// Emits a node level warning from the node as PDG_Event
391  void addWarning(
392  const UT_StringHolder& message)
393  const override;
394 
395  /// Handler for external dependencies, e.g. files. External dependencies
396  /// that are added to the node will be resolved just before a work item in
397  /// the node is cooked.
399  dependencies() const;
400  void addDependency(PDG_Dependency* dependency);
401  void removeDependency(PDG_Dependency* dependency);
402  void resolveDependencies();
403 
404 
405  /// Returns the underyling work item array. This method is not safe to call
406  /// from external code if a cook or dirty is in progress.
408  { return myWorkItems; }
409 
410  /// Returns the IDs of the work items in the node
411  void workItemIDs(
412  PDG_WorkItemIDArray& array,
413  bool include_batches) const;
414 
415  /// Returns a safe copy of the work item array
416  void workItemsCopy(
417  PDG_WorkItemArray& array,
418  bool include_batches) const;
419 
420  /// Returns a safe copy of the work item array with a filter. The filter
421  /// function is called for each work item, and can return false to indicate
422  /// that the work item shouldn't be included in the copied list
423  template <typename Filter>
425  PDG_WorkItemArray& array,
426  const Filter& filter) const
427  {
429  myWorkItemLock);
430  for (auto&& work_item : myWorkItems)
431  {
432  if (work_item &&
433  filter(work_item.get()))
434  {
435  array.append(work_item.get());
436  }
437  }
438  }
439 
440  /// Returns a safe copy of the batch work item set
441  void batchItemsCopy(
442  PDG_BatchWorkItemArray& batches) const;
443 
444  /// Aggregates output files from all work items. Safe to call from multiple
445  /// threads or during a cook, and will return false/empty result if the
446  /// serial lock cannot be acquired
447  bool outputFiles(PDG_File::Array& files,
448  bool localize) const;
449 
450  /// Builds evaluation dependencies to cook a specific set of work items
451  virtual void queueWorkItemDeps(
452  PDGE_Evaluator& evaluator,
453  PDG_NodeSet& visited_nodes,
454  PDG_WorkItemIDSet& visited_items,
455  PDG_Filter& filter);
456 
457  /// Runs precook logic for this node and recurses into input nodes.
458  bool preCook(PDG_NodeSet& dirty,
459  PDG_NodeSet& visited,
460  bool& save_scene,
461  bool has_filter);
462 
463 
464  /// Sets the loop depth and loop block reference on the node
465  int preCookLoop(PDG_NodeSet& visited);
466 
467 
468  /// Runs postcook logic for this node and recurses into input nodes.
469  void postCook(PDG_NodeSet& visited);
470 
471  /// Adds or updates an existing file cache entry with the specified cache
472  /// id. This will create an entry if one does not yet exist.
473  PDG_CacheID addOutputCacheEntry(const UT_StringHolder& file,
474  PDG_CacheID cache_id);
475 
476  /// Adds or updates the dependent file attribute cache, and returns a new
477  /// cache ID for the work itme based on the entry.
478  PDG_CacheID addModTimeCacheEntry(
479  const PDG_File& file,
480  const PDG_WorkItem* work_item);
481 
482  /// Serializes the work items in the node to the specified stream
483  bool saveJSON(std::ostream &os, bool binary);
484 
485  /// Serializes the work items in the node to the specified file
486  bool saveJSON(const UT_StringHolder& file_path);
487 
488  /// Writes the current parameter value configuration of this node
489  /// interface to JSON
490  bool asJSON(
491  UT_JSONWriter& writer,
492  bool skip_defaults) const;
493 
494  /// Reads and constructs a scheduler from JSON and returns the instance
495  static bool fromJSON(
496  const UT_JSONValue* value,
497  PDG_GraphContext* context,
498  PDG_NodePortMap& inputs,
499  UT_WorkBuffer& errors);
500 
501  /// Queues node dependencies for cooking with the evaluator
502  static void queueNodeDeps(PDGE_Evaluator& evaluator,
503  const PDG_NodeSet& leaf_nodes,
504  const PDG_NodeSet& error_handlers,
505  bool generate_only,
506  bool cook);
507 
508 protected:
509  /// Tracks generation state of the node over a particular scope, using
510  /// a counter since a node can be generating in multiple threads at a
511  /// time.
513  {
514  public:
515  ScopedGenerate(PDG_Node* node);
516  ~ScopedGenerate();
518  inline bool isFirstGenerate() const { return myIsFirstGenerate; }
519 
520  private:
521  PDG_Node* myNode;
522  fpreal myStartTime;
523  bool myIsFirstGenerate;
524  };
525 
526  /// Helper struct for validating and dirtying incomplete loop blocks. Each
527  /// node in a loop is passed a vector of infos for any loops that pass
528  /// through that node, which is usd to set the maximal loop depth and begin
529  /// block list for each node in a block.
530  struct LoopInfo
531  {
537  };
538 
539  /// Helper struct for tracking out of date files in file attributes with
540  /// the `transfer` flag set.
542  {
546  };
547 
548  /// Enumerations of cook conditions
549  enum CookWhen
550  {
551  /// Never queue work items in this node for cooking
553 
554  /// Queue work items in this node once the isGenerated dep reolves --
555  /// these items will cook eventually, but may wait for targeted
556  /// partitioners first.
558 
559  /// Queue work items for cooking immediately after they've been
560  /// generated.
562  };
563 
564  /// Enumeration of targeting conditions
566  {
567  /// No partitioner targets this node
568  eTargetedNone = 0x0,
569 
570  /// A partitioner set to generate when all items in this node are
571  /// generated
572  eTargetedAll = 0x1,
573 
574  /// A partitioner set to generate each time items in this node are
575  /// generated
576  eTargetedEach = 0x2,
577  };
578 
579  /// The key for the node name when writing the node to JSON
581 
582  /// The key for the node type when writing the node to JSON
584 
585  /// The key for the scheduler name when writing the node to JSON
587 
588  /// The key for the input nodes when writing the node to JSON
590 
591  /// The key for the parameters when writing the node to JSON
593 
594 protected:
595  friend class PDG_BatchWorkItem;
596  friend class PDG_Mapper;
597  friend class PDG_Processor;
598  friend class PDG_Partitioner;
599  friend class PDG_WorkItem;
600  friend class PDG_WorkItemDirty;
601 
602  inline UT_RWLock& attributeLock() const
603  { return myAttributeLock; }
604 
606  { return &myCanGenerateDep; }
608  { return &myIsGeneratedDep; }
610  { return &myIsCookedDep; }
611 
613  { return &myPropagateGroup; }
614 
615  UT_StringHolder debugName() const override
616  { return name(); }
617 
618  void resetOwner() override;
619 
620  virtual int preCookLoop(
621  PDG_NodeSet& visited,
622  const UT_Array<LoopInfo>& begin_info);
623  virtual bool preCook(bool is_dirty, bool has_filter);
624  virtual void postCook();
625 
626  virtual void clearAllWorkItems();
627  virtual void clearWorkItem(const PDG_WorkItem* work_item) {}
628  virtual void addWorkItem(PDG_WorkItem* work_item);
629  virtual bool queueWorkItem(PDG_WorkItem* work_item)
630  { return false; }
631  virtual bool syncWorkItem(
632  PDG_WorkItem* work_item,
633  const PDG_WorkItem* parent,
634  const PDG_WorkItem* clone_target)
635  { return false; }
636  virtual bool cookWorkItem(
637  PDGE_Resolutions& resolutions,
638  PDG_WorkItem* work_item,
639  bool did_cook);
640  void removeWorkItems(
641  const PDG_WorkItemConstArray& work_items);
642 
644  { return PDG_WorkItemState::eUncooked; }
645 
646  virtual bool cacheBuiltinParms(
647  PDG_NodeSet& dirty,
648  int num_inputs,
649  bool dynamic_inputs);
650  virtual void addInputDeps(PDG_Node* input_node);
651  virtual void addCommonDeps();
652 
653  virtual bool requiresCookedInputs(bool cook) const;
654 
655  virtual bool shouldSchedule(
656  const PDG_WorkItem* work_item) const
657  { return false; }
658 
659  void injectDynamicWorkItem(
660  PDG_WorkItemPtr& work_item);
661  void addWorkItems(
662  PDG_WorkItemPtrArray& work_items,
663  PDG_BatchWorkItemPtrArray& batches,
665  bool merge_items);
666 
667  void addPropagateDependencies(
668  PDG_WorkItem* work_item);
669  void queueWorkItemResolutions(
670  PDGE_Resolutions& resolutions,
671  PDG_WorkItem* work_item,
672  PDGE_Dependency* can_cook_dep);
673  void queueBatchWorkItemResolutions(
674  PDGE_Resolutions& resolutions,
675  PDG_BatchWorkItem* batch_item,
676  PDGE_Dependency* can_cook_dep);
677 
678  void needsNodeCook(
679  UT_ArrayMap<PDG_Node*, bool>& needs_cook,
680  bool cook);
681  void queueNodeDeps(
682  PDGE_Evaluator& evaluator,
683  const UT_ArrayMap<PDG_Node*, bool>& needs_cook,
684  const PDG_NodeSet& error_handlers,
685  PDG_NodeSet& visited,
686  bool generate_only,
687  bool cook);
688 
689  void updateInputRegeneration();
690 
691  void applyDirty(bool remove_outputs);
692  void prepareDirtyAll(
693  PDG_WorkItemDirty& dirty_state,
694  bool remove_outputs);
695 
696  bool compactItems(bool reset_index=false);
697 
698  bool upstreamItems(
699  PDG_WorkItemArray& work_items,
700  bool skip_failed=false) const;
701  bool downstreamItems(
702  PDG_WorkItemArray& work_items) const;
703 
704  void clearOutputCache();
705  void updateModTimeCache();
706 
707  template <typename FieldType, typename EvalType=FieldType>
709  PDG_NodeSet& dirty,
710  const UT_StringHolder& parm_name,
711  FieldType& field,
712  const FieldType& default_value,
713  bool set_dirty = true)
714  {
715  FieldType field_value = default_value;
716  PDGT_Value* port_value =
717  paramValue(parm_name);
718 
719  if (port_value)
720  {
721  EvalType eval_value;
722  port_value->value(eval_value);
723  field_value =
724  (FieldType)(eval_value);
725  }
726 
727  if (field == field_value)
728  return;
729  field = field_value;
730 
731  if (set_dirty && myHasCachedParms)
732  dirty.insert(this);
733  }
734 
735 protected:
739 
744 
747 
751 
756 
758 
761 
763 
766 
768 
773 
777 
780 
783 
786 
791 
796 
797  mutable bool myHasError;
800 
803 
808 
810 };
811 
812 #endif /* __PDG_NODE_H__ */
static const UT_StringHolder theNameKey
The key for the node name when writing the node to JSON.
Definition: PDG_Node.h:580
bool isBypassed() const
Returns true if the node is bypassed.
Definition: PDG_Node.h:297
const UT_StringHolder & serviceName() const
Definition: PDG_Node.h:245
SYS_AtomicCounter myActiveGenerates
Definition: PDG_Node.h:781
PDG_ServiceResetType myLoopResetType
Definition: PDG_Node.h:534
PDG_SortOptions mySortOptions
Definition: PDG_Node.h:738
GLuint GLsizei const GLchar * message
Definition: glcorearb.h:2543
PDGE_Dependency * isCookedDep()
Definition: PDG_Node.h:609
bool myHasCachedParms
Definition: PDG_Node.h:798
virtual bool queueWorkItem(PDG_WorkItem *work_item)
Definition: PDG_Node.h:629
bool myIsAllGeneration
Definition: PDG_Node.h:795
PDGE_Dependency myIsCookedDep
Definition: PDG_Node.h:742
PDGE_Dependency myIsGeneratedDep
Definition: PDG_Node.h:741
bool myIsErrorHandler
Definition: PDG_Node.h:801
std::pair< iterator, bool > insert(const value_type &value)
Definition: UT_ArraySet.h:1032
void updateRegenerateReason(PDG_NodeRegenerateReason reason)
Definition: PDG_Node.h:269
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2545
bool myHasError
Definition: PDG_Node.h:797
PDG_ServiceResetWhen myLoopResetWhen
Definition: PDG_Node.h:533
UT_Array< PDG_Dependency * > myDependencies
Definition: PDG_Node.h:750
PDG_ServiceResetType
virtual bool syncWorkItem(PDG_WorkItem *work_item, const PDG_WorkItem *parent, const PDG_WorkItem *clone_target)
Definition: PDG_Node.h:631
UT_TBBSpinLock myModTimeCacheLock
Definition: PDG_Node.h:790
UT_TBBSpinLock myOutputCacheLock
Definition: PDG_Node.h:789
The node is not bypassed.
Definition: PDG_Node.h:71
PDG_File::Hash myLastStat
Definition: PDG_Node.h:544
PDG_ServiceResetWhen loopResetWhen() const
Returns the loop block's service reset conditoon.
Definition: PDG_Node.h:185
bool myIsGenerated
Definition: PDG_Node.h:804
GLsizei const GLfloat * value
Definition: glcorearb.h:824
bool useServiceBlock() const
Definition: PDG_Node.h:250
void setIsErrorHandlerBranch(bool error_handler)
Sets the error handler branch flag on this node.
Definition: PDG_Node.h:208
const GLuint GLenum const void * binary
Definition: glcorearb.h:1924
PDG_BatchWorkItemPtrArray myBatchItems
Definition: PDG_Node.h:746
#define PDG_API
Definition: PDG_API.h:23
TargetedBy
Enumeration of targeting conditions.
Definition: PDG_Node.h:565
State
Evaluation context state.
The item is uncooked and no cooked has been attempted yet.
bool canHaveWorkItems() const
Definition: PDG_Node.h:239
int myLoopDepth
Definition: PDG_Node.h:770
void addSchedulerReference(PDG_Scheduler *scheduler)
Definition: PDG_Node.h:171
void workItemsCopy(PDG_WorkItemArray &array, const Filter &filter) const
Definition: PDG_Node.h:424
bool myIsCooked
Definition: PDG_Node.h:806
PDG_WorkItemPtrArray myWorkItems
Definition: PDG_Node.h:745
PDG_GraphContext * context() const
Returns the graph context that owns the node.
Definition: PDG_Node.h:177
void setBypassState(BypassState state)
Sets the bypassed flag on this node.
Definition: PDG_Node.h:277
bool isGenerating() const
Definition: PDG_Node.h:218
const UT_StringHolder & name() const
Returns the node's unique name.
Definition: PDG_Node.h:110
const PDG_SchedulerSet & schedulerReferences() const
Definition: PDG_Node.h:169
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:39
bool isErrorHandlerBranch() const
Returns true if the node is in an error handler branch.
Definition: PDG_Node.h:197
UT_StringHolder debugName() const override
Definition: PDG_Node.h:615
PDG_NodeOptions myNodeOptions
Definition: PDG_Node.h:736
Definition: PDG_Node.h:541
virtual void addWarning(const UT_StringHolder &message) const
Adds a warning to the node interface – implemented in subclasses.
PDG_SchedulerSet mySchedulerReferences
Definition: PDG_Node.h:765
bool myIsActive
Definition: PDG_Node.h:805
UT_StringHolder myServiceName
Definition: PDG_Node.h:767
UT_StringMap< ModTimeCacheEntry > myModTimeCache
Definition: PDG_Node.h:755
GLuint buffer
Definition: glcorearb.h:660
int myInputFilter
Definition: PDG_Node.h:772
UT_StringHolder myName
Definition: PDG_Node.h:757
PDGE_PropagateGroup * propagateGroup()
Definition: PDG_Node.h:612
bool updateBypassState(BypassState state)
Updates the bypass flag of this node, if the new state is higher.
Definition: PDG_Node.h:281
bool myIsDynamicEval
Definition: PDG_Node.h:793
PDG_NodeSet myStaticAncestors
Definition: PDG_Node.h:748
bool isDynamicEval() const
Definition: PDG_Node.h:224
PDG_NodeCallbackPtr myCallback
Definition: PDG_Node.h:759
PDG_NodeStats myNodeStats
Definition: PDG_Node.h:737
void clearSchedulerReferences()
Definition: PDG_Node.h:173
PDG_NodeType
Enumeration of node types in a PDG graph.
Definition: PDG_NodeTypes.h:95
PDG_NodeID myId
Definition: PDG_Node.h:784
int loopDepth() const
Returns the loop dpeth of the node.
Definition: PDG_Node.h:181
void updateBuiltinField(PDG_NodeSet &dirty, const UT_StringHolder &parm_name, FieldType &field, const FieldType &default_value, bool set_dirty=true)
Definition: PDG_Node.h:708
const PDG_SortOptions & sortOptions() const
Returns the node's sort options struct.
Definition: PDG_Node.h:145
const PDG_NodeStats & stats() const
Returns the node's stat object.
Definition: PDG_Node.h:149
virtual void clearWorkItem(const PDG_WorkItem *work_item)
Definition: PDG_Node.h:627
UT_SharedPtr< PDG_NodeCallback > PDG_NodeCallbackPtr
Definition: PDG_NodeTypes.h:26
PDG_NodeStats & stats()
Definition: PDG_Node.h:151
int myTargetedBy
Definition: PDG_Node.h:769
const PDG_Node * myBeginNode
Definition: PDG_Node.h:535
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
PDG_NodeArray myExtraInputs
Definition: PDG_Node.h:749
bool isDynamicGeneration() const
Definition: PDG_Node.h:229
int64 Hash
The file hash/modtime type.
Definition: PDG_File.h:39
UT_UniquePtr< PDG_WorkItem > PDG_WorkItemPtr
Work item pointers.
bool myIsDynamicProp
Definition: PDG_Node.h:794
bool isDynamicProp() const
Definition: PDG_Node.h:234
UT_RWLock & attributeLock() const
Definition: PDG_Node.h:602
PDG_NodeID getId() const
Returns this node's id, it matches the TOP node id.
Definition: PDG_Node.h:106
void value(fpreal &value) const
void setIsErrorHandler(bool error_handler)
Sets the error handler flag on this node.
Definition: PDG_Node.h:201
PDG_WorkItemState
Enum of possible work item states.
static const UT_StringHolder theParametersKey
The key for the parameters when writing the node to JSON.
Definition: PDG_Node.h:592
static const UT_StringHolder theSchedulerKey
The key for the scheduler name when writing the node to JSON.
Definition: PDG_Node.h:586
PDG_File myFile
Definition: PDG_Node.h:543
UT_StringHolder myServiceName
Definition: PDG_Node.h:532
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
PDG_ServiceResetWhen
When service clients should be reset.
virtual void addError(const UT_StringHolder &message) const
Adds an error to the node interface – implemented in subclasses.
virtual PDG_WorkItemState updateOutputCache(PDG_WorkItem *work_item) const
Definition: PDG_Node.h:643
long long int64
Definition: SYS_Types.h:116
PDG_NodeState
Node state, used for UI/progress reporting.
Definition: PDG_NodeTypes.h:68
PDG_NodeRegenerateReason myRegenerateReason
Definition: PDG_Node.h:775
void applyDirty(bool remove_outputs)
Applies the stored dirty operation.
bool myCanHaveWorkItems
Definition: PDG_Node.h:799
virtual int64 getMemoryUsage(bool inclusive) const
Returns the memory usage of this owner instance.
bool myIsFrozen
Definition: PDG_Node.h:807
The node is in a bypassed subnetwork.
Definition: PDG_Node.h:74
GLuint const GLchar * name
Definition: glcorearb.h:786
virtual const PDG_NodeInterface * templateInterface() const
SYS_AtomicCounter myTotalGenerates
Definition: PDG_Node.h:782
static const UT_StringHolder theInputsKey
The key for the input nodes when writing the node to JSON.
Definition: PDG_Node.h:589
exint append()
Definition: UT_Array.h:142
bool myUseServiceBlock
Definition: PDG_Node.h:809
Never queue work items in this node for cooking.
Definition: PDG_Node.h:552
BypassState
Bypass state for the node.
Definition: PDG_Node.h:68
PDG_WorkItemCacheState
PDG_GraphContext * myContext
Definition: PDG_Node.h:762
bool myIsErrorHandlerBranch
Definition: PDG_Node.h:802
GLsizeiptr size
Definition: glcorearb.h:664
PDG_NodeRegenerateReason
BypassState bypassState() const
Definition: PDG_Node.h:293
virtual bool shouldSchedule(const PDG_WorkItem *work_item) const
Definition: PDG_Node.h:655
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
PDGE_Dependency * isGeneratedDep()
Definition: PDG_Node.h:607
bool hasErrors() const
Clears and checks the error flag.
Definition: PDG_Node.h:212
fpreal64 fpreal
Definition: SYS_Types.h:283
PDGE_PropagateGroup myPropagateGroup
Definition: PDG_Node.h:743
int PDG_NodeID
Node ID type.
Definition: PDG_NodeTypes.h:29
int myMaxIndex
Definition: PDG_Node.h:785
void setCallback(PDG_NodeCallbackPtr callback)
Definition: PDG_Node.h:159
UT_TBBSpinLock myWorkItemLock
Definition: PDG_Node.h:788
bool myIsDynamicGen
Definition: PDG_Node.h:792
UT_RWLock myAttributeLock
Definition: PDG_Node.h:787
Class to store JSON objects as C++ objects.
Definition: UT_JSONValue.h:99
PDG_NodeSubtype
Enumeration of node subtypes.
PDG_ServiceResetType myLoopResetType
Definition: PDG_Node.h:779
void setRegenerateReason(PDG_NodeRegenerateReason reason)
Definition: PDG_Node.h:263
PDGE_Dependency myCanGenerateDep
Definition: PDG_Node.h:740
PDG_ServiceResetType loopResetType() const
Returns the loop block's service reset type.
Definition: PDG_Node.h:189
PDG_CacheID myCacheId
Definition: PDG_Node.h:545
PDG_NodeRegenerateReason regenerateReason() const
Definition: PDG_Node.h:258
const PDG_WorkItemPtrArray & workItems() const
Definition: PDG_Node.h:407
PDG_ServiceResetWhen myLoopResetWhen
Definition: PDG_Node.h:778
bool isErrorHandler() const
Returns true if the node is an error handler.
Definition: PDG_Node.h:193
const PDG_NodeCallbackType * myTypeObject
Definition: PDG_Node.h:760
int myLoopBeginDepth
Definition: PDG_Node.h:771
Reader/Writer mutex class.
Definition: UT_RWLock.h:48
PDGE_Dependency * canGenerateDep()
Definition: PDG_Node.h:605
UT_UniquePtr< PDG_BatchWorkItem > PDG_BatchWorkItemPtr
state
Definition: core.h:2289
CookWhen
Enumerations of cook conditions.
Definition: PDG_Node.h:549
PDG_Scheduler * myScheduler
Definition: PDG_Node.h:764
BypassState myBypassState
Definition: PDG_Node.h:776
static const UT_StringHolder theTypeKey
The key for the node type when writing the node to JSON.
Definition: PDG_Node.h:583
UT_ArrayStringMap< PDG_CacheID > myOutputCache
Definition: PDG_Node.h:753
CookWhen myCookWhen
Definition: PDG_Node.h:774
PDG_PortType
Enumeration of node port types.
virtual const PDG_EventFilter & supportedEventTypes() const =0
Returns the list of supported event types for this emitter.
int PDG_CacheID
Definition: PDG_NodeTypes.h:30
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1297
PDG_NodeCallback * callback() const
Definition: PDG_Node.h:157