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