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

#include <PDG_BatchWorkItem.h>

+ Inheritance diagram for PDG_BatchWorkItem:

Public Member Functions

 PDG_BatchWorkItem (PDG_GraphContext *context, bool is_static=true, PDG_WorkItemID item_id=theInvalidId, int batch_size=0)
 
 ~PDG_BatchWorkItem () override
 
void memoryInfo (PDG_MemoryInfo &memory_info, bool inclusive) const override
 
int batchStart () const
 
int batchSize () const
 Returns the size of the batch. More...
 
const PDG_WorkItemArraybatchItems () const
 Returns the list of sub items in the batch. More...
 
UT_StringHolder batchName () const
 Returns the batch name; the prefix given to all sub items. More...
 
void resetOwner () override
 Resets the work item's dependency objects. More...
 
PDG_WorkItemsubitem (int index) const
 
void insertSubitem (int index, PDG_WorkItem *item)
 Inserts a subitem at a specific index. Used for deserialization. More...
 
void initBatchItems (PDG_WorkItemArray &items, int count)
 
void initBatchItems ()
 
void setPendingDirty (PendingDirty pending) override
 Sets the pending dirty flag on all sub items. More...
 
void setIsPartialCook (bool is_partial)
 Sets the partial batch flag. More...
 
void setIsDynamicBatch (bool is_dynamic)
 sets the is dynamic batch flag More...
 
bool isPartialCook () const
 Returns the partial batch flag. More...
 
bool isDynamicBatch () const
 
void setOffset (int offset)
 Sets the batch offset. More...
 
int offset () const
 
void setActivationMode (PDG_BatchActivation mode)
 Sets the activation mode of the batch. More...
 
void setActivationCount (int activation_count)
 
PDG_BatchActivation activationMode () const
 Gets the activation mode of the batch. More...
 
int activationCount () const
 Gets the activation count. More...
 
void setStartIndex (int index)
 Sets the start index of the batch. More...
 
fpreal setTimeStat (PDG_WorkItemStats::StatType stat, bool batched) override
 Sets a stat on the batch item, and the subitems if requested. More...
 
PDGE_DependencynotCachedDep ()
 Returns the can cook dependency object for this work item. More...
 
void tryNotCached (PDGE_Resolutions &resolutions, PDG_WorkItem *work_item)
 Tries marking the not cached dep as resolved. More...
 
const PDG_WorkItemactiveBatchItem () const
 Returns the active batch sub item, if any. More...
 
const PDG_WorkItemsetActiveBatchIndex (int index) const
 
PDG_WorkItemappendSubItem (UT_WorkBuffer &errors)
 Dynamically adds a new work item to the batch. More...
 
- Public Member Functions inherited from PDG_WorkItem
 PDG_WorkItem (PDG_GraphContext *context, bool is_static=true, PDG_WorkItemType type=PDG_WorkItemType::eRegular, PDG_WorkItemID id=theInvalidId)
 
 ~PDG_WorkItem () override
 
PDG_EventEmitter::FiltersupportedEventTypes () const override
 Returns the list of supported event types. More...
 
int64 getMemoryUsage (bool inclusive) const override
 Returns memory usage for this work item. More...
 
UT_RWLockattribGlobalLock () const override
 Returns the owning node's attribute lock. More...
 
bool attribCanWrite (const PDG_EvaluationContext *ctx) const override
 Returns true if the work item's attributes are writeable. More...
 
void attribUnlock () const override
 Called when the attributes have been unlocked. More...
 
void attribModify (PDG_AttributeType attrib_type, const UT_StringHolder &attrib_name) const override
 Called when an attributed owned by the work item is modified. More...
 
void attribWarn (const UT_StringHolder &message) const override
 Called when an attribute operation produces a non-fatal warning. More...
 
UT_StringHolder attribOwnerName () const override
 Returns a descriptive name of the attribute owner. More...
 
void resetOwner () override
 Resets the work item's dependency objects. More...
 
UT_StringHolder debugName () const override
 
UT_StringHolder debugGroup () const override
 
PDGE_DependencycanCookDep ()
 Returns the can cook dependency object for this work item. More...
 
PDGE_DependencyisCookedDep ()
 Returns the is cooked dependency object for this work item. More...
 
PDG_WorkItemType type () const
 Returns the work item type. More...
 
PDG_WorkItemExecutionType executionType () const
 Returns the work item execution type. More...
 
PDG_WorkItemCookType cookType () const
 Returns the work item cook type. More...
 
PDG_WorkItemID id () const
 Returns the id of the work item, guaranteed to be unique. More...
 
UT_StringHolder name () const
 Returns the name of the work item, guaranteed to be unique. More...
 
bool hasCommand () const
 
bool hasPlatformCommand () const
 
const UT_StringHoldercommand () const
 Returns the generic command associated with the work item. More...
 
const UT_StringHolderplatformCommand (PDG_Platform platform=PDG_Platform::eUndefined)
 
bool shouldRunInShell () const
 Returns true if the command should run in the shell. More...
 
UT_StringHolder label () const
 Returns the label assocaited with the work item. More...
 
bool hasLabel () const
 Returns true if the work item has a custom label. More...
 
const UT_StringHoldercustomState () const
 
bool hasCustomState () const
 Returns true if the work item has a custom state string. More...
 
PDG_Nodenode () const
 Returns the node that owns the work item. More...
 
PDG_GraphContextcontext () const
 Returns the context that owns the work item. More...
 
PDG_Graphgraph () const
 Returns the graph that the work item belongs to. More...
 
PDG_BatchWorkItembatchParent () const
 
const PDG_WorkItemcloneTarget () const
 
const PDG_WorkItemparent () const
 Const acessor to the work item's parent. More...
 
const PDG_WorkItemattributeSource () const
 
int index () const
 Returns the work item index. More...
 
int internalIndex () const
 Returns the work item's internal index. More...
 
int batchIndex () const
 
int priority () const
 Returns the work item priority. More...
 
int cacheId () const
 Returns the cache id of the work item. More...
 
fpreal frame () const
 Returns the work item frame. More...
 
bool hasFrame () const
 Returns true if the frame has been set. More...
 
fpreal frameStep () const
 Returns the work item step size, primarily used with batch items. More...
 
bool hasWarnings () const
 Returns true if the work item has any warning log messages. More...
 
bool isStatic () const
 Returns true if the item is a static work item. More...
 
bool isRegular () const
 Returns true if the work item is a regular item or batch item. More...
 
bool isPartition () const
 Returns true if the work item is a partition type. More...
 
bool isDynamic () const
 Returns true if the work item is a dynamic, regular work item. More...
 
bool isBatch () const
 Returns true if the work tiem is a batch. More...
 
bool isFrozen () const
 Returns true if the work item is frozen. More...
 
bool isInProcess () const
 Returns true if the work item is in process. More...
 
bool isServiceMode () const
 Returns true if the work item is marked as a service task. More...
 
bool isOutOfProcess () const
 Returns true if the work item is scheduled out of process. More...
 
bool isScheduled () const
 
bool isPostCook () const
 Returns true if the work item has post-cook logic. More...
 
bool isNoGenerate () const
 
bool isCloneOutputFiles () const
 
bool isMainThread () const
 
PDG_WorkItemState state () const
 Returns the work item cook state. More...
 
PDG_WorkItemState dependencyState () const
 
bool isCooked () const
 Returns true if the work item is in a cooked state. More...
 
bool isSuccessful () const
 Returns true if the work item is in a successful cooked state. More...
 
bool isUnsuccessful () const
 Returns true if the work item is in a unsucessful cooked state. More...
 
bool isUncooked () const
 Returns true if the work item is uncooked. More...
 
bool isUnsuccessfulDep () const
 Returns true if the work item has an unsucessful dependency. More...
 
bool isProcessing () const
 Returns true if the work item is an cooking/scheduled state. More...
 
bool isLongRunning () const
 Returns true if the work item is long running. More...
 
PDG_WorkItemEvalState evaluationState () const
 
UT_TBBSpinLockedgeLock () const
 Returns the edge lock for the work item. More...
 
const PDG_WorkItemSetdependenciesUnsafe () const
 
const PDG_WorkItemSetdependentsUnsafe () const
 
void dependencies (PDG_WorkItemConstArray &dependency_array) const
 Returns a copy of the dependencies in an array. More...
 
void dependencyIds (PDG_WorkItemIDSet &dependencyIdsSet) const
 Returns the dependency ids in a set. More...
 
int dependencySize () const
 Returns the number of dependencies. More...
 
void dependents (PDG_WorkItemConstArray &dependent_array) const
 Returns a copy of the dependents in an array. More...
 
void dependentIds (PDG_WorkItemIDSet &dependentIdsSet) const
 Returns the dependent ids in a set. More...
 
void visualDependencies (PDG_WorkItemSet &deps, bool expand, PDG_Scheduler *filter) const
 
void visualDependents (PDG_WorkItemSet &deps, bool expand, PDG_Scheduler *filter) const
 Inverse of the above. More...
 
const PDG_WorkItemConstBoolMaprequiredDependencies () const
 
bool partitionItems (PDG_WorkItemConstArray &components) const
 
void sortedDependencies (PDG_WorkItemConstArray &sorted_depencies, bool only_upstream=false) const
 
bool addDependency (PDG_WorkItem *work_item, bool required=false, bool user_defined=false)
 
void addRequiredDependency (const PDG_WorkItem *work_item, bool user_defined)
 
bool hasDependency (PDG_WorkItem *work_item)
 Checks if the work item has a given item as a dependency. More...
 
bool removeDependency (PDG_WorkItem *work_item)
 
void pushLoopInfoStack (const PDG_WorkItem *parent_item)
 Updates the loop stack, with the specified parent. More...
 
void setLoopInfoStack (const PDG_LoopInfo::Stack &loop_stack)
 Sets the loop stack contents. More...
 
PDG_WorkItemloopInfoStackEntry (int index) const
 Returns the loop stack entry at the specified index;. More...
 
int loopInfoIteration () const
 Returns the loop iteration of the work item. More...
 
int loopInfoNumber () const
 Returns the loop number of the work item. More...
 
int loopInfoSize () const
 Returns the size of the loop that contains the work item. More...
 
int loopInfoDepth () const
 Returns the loop depth of the work item. More...
 
PDG_WorkItemID loopInfoLock () const
 Returns the loop service lock ID of the work item. More...
 
const PDG_LoopInfo::StackloopInfoStack () const
 Returns the loop stack for this work item. More...
 
bool compareLoopInfoStack (const PDG_WorkItem *other) const
 
void setIsPostCook (bool postcook)
 Sets the is post cook flag. More...
 
void setIsNoGenerate (bool no_gen)
 Sets the work item no generate flag. More...
 
void setIsCloneOutputFiles (bool clone)
 Sets the work item's clone output files flag. More...
 
bool setState (PDG_WorkItemState state, bool emit=true)
 Sets the work item state. More...
 
void setIsFrozen (bool is_frozen)
 Sets the frozen flag on the work item. More...
 
void setExecutionType (PDG_WorkItemExecutionType execution_type)
 Sets the execution type of the work item. More...
 
void setCookType (PDG_WorkItemCookType cook_type)
 Sets the cook type for the work item. More...
 
bool wasModified () const
 Returns the work item's modified flag. More...
 
void setIndex (int index)
 Sets the work item index. More...
 
void setInternalIndex (int index)
 Sets the work items internal index, used for dirtying. More...
 
void setPriority (int priority, bool emit=true)
 Sets the work item priority. More...
 
void boostPriority ()
 
bool clearFrame ()
 
bool setFrame (fpreal frame)
 
bool setFrame (fpreal frame, fpreal frame_step)
 
void setNode (PDG_Node *node, bool emit)
 Sets the work item node. More...
 
void startRegenerating ()
 Called when the work item should begin regenerating. More...
 
PendingDirty doneRegenerating ()
 
void setCloneTarget (const PDG_WorkItem *clone_target)
 
void setBatchInfo (PDG_BatchWorkItem *item, int index, int batch_index, int priority)
 
void setLoopInfo (int iteration, int number, int size, PDG_WorkItemID service_lock=theInvalidId)
 
void setCommand (const UT_StringHolder &command, bool shell=false)
 Sets the work item command directly. More...
 
void setPlatformCommands (const UT_StringHolder &linux, const UT_StringHolder &mac, const UT_StringHolder &windows, bool shell=false)
 Sets a per-platform work item command. More...
 
void setLabel (const UT_StringHolder &label)
 Sets the work item label. More...
 
void clearLabel ()
 Clears the work item label. More...
 
void setCustomState (const UT_StringHolder &state)
 
void clearCustomState ()
 Clears the custom state string. More...
 
bool hasCookPercent () const
 
fpreal cookPercent () const
 
void setCookPercent (const fpreal &cook_percent)
 
template<typename... Args>
void addErrorFmt (const char *fmt, Args &&...args) const
 
void addError (const UT_StringHolder &log, bool timestamp=true) const
 
template<typename... Args>
void addWarningFmt (const char *fmt, Args &&...args) const
 
void addWarning (const UT_StringHolder &log, bool timestamp=true, int verbosity=0) const
 
template<typename... Args>
void addMessageFmt (const char *fmt, Args &&...args) const
 
void addMessage (const UT_StringHolder &log, bool timestamp=true, int verbosity=0) const
 Appends a plain message to the work item's in process log buffer. More...
 
void addLog (PDG_WorkItemLogType type, const UT_StringHolder &log, bool timestamp=true, int verbosity=0) const
 Appends text data to the log with the given log type. More...
 
const UT_WorkBufferlogMessages () const
 Returns the current in process log buffer. More...
 
void appPath (UT_WorkBuffer &buffer) const
 Returns the application path to the work item, e.g. /node/workitem. More...
 
void dirty (bool should_delete, bool remove_outputs)
 
PDG_WorkItemDirty prepareDirty (bool should_delete)
 
void cancel ()
 Cancels the work item's execution, if it's running with a scheduler. More...
 
void freeze ()
 
void invalidateCache ()
 Invalidates the file cache of this work item. More...
 
void syncData (bool force_recursive)
 Syncs work item data with its parent. More...
 
PDG_WorkItemDatadata () const
 
void setData (PDG_WorkItemDataPtr data)
 
bool compareDataType (const PDG_BaseType *other_type, bool deep=true) const
 
SYS_HashType hash () const
 
PDG_AttributeCast numericData (fpreal &param, const PDG_AttributeEvaluator &evaluator, fpreal frame, int thread) const
 Does a numeric data lookup, for use with the @ operator. More...
 
PDG_AttributeCast stringData (UT_WorkBuffer &buffer, const PDG_AttributeEvaluator &evaluator, fpreal frame, int thread) const
 Does a string data lookup, for use with the @ operator. More...
 
UT_StringHolder serializeData () const
 Serialization of underlying PDG_WorkItemData object. More...
 
bool serializeDataToFile (const UT_StringHolder &file) const
 
bool compare (PDG_WorkItem *item) const
 Compares the work item with another item. More...
 
bool uiSelect (bool select)
 Runs selection logic from selecting a work item in TOPs. More...
 
bool hasOutputFiles () const
 Returns true if the work item has at least one output file. More...
 
bool outputFiles (PDG_File::Array &files) const
 
bool localizedOutputFiles (PDG_File::Array &files) const
 
UT_StringHolder tempDir () const
 
bool outputFilesForTag (PDG_File::Array &files, const UT_StringHolder &tag, bool include_expected=false) const
 Returns all output files that are a substring-match for the given tag. More...
 
UT_StringHolder localizePath (const UT_StringHolder &path) const
 
UT_StringHolder firstOutputFileForTag (const UT_StringHolder &tag) const
 
bool expectedOutputFiles (PDG_File::Array &files) const
 Returns the list of expected output files. More...
 
void addExpectedOutputFile (const UT_StringHolder &path, const UT_StringHolder &tag, bool own)
 Adds an expected output file to the work item. More...
 
void addExpectedOutputFiles (const UT_StringArray &paths, const UT_StringHolder &tag, bool own)
 Adds an array of expected output file paths to the work item. More...
 
void addExpectedOutputFile (const PDG_File &file)
 Adds an expected output file to the work item. More...
 
void addOutputFile (const UT_StringHolder &path, const UT_StringHolder &tag, PDG_File::Hash hash_code, bool own)
 Appends the given output file to the work item. More...
 
void addOutputFiles (const UT_StringArray &paths, const UT_StringHolder &tag, const PDG_File::HashArray &hashes, bool own)
 
void addOutputFiles (const UT_StringArray &paths, const UT_StringArray &tags, const PDG_File::HashArray &hashes, bool own)
 
void updateOutputFile (int index, const UT_StringHolder &path, const UT_StringHolder &tag, PDG_File::Hash hash_code, bool owner)
 Replaces the output file at the given index, if that index is valid. More...
 
void inputFiles (PDG_File::Array &files, bool include_expected) const
 Returns the output files for immediate dependencies. More...
 
bool validateOutputFiles ()
 Checks if the work items output files are valid, e.g. they exist. More...
 
bool transferFiles (bool update_cache)
 
void clearOutputFiles ()
 Clears all output files. More...
 
void clearExpectedOutputFiles ()
 Clears expected outputs. More...
 
void clearRuntimeOutputFiles ()
 
void clearEnvironment ()
 
bool addEnvironmentVar (const UT_StringHolder &var_name, const PDGT_Value &value, UT_WorkBuffer &errors)
 Adds an environment variable and value to this work items env var map. More...
 
bool hasEnvironmentVar (const UT_StringHolder &var_name) const
 Returns true if the work item has the specified env var. More...
 
void globEnvironment (PDGT_Value::Map &environment) const
 
bool envLookup (const char *key, PDGT_Value &value) const
 Looks up a key in the environment, returns true if the key exists. More...
 
void addNodeWarning (const UT_StringHolder &message) const
 Adds a warning to the owning node. More...
 
bool startSubItem (bool wait, UT_WorkBuffer &errors)
 
bool checkSubItem (UT_WorkBuffer &errors)
 Returns true if the sub item is ready. More...
 
bool startWorkItem ()
 
bool cookSubItem (PDG_WorkItemState state, fpreal duration)
 Marks the work item as cooked, if it is an in-process batch item. More...
 
PDG_Schedulerscheduler () const
 
bool isScheduledBy (PDG_Scheduler *scheduler) const
 Returns true if the work item is schduled by the specified schduler. More...
 
void performanceEvent () const
 Reports a performance monitor event for this work item. More...
 
const PDG_WorkItemStatsstats () const
 Returns the perf stats object for the work item. More...
 
PDG_WorkItemStatsstats ()
 
void varReplace (const char *input, UT_WorkBuffer &output) const
 
bool saveJSONFile (const UT_StringHolder &path, bool pretty_print, bool global_attributes) const
 Saves the work item to a .json file or string. More...
 
UT_StringHolder saveJSONString (bool pretty_print, bool global_attributes) const
 
UT_StringHolder createJSONPatch (bool pretty_print) const
 Creates a JSON patch from the work item as a string. 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 PDG_AttributeOwner
 PDG_AttributeOwner (bool has_runtime)
 
virtual ~PDG_AttributeOwner ()
 
PDG_AttributeMapattributes ()
 
const PDG_AttributeMapattributes () const
 
bool attribSaveJSON (std::ostream &os, bool binary) const
 
bool attribSaveJSON (const UT_StringHolder &file_path) const
 
bool attribLoadJSON (UT_IStream &istream, PDG_AttributeCollision strategy)
 
bool attribLoadJSON (const UT_StringHolder &file_path, PDG_AttributeCollision strategy)
 
bool hasAttributes () const
 
virtual bool isAttribFlagValid (PDG_AttributeFlag flag) const
 
virtual bool areAttribFlagsValid (uint16 flags) const
 
- Public Member Functions inherited from PDGE_DependencyOwner
 PDGE_DependencyOwner ()
 Constructs a new dependency owner, which must have a string name. More...
 
virtual ~PDGE_DependencyOwner ()
 

Protected Member Functions

PDG_WorkItemState checkCached (bool add_results) override
 Returns true if the entire batch is cached, else false. More...
 
void notifyCook (PDGE_Resolutions &resolutions, PDG_WorkItemState result, int batch_index, fpreal duration, bool notify_all, bool static_cook, bool unresolve) override
 Notifies the batch item than a given subitem index has finished cooking. More...
 
void syncCacheId () override
 Syncs the cache for all subitems. More...
 
bool setFrame (fpreal frame, fpreal frame_step, bool check_dirty) override
 
PDGE_Dependency::State evalResolve (PDGE_Resolutions &resolutions, const PDGE_Evaluator &evaluator, PDGE_Dependency *dependency) override
 
- Protected Member Functions inherited from PDG_WorkItem
void prepareDirty (PDG_WorkItemDirty &dirty_state, bool is_delete, bool is_dirty_data) const
 
void applyDirty (const PDG_WorkItemDirty &dirty_state, bool remove_outputs)
 Applies a dirty operation that was stored to the dirty state. More...
 
void handleDirty (const UT_ArrayStringSet &keep_set, bool should_delete, bool remove_outputs)
 Runs custom dirty handlers and deletes output files. More...
 
void ownedFiles (PDG_File::Set &files, bool include_expected) const
 Returns the list of files owned by this work item. More...
 
void updateCacheId (int cache_id)
 
PDGE_Dependency::State evalResolve (PDGE_Resolutions &resolutions, const PDGE_Evaluator &evaluator, PDGE_Dependency *dependency) override
 
int evalUnresolve (PDGE_Dependency::Array &extras, PDGE_Dependency *dependency) override
 
bool upgradeExpectedOutputFiles (bool check_disk, bool clear)
 Upgrades expected outputs to runtime outputs for this work item. More...
 
void postCook (PDGE_Resolutions &resolutions, PDG_WorkItemState result, int batch_index, fpreal duration, bool notify_all, bool static_cook, bool unresolve)
 Called by the scheduler to mark out of process items as cooked. More...
 
bool cook ()
 Does an inprocess cook of the work item, returning true on success. More...
 
void inheritParent (const PDG_WorkItem *work_item)
 
- Protected Member Functions inherited from PDGE_DependencyOwner
virtual PDGE_Dependency::State evalPartial (PDGE_Resolutions &, const PDGE_Evaluator &, PDGE_Dependency *, const Array &)
 
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

- Public Types inherited from PDG_WorkItem
enum  PendingDirty : uint8 { ePendingNone, ePendingDirty, ePendingDelete }
 Enumeration of pending dirty states. More...
 
- 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 * >
 
- Static Public Member Functions inherited from PDG_WorkItem
static bool saveArrayJSONFile (const UT_StringHolder &path, const PDG_WorkItemArray &items, bool pretty_print, bool global_attributes)
 Saves the array of work items to a .json file or string. More...
 
static UT_StringHolder saveArrayJSONString (const PDG_WorkItemArray &items, bool pretty_print, bool global_attributes)
 
static PDG_WorkItemloadJSONFile (const UT_StringHolder &path, bool make_active, UT_WorkBuffer &errors)
 Loads a work item from a .json file or string. More...
 
static PDG_WorkItemloadJSONString (const UT_StringHolder &data, bool make_active, UT_WorkBuffer &errors)
 
- 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_WorkItem
static constexpr PDG_WorkItemID theInvalidId = -1
 Default, invalid work item ID value. More...
 
- Protected Attributes inherited from PDG_WorkItem
PDGE_Dependency myCanCookDep
 
PDGE_Dependency myIsCookedDep
 
PDG_WorkItemStats myStats
 
PDG_WorkItemSet myDependencies
 
PDG_WorkItemSet myDependents
 
PDG_WorkItemConstBoolMap myRequiredDependencies
 
PDG_LoopInfo::Stack myLoopInfoStack
 
UT_WorkBuffer myLogMessages
 
PDG_NodemyNode
 
PDG_GraphContextmyContext
 
PDG_BatchWorkItemmyBatchParent
 
const PDG_WorkItemmyCloneTarget
 
PDG_WorkItemDataPtr myData
 
fpreal myFrame
 
fpreal myFrameStep
 
PDG_WorkItemID myId
 
int myIndex
 
int myBatchIndex
 
int myPriority
 
int myInternalIndex
 
int myCacheId
 
PDG_WorkItemType myType
 
PDG_WorkItemExecutionType myExecutionType
 
PDG_WorkItemCookType myCookType
 
PendingDirty myPendingDirty
 
PDG_WorkItemState myState
 
PDG_WorkItemState myDepState
 
UT_TBBSpinLock myEdgeLock
 
bool myHasFrame:1
 
bool myHasWarnings:1
 
bool myAttributesDirty:1
 
bool myWasModified:1
 
bool myDidCook:1
 
bool myIsPostCook:1
 
bool myIsStatic:1
 
bool myIsNoGenerate:1
 
bool myIsCloneOutputFiles:1
 
bool myIsFrozen:1
 
bool myIsBatchReady:1
 
- Protected Attributes inherited from PDG_EventEmitter
HandlerSet myHandlers
 
FilterMap myFilters
 
UT_TBBSpinLock myHandlersLock
 
bool myBeingDestroyedFlag = false
 
- Protected Attributes inherited from PDG_AttributeOwner
PDG_AttributeMap myAttributes
 

Detailed Description

Definition at line 19 of file PDG_BatchWorkItem.h.

Constructor & Destructor Documentation

PDG_BatchWorkItem::PDG_BatchWorkItem ( PDG_GraphContext context,
bool  is_static = true,
PDG_WorkItemID  item_id = theInvalidId,
int  batch_size = 0 
)
PDG_BatchWorkItem::~PDG_BatchWorkItem ( )
override

Member Function Documentation

int PDG_BatchWorkItem::activationCount ( ) const

Gets the activation count.

PDG_BatchActivation PDG_BatchWorkItem::activationMode ( ) const

Gets the activation mode of the batch.

const PDG_WorkItem* PDG_BatchWorkItem::activeBatchItem ( ) const

Returns the active batch sub item, if any.

PDG_WorkItem* PDG_BatchWorkItem::appendSubItem ( UT_WorkBuffer errors)

Dynamically adds a new work item to the batch.

const PDG_WorkItemArray& PDG_BatchWorkItem::batchItems ( ) const
inline

Returns the list of sub items in the batch.

Definition at line 43 of file PDG_BatchWorkItem.h.

UT_StringHolder PDG_BatchWorkItem::batchName ( ) const
inline

Returns the batch name; the prefix given to all sub items.

Definition at line 47 of file PDG_BatchWorkItem.h.

int PDG_BatchWorkItem::batchSize ( ) const

Returns the size of the batch.

int PDG_BatchWorkItem::batchStart ( ) const

Returns the starting index for the batch, if it supports partial cooking.

PDG_WorkItemState PDG_BatchWorkItem::checkCached ( bool  add_results)
overrideprotectedvirtual

Returns true if the entire batch is cached, else false.

Reimplemented from PDG_WorkItem.

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

Called when one of the dependencies owned by this work item is resolved.

Reimplemented from PDGE_DependencyOwner.

void PDG_BatchWorkItem::initBatchItems ( PDG_WorkItemArray items,
int  count 
)

Initializes the batch item with a given sub item count and starting state

void PDG_BatchWorkItem::initBatchItems ( )

Reinitializes the batch item properties from the ones on this work item. Assumes the same batch size.

void PDG_BatchWorkItem::insertSubitem ( int  index,
PDG_WorkItem item 
)

Inserts a subitem at a specific index. Used for deserialization.

bool PDG_BatchWorkItem::isDynamicBatch ( ) const
inline

Returns true if the batch is allowed to dynamically add work items while it c ooks

Definition at line 85 of file PDG_BatchWorkItem.h.

bool PDG_BatchWorkItem::isPartialCook ( ) const
inline

Returns the partial batch flag.

Definition at line 80 of file PDG_BatchWorkItem.h.

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

Returns the memory usage of this batch. Does not count sub items in the batch as they're technically owned by the node.

Reimplemented from PDG_WorkItem.

PDGE_Dependency* PDG_BatchWorkItem::notCachedDep ( )
inline

Returns the can cook dependency object for this work item.

Definition at line 119 of file PDG_BatchWorkItem.h.

void PDG_BatchWorkItem::notifyCook ( PDGE_Resolutions resolutions,
PDG_WorkItemState  result,
int  batch_index,
fpreal  duration,
bool  notify_all,
bool  static_cook,
bool  unresolve 
)
overrideprotectedvirtual

Notifies the batch item than a given subitem index has finished cooking.

Reimplemented from PDG_WorkItem.

int PDG_BatchWorkItem::offset ( ) const
inline

Returns the batch offset, e.g. the start of the first item in the real index space

Definition at line 93 of file PDG_BatchWorkItem.h.

void PDG_BatchWorkItem::resetOwner ( )
overridevirtual

Resets the work item's dependency objects.

Reimplemented from PDGE_DependencyOwner.

void PDG_BatchWorkItem::setActivationCount ( int  activation_count)

Sets the activation count, used when the activation mode is set to ActivateFixed.

void PDG_BatchWorkItem::setActivationMode ( PDG_BatchActivation  mode)

Sets the activation mode of the batch.

const PDG_WorkItem* PDG_BatchWorkItem::setActiveBatchIndex ( int  index) const

Sets the active batch sub item index, and returns that sub item if the index is valid

bool PDG_BatchWorkItem::setFrame ( fpreal  frame,
fpreal  frame_step,
bool  check_dirty 
)
overrideprotectedvirtual

Sets the frame of the batch item and all sub items, using the step size.

Reimplemented from PDG_WorkItem.

void PDG_BatchWorkItem::setIsDynamicBatch ( bool  is_dynamic)

sets the is dynamic batch flag

void PDG_BatchWorkItem::setIsPartialCook ( bool  is_partial)

Sets the partial batch flag.

void PDG_BatchWorkItem::setOffset ( int  offset)

Sets the batch offset.

void PDG_BatchWorkItem::setPendingDirty ( PendingDirty  pending)
overridevirtual

Sets the pending dirty flag on all sub items.

Reimplemented from PDG_WorkItem.

void PDG_BatchWorkItem::setStartIndex ( int  index)

Sets the start index of the batch.

fpreal PDG_BatchWorkItem::setTimeStat ( PDG_WorkItemStats::StatType  stat,
bool  batched 
)
overridevirtual

Sets a stat on the batch item, and the subitems if requested.

Reimplemented from PDG_WorkItem.

PDG_WorkItem* PDG_BatchWorkItem::subitem ( int  index) const

Returns a sub item for a given index, or nullptr if the index is out of the valid range.

void PDG_BatchWorkItem::syncCacheId ( )
overrideprotectedvirtual

Syncs the cache for all subitems.

Reimplemented from PDG_WorkItem.

void PDG_BatchWorkItem::tryNotCached ( PDGE_Resolutions resolutions,
PDG_WorkItem work_item 
)

Tries marking the not cached dep as resolved.


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