10 #define __PDG_NODE_H__
117 bool inclusive)
const;
121 int64 workItemMemory(
bool attribs_only=
false)
const;
138 bool performancePath(
160 {
return mySortOptions; }
164 {
return myNodeStats; }
166 {
return myNodeStats; }
172 {
return myCallback.get(); }
174 { myCallback = callback; }
183 {
return mySchedulerReferences; }
185 { mySchedulerReferences.insert(scheduler); }
187 { mySchedulerReferences.clear(); }
191 {
return myContext; }
195 {
return myLoopDepth; }
199 {
return myLoopResetWhen; }
203 {
return myLoopResetType; }
207 {
return myIsErrorHandler; }
211 {
return myIsErrorHandlerBranch; }
216 myIsErrorHandler = error_handler;
217 myIsErrorHandlerBranch = error_handler;
222 { myIsErrorHandlerBranch = error_handler; }
226 {
return myHasError; }
232 {
return myActiveGenerates.relaxedLoad() > 0; }
238 {
return myIsDynamicEval; }
243 {
return myIsDynamicGen; }
248 {
return myIsDynamicProp; }
253 {
return myCanHaveWorkItems; }
259 {
return myServiceName; }
264 {
return myUseServiceBlock; }
271 {
return myRegenerateReason; }
276 { myRegenerateReason = reason; }
282 if (reason > myRegenerateReason)
283 myRegenerateReason = reason;
288 { myBypassState = state; }
293 if (state > myBypassState)
295 myBypassState = state;
304 {
return myBypassState; }
308 {
return (myBypassState != eBypassNone); }
315 bool isCooked()
const;
319 void dirty(
bool remove_outputs);
342 virtual bool deserializeWorkItem(
PDG_WorkItem* work_item);
364 int reserveIndexBlock(
int number);
382 bool filter_bypassed=
true,
383 bool filter_reference=
true)
const;
387 bool filter_bypassed=
true,
388 bool filter_reference=
true)
const;
391 bool filter_bypassed=
true,
392 bool filter_reference=
true)
const;
393 void connectedAncestors(
396 bool filter_bypassed=
true,
397 bool filter_reference=
true);
413 dependencies()
const;
416 void resolveDependencies();
422 {
return myWorkItems; }
430 template <
typename Filter>
437 for (
auto&& work_item : myWorkItems)
439 if (work_item &&
filter(work_item))
454 bool localize)
const;
457 void queueWorkItemDeps(
484 int addModTimeCacheEntry(
489 bool saveJSON(std::ostream &os,
bool binary);
511 inline
bool isFirstGenerate()
const {
return myIsFirstGenerate; }
516 bool myIsFirstGenerate;
581 {
return myAttributeLock; }
584 {
return &myCanGenerateDep; }
586 {
return &myIsGeneratedDep; }
588 {
return &myIsCookedDep; }
591 {
return &myPropagateGroup; }
596 void resetOwner()
override;
598 virtual int preCookLoop(
600 virtual bool preCook(
bool is_dirty,
bool has_filter);
601 virtual void postCook();
603 virtual void clearAllWorkItems();
610 bool dynamic_inputs);
611 virtual void addInputDeps(
PDG_Node* input_node);
612 virtual void addCommonDeps();
614 virtual bool requiresCookedInputs(
bool cook)
const;
622 void addPropagateDependencies(
629 void queueWorkItemDeps(
647 void updateInputRegeneration();
650 void prepareDirtyAll(
652 bool remove_outputs);
654 bool compactItems(
bool reset_index=
false);
658 bool skip_failed=
false)
const;
659 bool downstreamItems(
662 void clearOutputCache();
663 void updateModTimeCache();
665 template <
typename FieldType,
typename EvalType=FieldType>
670 const FieldType& default_value,
671 bool set_dirty =
true)
673 FieldType field_value = default_value;
675 paramValue(parm_name);
680 port_value->
value(eval_value);
682 (FieldType)(eval_value);
685 if (field == field_value)
689 if (set_dirty && myHasCachedParms)
bool isBypassed() const
Returns true if the node is bypassed.
const UT_StringHolder & serviceName() const
SYS_AtomicCounter myActiveGenerates
PDG_ServiceResetType myLoopResetType
PDG_SortOptions mySortOptions
GLuint GLsizei const GLchar * message
PDGE_Dependency * isCookedDep()
UT_SharedPtr< PDG_NodeCallback > PDG_NodeCallbackPtr
virtual bool queueWorkItem(PDG_WorkItem *work_item)
PDGE_Dependency myIsCookedDep
PDGE_Dependency myIsGeneratedDep
PDG_NodeSubtype
Enumeration of node subtypes.
std::pair< iterator, bool > insert(const value_type &value)
RegenerateReason
Regeneration reasons.
GLuint GLsizei const GLchar * label
RegenerateReason regenerateReason() const
PDG_ServiceResetWhen myLoopResetWhen
UT_Array< PDG_Dependency * > myDependencies
UT_TBBSpinLock myModTimeCacheLock
UT_TBBSpinLock myOutputCacheLock
The node is not bypassed.
The item is uncooked and no cooked has been attempted yet.
PDG_File::Hash myLastStat
PDG_NodeType
Enumeration of node types in a PDG graph.
PDG_ServiceResetWhen loopResetWhen() const
Returns the loop block's service reset conditoon.
bool useServiceBlock() const
void setIsErrorHandlerBranch(bool error_handler)
Sets the error handler branch flag on this node.
const GLuint GLenum const void * binary
TargetedBy
Enumeration of targeting conditions.
State
Evaluation context state.
bool canHaveWorkItems() const
void addSchedulerReference(PDG_Scheduler *scheduler)
void workItemsCopy(PDG_WorkItemArray &array, const Filter &filter) const
PDG_GraphContext * context() const
Returns the graph context that owns the node.
void setBypassState(BypassState state)
Sets the bypassed flag on this node.
bool isGenerating() const
const UT_StringHolder & name() const
Returns the node's unique name.
bool isErrorHandlerBranch() const
Returns true if the node is in an error handler branch.
UT_StringHolder debugName() const override
PDG_NodeOptions myNodeOptions
virtual void addWarning(const UT_StringHolder &message) const
Adds a warning to the node interface – implemented in subclasses.
PDG_SchedulerSet mySchedulerReferences
UT_StringHolder myServiceName
UT_StringMap< ModTimeCacheEntry > myModTimeCache
PDG_WorkItemArray myWorkItems
PDGE_PropagateGroup * propagateGroup()
bool updateBypassState(BypassState state)
Updates the bypass flag of this node, if the new state is higher.
PDG_NodeSet myStaticAncestors
bool isDynamicEval() const
PDG_NodeCallbackPtr myCallback
PDG_NodeStats myNodeStats
void clearSchedulerReferences()
int loopDepth() const
Returns the loop dpeth of the node.
int getId() const
Returns this node's id, it matches the TOP node id.
void updateBuiltinField(PDG_NodeSet &dirty, const UT_StringHolder &parm_name, FieldType &field, const FieldType &default_value, bool set_dirty=true)
const PDG_SortOptions & sortOptions() const
Returns the node's sort options struct.
const PDG_NodeStats & stats() const
Returns the node's stat object.
const PDG_Node * myBeginNode
PDG_NodeArray myExtraInputs
bool isDynamicGeneration() const
int64 Hash
The file hash/modtime type.
RegenerateReason myRegenerateReason
bool isDynamicProp() const
UT_RWLock & attributeLock() const
void value(fpreal &value) const
void setIsErrorHandler(bool error_handler)
Sets the error handler flag on this node.
UT_StringHolder myServiceName
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
PDG_PortType
Enumeration of node port types.
virtual void addError(const UT_StringHolder &message) const
Adds an error to the node interface – implemented in subclasses.
void applyDirty(bool remove_outputs)
Applies the stored dirty operation.
virtual int64 getMemoryUsage(bool inclusive) const
Returns the memory usage of this owner instance.
The node is in a bypassed subnetwork.
GLuint const GLchar * name
virtual Filter & supportedEventTypes() const =0
Returns the list of supported event types for this emitter.
PDG_WorkItemState
Enum of possible work item states.
The node will be dirtied and caches invalidated.
The node will be dirtied.
SYS_AtomicCounter myTotalGenerates
PDG_BatchWorkItemSet myBatchItems
virtual void syncWorkItem(PDG_WorkItem *work_item, const PDG_WorkItem *clone_target)
Syncs data for the work item, using node-specific logic.
Never queue work items in this node for cooking.
BypassState
Bypass state for the node.
PDG_GraphContext * myContext
bool myIsErrorHandlerBranch
BypassState bypassState() const
virtual bool shouldSchedule(const PDG_WorkItem *work_item) const
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
PDGE_Dependency * isGeneratedDep()
bool hasErrors() const
Clears and checks the error flag.
The node should regenerate work items.
PDGE_PropagateGroup myPropagateGroup
void setCallback(PDG_NodeCallbackPtr callback)
UT_TBBSpinLock myWorkItemLock
PDG_ServiceResetWhen
When service clients should be reset.
UT_RWLock myAttributeLock
const PDG_WorkItemArray & workItems() const
PDG_SchedulerSet schedulerReferences() const
void updateRegenerateReason(RegenerateReason reason)
PDG_ServiceResetType myLoopResetType
PDGE_Dependency myCanGenerateDep
PDG_ServiceResetType loopResetType() const
Returns the loop block's service reset type.
PDG_ServiceResetWhen myLoopResetWhen
bool isErrorHandler() const
Returns true if the node is an error handler.
const PDG_NodeCallbackType * myTypeObject
No regeneration necessary.
Reader/Writer mutex class.
void setRegenerateReason(RegenerateReason reason)
PDGE_Dependency * canGenerateDep()
CookWhen
Enumerations of cook conditions.
PDG_Scheduler * myScheduler
BypassState myBypassState
virtual PDG_WorkItemState isOutputCached(PDG_WorkItem *work_item) const
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
PDG_NodeCallback * callback() const
UT_ArrayStringMap< int > myOutputCache