10 #define __PDG_NODE_H__
138 bool inclusive)
const;
142 int64 workItemMemory(
bool attribs_only=
false)
const;
159 bool performancePath(
178 fpreal nodeProgress()
const;
186 {
return mySortOptions; }
190 {
return myNodeStats; }
192 {
return myNodeStats; }
198 {
return myCallback.get(); }
200 { myCallback = callback; }
209 {
return mySchedulerReferences; }
211 { mySchedulerReferences.insert(scheduler); }
213 { mySchedulerReferences.clear(); }
217 {
return myContext; }
221 {
return myLoopDepth; }
225 {
return myLoopResetWhen; }
229 {
return myLoopResetType; }
233 {
return myIsErrorHandler; }
237 {
return myIsErrorHandlerBranch; }
242 myIsErrorHandler = error_handler;
243 myIsErrorHandlerBranch = error_handler;
248 { myIsErrorHandlerBranch = error_handler; }
252 {
return myHasError; }
258 {
return myActiveGenerates.relaxedLoad() > 0; }
264 {
return myIsDynamicEval; }
269 {
return myIsDynamicGen; }
274 {
return myIsDynamicProp; }
279 {
return myCanHaveWorkItems; }
285 {
return myServiceName; }
290 {
return myUseServiceBlock; }
297 {
return myRegenerateReason; }
302 { myRegenerateReason = reason; }
308 if (reason > myRegenerateReason)
309 myRegenerateReason = reason;
314 { myBypassState = state; }
319 if (state > myBypassState)
321 myBypassState = state;
330 {
return myBypassState; }
334 {
return (myBypassState != eBypassNone); }
341 bool isCooked()
const;
346 void dirty(
bool remove_outputs);
372 virtual bool deserializeWorkItem(
PDG_WorkItem* work_item);
387 int reserveIndexBlock(
int number);
405 bool filter_bypassed=
true,
406 bool filter_reference=
true)
const;
410 bool filter_bypassed=
true,
411 bool filter_reference=
true)
const;
414 bool filter_bypassed=
true,
415 bool filter_reference=
true)
const;
416 void connectedAncestors(
419 bool filter_bypassed=
true,
420 bool filter_reference=
true);
436 dependencies()
const;
439 void resolveDependencies();
445 {
return myWorkItems; }
450 bool include_batches)
const;
455 bool include_batches)
const;
460 template <
typename Filter>
467 for (
auto&& work_item : myWorkItems)
469 if (work_item &&
filter(work_item))
478 void removeWorkItems(
485 bool localize)
const;
488 virtual void queueWorkItemDeps(
520 bool saveJSON(std::ostream &os,
bool binary);
529 bool skip_defaults)
const;
532 static bool fromJSON(
555 inline
bool isFirstGenerate()
const {
return myIsFirstGenerate; }
560 bool myIsFirstGenerate;
625 {
return myAttributeLock; }
628 {
return &myCanGenerateDep; }
630 {
return &myIsGeneratedDep; }
632 {
return &myIsCookedDep; }
635 {
return &myPropagateGroup; }
640 void resetOwner()
override;
642 virtual int preCookLoop(
644 virtual bool preCook(
bool is_dirty,
bool has_filter);
645 virtual void postCook();
647 virtual void clearAllWorkItems();
648 virtual void clearWorkItem(
const PDG_WorkItem* work_item);
655 virtual bool cookWorkItem(
664 bool dynamic_inputs);
665 virtual void addInputDeps(
PDG_Node* input_node);
666 virtual void addCommonDeps();
668 virtual bool requiresCookedInputs(
bool cook)
const;
676 void addPropagateDependencies(
684 void queueWorkItemResolutions(
688 void queueBatchWorkItemResolutions(
705 void updateInputRegeneration();
708 void prepareDirtyAll(
710 bool remove_outputs);
712 bool compactItems(
bool reset_index=
false);
716 bool skip_failed=
false)
const;
717 bool downstreamItems(
720 void clearOutputCache();
721 void updateModTimeCache();
723 template <
typename FieldType,
typename EvalType=FieldType>
728 const FieldType& default_value,
729 bool set_dirty =
true)
731 FieldType field_value = default_value;
733 paramValue(parm_name);
738 port_value->
value(eval_value);
740 (FieldType)(eval_value);
743 if (field == field_value)
747 if (set_dirty && myHasCachedParms)
static const UT_StringHolder theNameKey
The key for the node name when writing the node to JSON.
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()
virtual bool queueWorkItem(PDG_WorkItem *work_item)
PDGE_Dependency myIsCookedDep
PDGE_Dependency myIsGeneratedDep
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.
PDG_File::Hash myLastStat
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.
The item is uncooked and no cooked has been attempted yet.
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.
const PDG_SchedulerSet & schedulerReferences() const
Class which writes ASCII or binary JSON streams.
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()
PDG_NodeType
Enumeration of node types in a PDG graph.
int loopDepth() const
Returns the loop dpeth of the node.
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.
UT_SharedPtr< PDG_NodeCallback > PDG_NodeCallbackPtr
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
PDG_NodeID getId() const
Returns this node's id, it matches the TOP node id.
void value(fpreal &value) const
void setIsErrorHandler(bool error_handler)
Sets the error handler flag on this node.
PDG_WorkItemState
Enum of possible work item states.
static const UT_StringHolder theParametersKey
The key for the parameters when writing the node to JSON.
static const UT_StringHolder theSchedulerKey
The key for the scheduler name when writing the node to JSON.
UT_StringHolder myServiceName
#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
PDG_NodeState
Node state, used for UI/progress reporting.
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 const PDG_NodeInterface * templateInterface() const
The node will be dirtied and caches invalidated.
The node will be dirtied.
SYS_AtomicCounter myTotalGenerates
static const UT_StringHolder theInputsKey
The key for the input nodes when writing the node to JSON.
PDG_BatchWorkItemSet myBatchItems
Never queue work items in this node for cooking.
virtual bool syncWorkItem(PDG_WorkItem *work_item, const PDG_WorkItem *clone_target)
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
int PDG_NodeID
Node ID type.
void setCallback(PDG_NodeCallbackPtr callback)
UT_TBBSpinLock myWorkItemLock
UT_RWLock myAttributeLock
Class to store JSON objects as C++ objects.
const PDG_WorkItemArray & workItems() const
PDG_NodeSubtype
Enumeration of node subtypes.
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
static const UT_StringHolder theTypeKey
The key for the node type when writing the node to JSON.
UT_ArrayStringMap< PDG_CacheID > myOutputCache
PDG_PortType
Enumeration of node port types.
virtual const PDG_EventFilter & supportedEventTypes() const =0
Returns the list of supported event types for this emitter.
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
PDG_NodeCallback * callback() const