HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_Processor Class Reference

#include <PDG_Processor.h>

+ Inheritance diagram for PDG_Processor:

Public Types

enum  PriorityType { ePriorityInherit, ePriorityExpression, ePriorityNode }
 Prioritization schemes that node can use when generating work items. More...
 
enum  LabelType { eLabelDefault, eLabelInherit, eLabelCustom, eLabelNode }
 Labeling scheme that node can use when generating work item. More...
 
enum  CacheMode { eCacheAutomatic, eCacheAlwaysRead, eCacheAlwaysWrite, eCacheAutomaticIgnore }
 
enum  GenerateWhen { eEachInputCooked, eAllInputsGenerated, eAutomaticGeneration, eAllInputsCooked }
 Enumeration of generation conditions. More...
 
- Public Types inherited from PDG_Node
enum  RegenerateReason {
  eRegenerateNone, eRegenerateAlways, eRegenerateFull, eRegeneratePropagate,
  eRegenerateDirty, eRegenerateDirtyInvalidate
}
 Regeneration reasons. More...
 
enum  BypassState { eBypassNone, eBypassSubnetwork, eBypassNode }
 Bypass state for the node. More...
 
- Public Types inherited from PDG_NodeInterface
using ParameterGroupArray = UT_Array< ParameterGroup >
 
using DependencyArray = UT_Array< AutoFileDependency >
 
- Public Types inherited from PDG_EventEmitter
using Filter = UT_ValArray< PDG_EventType >
 
using FilterMap = UT_ArrayMap< PDG_EventHandler *, Filter >
 
using HandlerSet = UT_ArraySet< PDG_EventHandler * >
 
using HandlerArray = UT_Array< PDG_EventHandler * >
 
- Public Types inherited from PDGE_DependencyOwner
using Array = UT_Array< PDGE_DependencyOwner * >
 
using Set = UT_ArraySet< PDGE_DependencyOwner * >
 

Public Member Functions

 PDG_Processor (PDG_GraphContext *context, const UT_StringHolder &name, const PDG_NodeCallbackType *type_object, int custom_id=-1)
 
 ~PDG_Processor () override
 
void memoryInfo (PDG_MemoryInfo &memory_info, bool inclusive) const override
 
PriorityType prioritizeBy () const
 
PDG_WorkItemCookType cookType () const
 Returns the cook type for work items created by this node. More...
 
bool useServices () const
 
PDG_ServiceResetWhen serviceResetWhen () const
 Returns the condition when this node resets service clients. More...
 
PDG_ServiceResetType serviceResetType () const
 Returns the reset type for service clients used by this node. More...
 
UT_UniquePtr< PDG_WorkItemHolderworkItemHolder ()
 
void injectStaticItems (PDG_WorkItemHolder &holder, bool compact_items, bool sort_items)
 
void resetOwner () override
 Resets this dependency owner. More...
 
int itemPriority (const PDG_WorkItem *work_item, PriorityType priority_type) const
 Returns the priority for the specified work item. More...
 
bool deserializeWorkItem (PDG_WorkItem *work_item) override
 
void commitWorkItem (PDG_WorkItem *work_item) override
 Called after deserializing a work item and adding its dependencies. More...
 
void syncWorkItem (PDG_WorkItem *work_item, const PDG_WorkItem *clone_target) override
 Syncs data for the work item, using node-specific logic. More...
 
PDG_WorkItemState isOutputCached (PDG_WorkItem *work_item) const override
 
- Public Member Functions inherited from PDG_Node
 PDG_Node (PDG_GraphContext *context, const UT_StringHolder &name, const PDG_NodeCallbackType *type_object, int id=-1)
 
 ~PDG_Node () override
 
PDG_EventEmitter::FiltersupportedEventTypes () const override
 Returns the list of supported event types. More...
 
int64 getMemoryUsage (bool inclusive) const override
 
int64 workItemMemory (bool attribs_only=false) const
 
int getId () const
 Returns this node's id, it matches the TOP node id. More...
 
const UT_StringHoldername () const
 Returns the node's unique name. More...
 
void rename (const UT_StringHolder &new_name)
 
bool performancePath (UT_WorkBuffer &buffer, const UT_StringHolder &event_name, const PDG_WorkItem *work_item) const
 
const PDG_NodeCallbackTypetypeObject () const
 Returns the node's type object. More...
 
PDG_NodeType nodeType () const
 Returns the node type, e.g. processor, mapper, etc. More...
 
PDG_NodeSubtype nodeSubtype () const
 Returns the sub type, e.g. normal, foreach begin, foreach end, etd. More...
 
const PDG_NodeOptionsnodeOptions (bool do_update)
 
const PDG_SortOptionssortOptions () const
 Returns the node's sort options struct. More...
 
const PDG_NodeStatsstats () const
 Returns the node's stat object. More...
 
PDG_NodeStatsstats ()
 
PDG_NodeCallbackcallback () const
 
void setCallback (PDG_NodeCallbackPtr callback)
 
PDG_Schedulerscheduler () const
 Gets/sets the per-node scheduler override. More...
 
void setScheduler (PDG_Scheduler *scheduler)
 
PDG_SchedulerSet schedulerReferences () const
 
void addSchedulerReference (PDG_Scheduler *scheduler)
 
void clearSchedulerReferences ()
 
PDG_GraphContextcontext () const
 Returns the graph context that owns the node. More...
 
int loopDepth () const
 Returns the loop dpeth of the node. More...
 
PDG_ServiceResetWhen loopResetWhen () const
 Returns the loop block's service reset conditoon. More...
 
PDG_ServiceResetType loopResetType () const
 Returns the loop block's service reset type. More...
 
bool isErrorHandler () const
 Returns true if the node is an error handler. More...
 
bool isErrorHandlerBranch () const
 Returns true if the node is in an error handler branch. More...
 
void setIsErrorHandler (bool error_handler)
 Sets the error handler flag on this node. More...
 
void setIsErrorHandlerBranch (bool error_handler)
 Sets the error handler branch flag on this node. More...
 
bool hasErrors () const
 Clears and checks the error flag. More...
 
bool isGenerating () const
 
bool isDynamicEval () const
 
bool isDynamicGeneration () const
 
bool isDynamicProp () const
 
bool canHaveWorkItems () const
 
const UT_StringHolderserviceName () const
 
bool useServiceBlock () const
 
RegenerateReason regenerateReason () const
 
void setRegenerateReason (RegenerateReason reason)
 
void updateRegenerateReason (RegenerateReason reason)
 
void setBypassState (BypassState state)
 Sets the bypassed flag on this node. More...
 
bool updateBypassState (BypassState state)
 Updates the bypass flag of this node, if the new state is higher. More...
 
BypassState bypassState () const
 
bool isBypassed () const
 Returns true if the node is bypassed. More...
 
bool isLeaf () const
 Returns true if the node is a leaf, i.e it has no descendant nodes. More...
 
bool isCooked () const
 
void dirty (bool remove_outputs)
 
PDG_WorkItemDirty prepareDirty ()
 Prepares a dirty operation that can be applied later. More...
 
void freeze ()
 
void freezeFrom (const PDG_WorkItemArray &work_items)
 Sets the work items in the node from the input list and freezes them. More...
 
bool cook (bool blocking, UT_WorkBuffer &errors)
 
void cancel ()
 Cancels any work items scheduled by this node. More...
 
virtual bool cookWorkItem (PDGE_Resolutions &resolutions, PDG_WorkItem *work_item, bool did_cook)
 Notifies the node that the specified work item has been cooked. More...
 
int reserveIndexBlock (int number)
 
const PDG_NodeInterfacetemplateInterface () const
 
PDG_PortaddCustomParameter (PDGT_Value::DataType type, const UT_StringHolder &name, const UT_StringHolder &label, const UT_StringArray &tags, int size)
 
int connectionCount (PDG_PortType type, bool filter_bypassed=true, bool filter_reference=true) const
 Returns node connectivity information. More...
 
void connectedNodes (PDG_NodeArray &nodes, PDG_PortType type, bool filter_bypassed=true, bool filter_reference=true) const
 
PDG_NodefirstConnectedNode (PDG_PortType type, bool filter_bypassed=true, bool filter_reference=true) const
 
void connectedAncestors (PDG_NodeSet &nodes, PDG_PortType type, bool filter_bypassed=true, bool filter_reference=true)
 
void addError (const UT_StringHolder &message) const override
 Emits a node level error from the node as PDG_Event. More...
 
void addWarning (const UT_StringHolder &message) const override
 Emits a node level warning from the node as PDG_Event. More...
 
const UT_Array< PDG_Dependency * > & dependencies () const
 
void addDependency (PDG_Dependency *dependency)
 
void removeDependency (PDG_Dependency *dependency)
 
void resolveDependencies ()
 
const PDG_WorkItemArrayworkItems () const
 
void workItemsCopy (PDG_WorkItemArray &array) const
 Returns a safe copy of the work item array. More...
 
template<typename Filter >
void workItemsCopy (PDG_WorkItemArray &array, const Filter &filter) const
 
void batchItemsCopy (PDG_BatchWorkItemSet &set) const
 Returns a safe copy of the batch work item set. More...
 
void removeItem (PDG_WorkItem *work_item)
 Removes a work item from the node. More...
 
bool outputFiles (PDG_File::Array &files, bool localize) const
 
void queueWorkItemDeps (PDGE_Evaluator &evaluator, PDG_NodeSet &visited_nodes, PDG_WorkItemSet &visited_items, PDG_Filter &filter)
 Builds evaluation dependencies to cook a specific set of work items. More...
 
bool preCook (PDG_NodeSet &dirty, PDG_NodeSet &visited, bool &save_scene, bool has_filter)
 Runs precook logic for this node and recurses into input nodes. More...
 
int preCookLoop ()
 Sets the loop depth and loop block reference on the node. More...
 
void postCook (PDG_NodeSet &visited)
 Runs postcook logic for this node and recurses into input nodes. More...
 
int addOutputCacheEntry (const UT_StringHolder &file, int cache_id)
 
int addModTimeCacheEntry (const PDG_File &file, const PDG_WorkItem *work_item)
 
bool saveJSON (std::ostream &os, bool binary)
 Serializes the work items in the node to the specified stream. More...
 
bool saveJSON (const UT_StringHolder &file_path)
 Serializes the work items in the node to the specified file. More...
 
- Public Member Functions inherited from PDG_NodeInterface
 PDG_NodeInterface (UT_StringHolder name="", UT_StringHolder data_type="")
 
virtual ~PDG_NodeInterface ()
 
int64 getMemoryUsage (bool inclusive) const
 
void cloneFrom (const PDG_NodeInterface &interface)
 
void addBuiltinPorts (PDG_NodeType type, PDG_NodeSubtype sub_type)
 Adds builtin ports for the specified node type and subtype. More...
 
PDG_WorkItemDataTypeworkItemDataType ()
 Queries the work item data type associated with this node. More...
 
const PDG_WorkItemDataTypeworkItemDataType () const
 
bool resolveWorkItemDataType (UT_WorkBuffer &errors)
 Resolves and caches the work item data type. More...
 
const PDG_PortArrayports (PDG_PortType type) const
 Returns the list of all ports of the specified type. More...
 
const PDG_PortArrayinputPorts () const
 
const PDG_PortArrayoutputPorts () const
 
const PDG_PortArrayparameters () const
 
const ParameterGroupArrayparameterGroups () const
 Returns the list of parameter groups for the node. More...
 
bool parametersForTag (const UT_StringHolder &tag, PDG_PortArray &parameters) const
 Returns the list of parameters with the specified tag. More...
 
const PDG_PortArraycustomParameters () const
 Returns the list of custom parameter ports. More...
 
PDG_Portport (PDG_PortType type, int index) const
 
PDG_Portport (PDG_PortType type, const UT_StringHolder &name) const
 
PDG_Portport (const UT_StringHolder &name) const
 
PDG_PortinputPort (int index) const
 Specialized functions for finding input ports by name or index. More...
 
PDG_PortinputPort (const UT_StringHolder &name) const
 
bool inputPortsForNode (PDG_Node *node, PDG_PortArray &ports) const
 
bool inputPortsForWorkItem (const PDG_WorkItem *work_item, PDG_PortArray &ports) const
 
bool isWorkItemFromInputPort (const PDG_WorkItem *work_item, const UT_StringHolder &name) const
 
PDG_PortoutputPort (int index) const
 Sepcialized functions for finding output ports by name or index. More...
 
PDG_PortoutputPort (const UT_StringHolder &name) const
 
PDG_Portparameter (const UT_StringHolder &name, int multi=-1) const
 
PDGT_ValueparamValue (const UT_StringHolder &name, int index=0) const
 
PDGT_ValuedefaultParamValue (const UT_StringHolder &name, int index=0) const
 
int portCount (PDG_PortType type) const
 
int inputCount () const
 
int outputCount () const
 
int parameterCount () const
 
bool hasUnorderedPorts () const
 
int numOrderedPorts () const
 
PDG_PortaddPort (PDG_PortType type, const PDG_WorkItemDataType *data_type, const UT_StringHolder &name, const UT_StringHolder &label, const UT_StringArray &tags=UT_StringArray(), int size=0, bool ordered=true, bool custom=false)
 
PDG_PortaddParameter (PDGT_Value::DataType data_type, const UT_StringHolder &name, const UT_StringHolder &label, const UT_StringArray &tags, int size=1, bool custom=false)
 
PDG_PortaddParameter (PDGT_Value::DataType data_type, const UT_StringHolder &name, const UT_StringHolder &label, int size=1, bool custom=false)
 Adds a parameter with a data type, name, label and optional size. More...
 
bool removeParameter (const UT_StringHolder &name)
 
void addFileDependency (const UT_StringHolder &file_path)
 Adds a new file dependency to the node interface. More...
 
void addParameterGroup (const UT_StringHolder &name, bool root=true, bool multiparm=false)
 Adds a new parameter group to the node interface. More...
 
void endParameterGroup ()
 Ends the current parameter group. More...
 
const UT_StringHoldertemplateName () const
 
bool isValid () const
 Returns true if the node interface is valid. More...
 
const DependencyArrayautoDependencies () const
 Returns the list of external files that this node depends on. More...
 
const PDG_Port::ExpressionVarscommonVars () const
 
PDG_ApplicationShim::NodeappNode () const
 
template<typename T , typename... Args>
void setAppNode (Args &&...args)
 Sets the underlying app node. More...
 
const PDG_AttributeInfoattributeInfo () const
 
void setAttributeInfo (const PDG_AttributeInfo &info)
 Clears and sets the attribute info for this interface. More...
 
const PDG_JobScriptInfoscriptInfo () const
 Returns the script info for this node interface. More...
 
void setScriptInfo (const PDG_JobScriptInfo &info)
 Sets the script info for the interface. More...
 
void setServiceCompatibility (const UT_StringHolder &service_type_name, bool compatible)
 
template<typename... Args>
void addErrorFmt (const char *fmt, Args &&...args) const
 Adds an error using a format string, instead of plain string. More...
 
template<typename... Args>
void addWarningFmt (const char *fmt, Args &&...args) const
 Adds a warning using a format string, instead of plain string. More...
 
template<typename T >
bool evaluate (T &result, const UT_StringHolder &name, const PDG_WorkItem *work_item=nullptr, int index=0, int multi=-1) const
 Evaluates a parameter and reports errors if desired. More...
 
bool evaluateRaw (UT_StringHolder &result, const UT_StringHolder &name, const PDG_WorkItem *work_item=nullptr, int index=0, int multi=-1) const
 
template<typename T >
bool evaluateArray (T &result, const UT_StringHolder &name, const PDG_WorkItem *work_item=nullptr, int multi=-1) const
 Evaluates a parameter as an array and reports errors if desired. More...
 
- Public Member Functions inherited from PDG_EventEmitter
 PDG_EventEmitter (PDG_EventQueue *eventQueue, bool block_destruction)
 
virtual ~PDG_EventEmitter ()
 
int64 getMemoryUsage (bool inclusive) const
 Returns memory usage for this event emitter instance. More...
 
bool addEventHandler (PDG_EventHandler *handler)
 Adds an event handlers that listens for all types of events. More...
 
bool addEventHandler (PDG_EventHandler *handler, PDG_EventType event)
 Adds an event handlers that listens for a specific event. More...
 
bool addEventHandler (PDG_EventHandler *handler, const Filter &filter)
 
void removeEventHandler (PDG_EventHandler *handler)
 Removes an event handler from this emitter. More...
 
void removeAllEventHandlers (bool user_handler_only=false)
 
void emitEvent (const PDG_Event &evt) const
 Emit an event to all handlers. More...
 
void eventHandlers (HandlerArray &handlers) const
 
void setEventQueue (PDG_EventQueue *eventQueue)
 
void eventQueueDestroyed ()
 
- Public Member Functions inherited from PDGE_DependencyOwner
 PDGE_DependencyOwner ()
 Constructs a new dependency owner, which must have a string name. More...
 
virtual ~PDGE_DependencyOwner ()
 
virtual UT_StringHolder debugGroup () const
 

Protected Member Functions

bool preCook (bool is_dirty, bool has_filter) override
 
void postCook () override
 
void clearAllWorkItems () override
 
void clearWorkItem (PDG_WorkItem *work_item) override
 
void addWorkItem (PDG_WorkItem *work_item) override
 
PDGE_Dependency::State evalResolve (PDGE_Resolutions &resolutions, const PDGE_Evaluator &evaluator, PDGE_Dependency *dependency) override
 
PDGE_Dependency::State evalPartial (PDGE_Resolutions &resolutions, const PDGE_Evaluator &evaluator, PDGE_Dependency *dependency, const PDGE_DependencyOwner::Array &owners) override
 
bool cacheBuiltinParms (PDG_NodeSet &dirty, bool dynamic_inputs) override
 Caches any built in parm state for the current cook. More...
 
void addInputDeps (PDG_Node *input_node) override
 
bool shouldSchedule (const PDG_WorkItem *work_item) const override
 
- Protected Member Functions inherited from PDG_Node
UT_RWLockattributeLock () const
 
PDGE_DependencycanGenerateDep ()
 
PDGE_DependencyisGeneratedDep ()
 
PDGE_DependencyisCookedDep ()
 
PDGE_PropagateGrouppropagateGroup ()
 
UT_StringHolder debugName () const override
 
virtual int preCookLoop (const UT_Array< LoopInfo > &begin_info)
 
virtual bool queueWorkItem (PDG_WorkItem *work_item)
 
virtual void addCommonDeps ()
 
virtual bool requiresCookedInputs (bool cook) const
 
void injectDynamicWorkItem (PDG_WorkItem *work_item)
 
void addPropagateDependencies (const PDG_WorkItemArray &work_items)
 
void addWorkItems (const PDG_WorkItemArray &work_items, PDG_EvaluationContext::State state, bool sort_items, bool add_batches)
 
void queueWorkItemDeps (PDGE_Resolutions &resolutions, const PDG_WorkItemArray &work_items, const PDG_BatchWorkItemSet &batches, PDGE_Dependency *can_cook_dep)
 
void needsNodeCook (UT_ArrayMap< PDG_Node *, bool > &needs_cook, bool generate_only, bool cook)
 
void queueNodeDeps (PDGE_Evaluator &evaluator, const UT_ArrayMap< PDG_Node *, bool > &needs_cook, const PDG_NodeSet &error_handlers, PDG_NodeSet &visited, bool generate_only, bool cook)
 
void updateInputRegeneration ()
 
void applyDirty (bool remove_outputs)
 
void prepareDirtyAll (PDG_WorkItemDirty &dirty_state, bool remove_outputs)
 
bool compactItems (bool reset_index=false)
 
bool upstreamItems (PDG_WorkItemArray &work_items, bool skip_failed=false) const
 
bool downstreamItems (PDG_WorkItemArray &work_items) const
 
void clearOutputCache ()
 
void updateModTimeCache ()
 
template<typename FieldType , typename EvalType = FieldType>
void updateBuiltinField (PDG_NodeSet &dirty, const UT_StringHolder &parm_name, FieldType &field, const FieldType &default_value, bool set_dirty=true)
 
- Protected Member Functions inherited from PDGE_DependencyOwner
virtual int evalUnresolve (PDGE_Dependency::Array &, PDGE_Dependency *)
 
const PDGE_Dependency::SetpropagateSet ()
 Returns the propagate set for this owner. More...
 
void addPropagate (PDGE_Dependency *dependency)
 Adds an entry to the propagate set. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from PDG_Node
static void queueNodeDeps (PDGE_Evaluator &evaluator, const PDG_NodeSet &leaf_nodes, const PDG_NodeSet &error_handlers, bool generate_only, bool cook)
 Queues node dependencies for cooking with the evaluator. More...
 
- Static Public Member Functions inherited from PDGE_DependencyOwner
template<typename T >
static void cast (UT_Array< T > &out, const Array &in)
 Converts an owner array to an array of the specified type. More...
 
template<typename T >
static void cast (Array &out, const UT_Array< T > &in)
 Converts an array of the specified type to an owner array. More...
 
- Static Public Attributes inherited from PDG_NodeInterface
static const UT_StringHolder theProcessorCommandParm
 
static const UT_StringHolder theProcessorWorkItemGenerationParm
 
static const UT_StringHolder theProcessorCacheModeParm
 
static const UT_StringHolder theProcessorCookTypeParm
 
static const UT_StringHolder theProcessorServiceNameParm
 
static const UT_StringHolder theProcessorServiceResetWhenParm
 
static const UT_StringHolder theProcessorServiceResetTypeParm
 
static const UT_StringHolder theProcessorUseServiceBlockParm
 
static const UT_StringHolder theProcessorPriorityTypeParm
 
static const UT_StringHolder theProcessorPriorityExpressionParm
 
static const UT_StringHolder theProcessorLabelTypeParm
 
static const UT_StringHolder theProcessorLabelExpressionParm
 
static const UT_StringHolder theProcessorUseScheduleWhenParm
 
static const UT_StringHolder theProcessorScheduleWhenParm
 
static const UT_StringHolder theFeedbackBeginParm
 
static const UT_StringHolder theFeedbackFilesParm
 
static const UT_StringHolder theFeedbackAttribsParm
 
static const UT_StringHolder theFeedbackAttribPatternParm
 
static const UT_StringHolder thePartitionerSortParm
 
static const UT_StringHolder thePartitionerSortAttribParm
 
static const UT_StringHolder thePartitionerSortDirectionParm
 
static const UT_StringHolder thePartitionerSortRequiredParm
 
static const UT_StringHolder thePartitionerWhenParm
 
static const UT_StringHolder thePartitionerIgnoreFailures
 
static const UT_StringHolder thePartitionerSplitEnabledParm
 
static const UT_StringHolder thePartitionerSplitAttributeParm
 
static const UT_StringHolder thePartitionerSplitMissingParm
 
static const UT_StringHolder thePartitionerSplitDefaultParm
 
static const UT_StringHolder thePartitionerSplitPartialParm
 
static const UT_StringHolder thePartitionerTargetTypeParm
 
static const UT_StringHolder thePartitionerTargetParm
 
static const UT_StringHolder thePartitionerMergeParm
 
static const UT_StringHolder thePartitionerMergeOutputsParm
 
static const UT_StringHolder thePartitionerMergeAttribsParm
 
static const UT_StringHolder thePartitionerMergeOpParm
 
static const UT_StringHolder thePartitionerMergePatternParm
 
static const UT_StringHolder thePartitionerMergePreserveParm
 
static const UT_StringHolder thePartitionerStoreIDsParm
 
static const UT_StringHolder thePartitionerIDAttribParm
 
static const UT_StringHolder thePartitionerSetFrameParm
 
static const UT_StringHolder theSchedulerWorkingDirParm
 
static const UT_StringHolder theSchedulerDataSourceParm
 
static const UT_StringHolder theSchedulerValidateOutputsParm
 
static const UT_StringHolder theSchedulerCheckExpectedOutputsParm
 
static const UT_StringHolder theSchedulerCompressWorkItemDataParm
 
static const UT_StringHolder theSchedulerTickPeriodParm
 
static const UT_StringHolder theSchedulerMaxItemsParm
 
static const UT_StringHolder theSchedulerUseMaxTasksParm
 
static const UT_StringHolder theSchedulerMaxTasksParm
 
static const UT_StringHolder theSchedulerMapModeParm
 
static const UT_StringHolder theSchedulerMapZoneParm
 
static const UT_StringHolder theSchedulerUseMapZoneParm
 
static const UT_StringHolder theSchedulerWaitForFailures
 
static const UT_StringHolder theSchedulerDeleteTempDir
 
static const UT_StringHolder theSchedulerRpcTimeout
 
static const UT_StringHolder theSchedulerRpcRetries
 
static const UT_StringHolder theSchedulerRpcBackoff
 
static const UT_StringHolder theSchedulerRpcBatch
 
static const UT_StringHolder theSchedulerRpcRelease
 
static const UT_StringHolder theSchedulerRpcIgnoreErrors
 
static const UT_StringHolder theSchedulerRpcMaxErrors
 
static const UT_StringHolder theTagExpandName
 
static const UT_StringHolder theTagOpDepDirty
 
static const UT_StringHolder theTagOpDepRegen
 
static const UT_StringHolder theTagExtraInput
 
static const UT_StringHolder theSeparatorLabel
 
static const UT_StringHolder theGenerateMenuScript
 
static const UT_StringHolder theCacheModeMenuScript
 
- Protected Types inherited from PDG_Node
enum  CookWhen { eCookNone, eCookDeferred, eCookImmediate }
 Enumerations of cook conditions. More...
 
enum  TargetedBy { eTargetedNone = 0x0, eTargetedAll = 0x1, eTargetedEach = 0x2 }
 Enumeration of targeting conditions. More...
 
- Protected Attributes inherited from PDG_Node
PDG_NodeOptions myNodeOptions
 
PDG_NodeStats myNodeStats
 
PDG_SortOptions mySortOptions
 
PDGE_Dependency myCanGenerateDep
 
PDGE_Dependency myIsGeneratedDep
 
PDGE_Dependency myIsCookedDep
 
PDGE_PropagateGroup myPropagateGroup
 
PDG_WorkItemArray myWorkItems
 
PDG_BatchWorkItemSet myBatchItems
 
PDG_NodeSet myStaticAncestors
 
PDG_NodeArray myExtraInputs
 
UT_Array< PDG_Dependency * > myDependencies
 
UT_ArrayStringMap< intmyOutputCache
 
UT_StringMap< ModTimeCacheEntrymyModTimeCache
 
UT_StringHolder myName
 
PDG_NodeCallbackPtr myCallback
 
const PDG_NodeCallbackTypemyTypeObject
 
PDG_GraphContextmyContext
 
PDG_SchedulermyScheduler
 
PDG_SchedulerSet mySchedulerReferences
 
UT_StringHolder myServiceName
 
int myTargetedBy
 
int myLoopDepth
 
int myInputFilter
 
CookWhen myCookWhen
 
RegenerateReason myRegenerateReason
 
BypassState myBypassState
 
PDG_ServiceResetWhen myLoopResetWhen
 
PDG_ServiceResetType myLoopResetType
 
SYS_AtomicCounter myActiveGenerates
 
SYS_AtomicCounter myTotalGenerates
 
int myId
 
int myMaxIndex
 
UT_RWLock myAttributeLock
 
UT_TBBSpinLock myWorkItemLock
 
UT_TBBSpinLock myOutputCacheLock
 
UT_TBBSpinLock myModTimeCacheLock
 
bool myIsDynamicGen
 
bool myIsDynamicEval
 
bool myIsDynamicProp
 
bool myIsAllGeneration
 
bool myHasNoGenerate
 
bool myHasError
 
bool myHasCachedParms
 
bool myCanHaveWorkItems
 
bool myIsErrorHandler
 
bool myIsErrorHandlerBranch
 
bool myIsGenerated
 
bool myIsCooked
 
bool myIsFrozen
 
bool myUseServiceBlock
 
- Protected Attributes inherited from PDG_NodeInterface
PDG_AttributeInfo myAttributeInfo
 
- Protected Attributes inherited from PDG_EventEmitter
HandlerSet myHandlers
 
FilterMap myFilters
 
UT_TBBSpinLock myHandlersLock
 
bool myBeingDestroyedFlag = false
 

Detailed Description

Concrete node type that creates new work items from upstream items. This node can either create items each item an upstream item is cooked, or when all upstream items are generated or cooked. Work items can also be injected into the node.

Definition at line 29 of file PDG_Processor.h.

Member Enumeration Documentation

The caching mode, used to control whether or not the node should attempt to read existing files from disk prior to cooking

Enumerator
eCacheAutomatic 

Automatic - checks if the file exists and uses it if it does.

eCacheAlwaysRead 

Always Read - always tries to read, and fails if the file does not exist

eCacheAlwaysWrite 

Always Write - always writes, always spawns a job to do the cook and possibly overrwrites existing files

eCacheAutomaticIgnore 

Same automatic, but the node will not invalidate work items due to upstream cache changes

Definition at line 66 of file PDG_Processor.h.

Enumeration of generation conditions.

Enumerator
eEachInputCooked 

Generate work items each time an input work item cooks.

eAllInputsGenerated 

Generate work items when all inputs work items are generated.

eAutomaticGeneration 

Automatic generation mode.

eAllInputsCooked 

Generate work items when all inputs work items are cooked.

Definition at line 85 of file PDG_Processor.h.

Labeling scheme that node can use when generating work item.

Enumerator
eLabelDefault 

Use the default label field on the root graph, or no label if there is no default

eLabelInherit 

Inherit the label from the parent item.

eLabelCustom 

Set the label based on an expression.

eLabelNode 

Set the label baed on custom node logic.

Definition at line 48 of file PDG_Processor.h.

Prioritization schemes that node can use when generating work items.

Enumerator
ePriorityInherit 

Inheirt the priority from the upstream work items, or 0 if there are no upstream items

ePriorityExpression 

Set the priority based on an expression.

ePriorityNode 

Set the priority using logic in the node. Only used by ROP Fetch

Definition at line 33 of file PDG_Processor.h.

Constructor & Destructor Documentation

PDG_Processor::PDG_Processor ( PDG_GraphContext context,
const UT_StringHolder name,
const PDG_NodeCallbackType type_object,
int  custom_id = -1 
)

Constructs an new processor from graph context, name, callback type and custom id. Most of the initialization for this class is handled in the PDG_Node base.

PDG_Processor::~PDG_Processor ( )
inlineoverride

Definition at line 110 of file PDG_Processor.h.

Member Function Documentation

void PDG_Processor::addInputDeps ( PDG_Node input_node)
overrideprotectedvirtual

Adds dependencies on input nodes based on the current generation settings

Reimplemented from PDG_Node.

void PDG_Processor::addWorkItem ( PDG_WorkItem work_item)
overrideprotectedvirtual

Called when this node should add a work item. Processor nodes need to update the myParentMap accordingly.

Reimplemented from PDG_Node.

bool PDG_Processor::cacheBuiltinParms ( PDG_NodeSet dirty,
bool  dynamic_inputs 
)
overrideprotectedvirtual

Caches any built in parm state for the current cook.

Reimplemented from PDG_Node.

void PDG_Processor::clearAllWorkItems ( )
overrideprotectedvirtual

Called when this node should clear all work items. Management of the main work item array is handled by the parent class, but processors need to clear their myParentMap contents.

Reimplemented from PDG_Node.

void PDG_Processor::clearWorkItem ( PDG_WorkItem work_item)
overrideprotectedvirtual

Called when this node should clear a specific work item. Processor nodes need to update the myParentMap accordingly.

Reimplemented from PDG_Node.

void PDG_Processor::commitWorkItem ( PDG_WorkItem work_item)
overridevirtual

Called after deserializing a work item and adding its dependencies.

Reimplemented from PDG_Node.

PDG_WorkItemCookType PDG_Processor::cookType ( ) const
inline

Returns the cook type for work items created by this node.

Definition at line 123 of file PDG_Processor.h.

bool PDG_Processor::deserializeWorkItem ( PDG_WorkItem work_item)
overridevirtual

Deserialized the specified work item into this node. Most of the work is handled by the parent class, but processor nodes need to update the myParentMap.

Reimplemented from PDG_Node.

PDGE_Dependency::State PDG_Processor::evalPartial ( PDGE_Resolutions resolutions,
const PDGE_Evaluator evaluator,
PDGE_Dependency dependency,
const PDGE_DependencyOwner::Array owners 
)
overrideprotectedvirtual

Called when a dependency owned by thhis node receives a partial resolution. This method will generate work items when the generation mode is set to EachInputCooked.

Reimplemented from PDGE_DependencyOwner.

PDGE_Dependency::State PDG_Processor::evalResolve ( PDGE_Resolutions resolutions,
const PDGE_Evaluator evaluator,
PDGE_Dependency dependency 
)
overrideprotectedvirtual

Called when a dependency owned by this node is resolved. This method will generate work items when the generation mode is set to either AllInputsCooked or AllInputsGenerated.

Reimplemented from PDGE_DependencyOwner.

void PDG_Processor::injectStaticItems ( PDG_WorkItemHolder holder,
bool  compact_items,
bool  sort_items 
)

Injects work items using a holder, which should be constructed with the this->workItemHolder() method. If compact_items is true, the node's work item array is compacted, prioritized and sorted after injecting items.

PDG_WorkItemState PDG_Processor::isOutputCached ( PDG_WorkItem work_item) const
overridevirtual

Checks if a work item is cached based on its expected outputs and the current output cache state

Reimplemented from PDG_Node.

int PDG_Processor::itemPriority ( const PDG_WorkItem work_item,
PriorityType  priority_type 
) const

Returns the priority for the specified work item.

void PDG_Processor::memoryInfo ( PDG_MemoryInfo memory_info,
bool  inclusive 
) const
overridevirtual

Returns the total memory usage of the node, including any work items owned by it.

Reimplemented from PDG_Node.

void PDG_Processor::postCook ( )
overrideprotectedvirtual

Runs node-specific post cook logic. Called after all work items have finished cooking.

Reimplemented from PDG_Node.

bool PDG_Processor::preCook ( bool  is_dirty,
bool  has_filter 
)
overrideprotectedvirtual

Runs node-specific pre cook logic. Called before anything in the graph evaluates.

Reimplemented from PDG_Node.

PriorityType PDG_Processor::prioritizeBy ( ) const
inline

Returns the priority scheme used by this node. The default is to inherit from the upstream work item, if any.

Definition at line 119 of file PDG_Processor.h.

void PDG_Processor::resetOwner ( )
overridevirtual

Resets this dependency owner.

Reimplemented from PDG_Node.

PDG_ServiceResetType PDG_Processor::serviceResetType ( ) const
inline

Returns the reset type for service clients used by this node.

Definition at line 139 of file PDG_Processor.h.

PDG_ServiceResetWhen PDG_Processor::serviceResetWhen ( ) const
inline

Returns the condition when this node resets service clients.

Definition at line 135 of file PDG_Processor.h.

bool PDG_Processor::shouldSchedule ( const PDG_WorkItem work_item) const
overrideprotectedvirtual

Returns true if the work item should be scheduled, or false if it should be immediately marked as cooked.

Reimplemented from PDG_Node.

void PDG_Processor::syncWorkItem ( PDG_WorkItem work_item,
const PDG_WorkItem clone_target 
)
overridevirtual

Syncs data for the work item, using node-specific logic.

Reimplemented from PDG_Node.

bool PDG_Processor::useServices ( ) const
inline

Returns true if the processor has been configured to use services for the current cook.

Definition at line 128 of file PDG_Processor.h.

UT_UniquePtr<PDG_WorkItemHolder> PDG_Processor::workItemHolder ( )

Constructs a new work item holder for this node, for work item injection. The caller takes ownership of the object.


The documentation for this class was generated from the following file: