Inheritence |
|
A container object for construct new PDG work items, by passing a pdg.WorkItemOptions
object or a key/value arguments to the addWorkItem
method
Methods
addWorkItem(options=None, **kwargs)
→ pdg.WorkItem
Constructs a new work item and adds it to the holder. This function can either take a pdg.WorkItemOptions object, or a keyword arguments matching the supported values in the work item options object.
For example:
# Using keyword arguments item_holder.addWorkItem(name="example", index=5) # Using an options object options = pdg.WorkItemOptions() options.name = "otherexample" options.cloneResultData = True item_holder.addWorkItem(options) # Combination item_holder.addWorkItem(options, name='overridename')
commit()
Commits work items currently in this holder and moves them into the node. The holder is reset after calling this function.
setCommitCount(count)
#cppname PDG_WorkItemHolder::setCommitCount
Sets the commit count for this holder. Once that number of work items have been added, the list of pending items is moved from the holder to the PDG node and the holder is reset.
allBatches
: list
of pdg.BatchWorkItem
Property
The array of batch work items that have been processed by this holder. Unlike the batches
method, this list is not cleared when items are committed to the node.
allWorkItems
: list
of pdg.WorkItem
Property
The array of work items that have been processed by this holder. Unlike the workItems
method, this list is not cleared when items are committed to the node.
batches
: list
of pdg.BatchWorkItem
Property
The array of batch work items currently in the holder. This list is cleared each time work items are committed.
commitCount
: int
Property
The number of work items that can be added to the holder before it copies its contents into the PDG node. Once this this value is reached the pending work items are added to the node and the holder is reset.
isEmpty
: bool
Property
True
if the holder is empty, else False
.
workItems
: list
of pdg.WorkItem
Property
The array of work items currently in the holder. This list is cleared each time work items are committed.
Methods from pdg.DependencyHolder
addDependency(child, parent)
Used when this object is passed to a mapping callback on a node. Makes the child
pdg.WorkItem object depend on the parent
work item object.
Tip
The order of the arguments only matters when you're creating a dependency between two work items in the same node. Otherwise, the code will notice if you try to make an upstream item dependent on a downstream item, and flip the order for you.