HDK
|
#include <PDG_NodeCallback.h>
Public Types | |
enum | GenerationType { eStaticGenerate = 0, eDynamicGenerate = 1, eStaticRegenerate = 2, eDynamicRegenerate = 3 } |
Work item generation type. More... | |
enum | CallbackType { eGenerate = 0x0001, eRegenerate = 0x0002, eAddInternalDependencies = 0x0004, ePartition = 0x0008, eMapStatic = 0x0010, eMapDynamic = 0x0020, ePreCook = 0x0040, ePostCook = 0x0080, ePrepareTask = 0x0100, eCookTask = 0x0200, ePostCookTask = 0x0400, eSelectTask = 0x0800, eDeselectTask = 0x1000, eConfigureNode = 0x2000, eProcessorBits = eGenerate | eRegenerate | eConfigureNode, ePartitionerBits = ePartition, eMapperBits = eMapStatic | eMapDynamic } |
Public Types inherited from PDGT_TypeInstance< EnumType > | |
using | BaseType = PDGT_BaseType< EnumType > |
Public Member Functions | |
PDG_NodeCallback (const PDG_BaseType *type, const PDGT_ValueArgs &extra_args, PDG_Node *node) | |
~PDG_NodeCallback () override | |
int64 | getMemoryUsage (bool inclusive) const override |
Returns the memory usage of this callback. More... | |
bool | hasCallback (CallbackType callback_type) const |
void | enableCallback (CallbackType callback_type) |
Enables a specific node callback. More... | |
bool | reloadInstance (UT_WorkBuffer &errors) override |
Resets this node callback to match changes to the type object. More... | |
PDG_CallbackResult | postInvoke (PDG_CallbackResult invoke_result) const |
virtual PDG_CallbackResult | onGenerate (PDG_WorkItemHolder *, const PDG_WorkItemArray &, GenerationType generation_type) |
Generates static items via a work item holder. Called on processors. More... | |
virtual PDG_CallbackResult | onRegenerate (PDG_WorkItemHolder *, const PDG_WorkItemArray &, const PDG_WorkItemArray &, GenerationType generation_type) |
virtual PDG_CallbackResult | onAddInternalDependencies (PDG_DependencyHolder *, const PDG_WorkItemArray &, bool is_static) |
virtual PDG_CallbackResult | onPartition (PDG_PartitionHolder *, const PDG_WorkItemArray &, const PDG_WorkItem *) |
virtual PDG_CallbackResult | onMapStatic (PDG_DependencyHolder *holder, const PDG_WorkItemArray &downstream_items, const PDG_WorkItemArray &upstream_items) |
virtual PDG_CallbackResult | onMapDynamic (PDG_DependencyHolder *holder, const PDG_WorkItemArray &downstream_items, const PDG_WorkItemArray &upstream_items) |
virtual PDG_CallbackResult | onPreCook () |
virtual PDG_CallbackResult | onPostCook () |
Called on each node in the graph after the cook finishes. More... | |
virtual PDG_CallbackResult | onPrepareTask (PDG_WorkItem *work_item) |
virtual PDG_CallbackResult | onCookTask (PDG_WorkItem *work_item) |
virtual PDG_CallbackResult | onPostCookTask (PDG_WorkItem *work_item) |
Called when a work item has completed cooking. More... | |
virtual PDG_CallbackResult | onSelectTask (PDG_WorkItem *work_item) |
Called when a work item is selected by TOPs. More... | |
virtual PDG_CallbackResult | onDeselectTask (PDG_WorkItem *work_item) |
Called when a work item is deselcted. More... | |
virtual PDG_CallbackResult | onConfigureNode (PDG_NodeOptions *node_options) |
Called when the node should describe itself for the UI. More... | |
PDG_Node * | node () const |
Returns the node associated with this callback. 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 |
Convenience method for evaluating a parameter on the underlying node. More... | |
template<typename T > | |
bool | evaluateArray (T &result, const UT_StringHolder &name, const PDG_WorkItem *work_item=nullptr, int multi=-1) const |
UT_StringHolder | evaluateS (const UT_StringHolder &name, const PDG_WorkItem *work_item=nullptr, int index=0, int multi=-1) const |
UT_StringHolder | evaluateRaw (const UT_StringHolder &name, const PDG_WorkItem *work_item=nullptr, int index=0, int multi=-1) const |
fpreal | evaluateF (const UT_StringHolder &name, const PDG_WorkItem *work_item=nullptr, int index=0, int multi=-1) const |
exint | evaluateI (const UT_StringHolder &name, const PDG_WorkItem *work_item=nullptr, int index=0, int multi=-1) const |
bool | evaluateB (const UT_StringHolder &name, const PDG_WorkItem *work_item=nullptr, int index=0, int multi=-1) const |
template<typename T > | |
T | evaluateT (const UT_StringHolder &name, const PDG_WorkItem *work_item=nullptr, int index=0, int multi=-1) const |
Public Member Functions inherited from PDGT_TypeInstance< EnumType > | |
PDGT_TypeInstance () | |
PDGT_TypeInstance (const PDGT_BaseType< EnumType > *base_type, const PDGT_ValueArgs &extra_args) | |
virtual | ~PDGT_TypeInstance () |
const BaseType * | type () const |
const UT_StringHolder & | typeName () const |
const PDGT_ValueArgs & | extraArgs () const |
bool | compareType (const BaseType *other_type, bool deep=true) const |
void | setReloading (bool is_reloading) |
bool | isReloading () const |
Protected Attributes | |
PDG_Node * | myNode |
int | myCallbackBits |
Protected Attributes inherited from PDGT_TypeInstance< EnumType > | |
const BaseType * | myBaseType |
PDGT_ValueArgs | myExtraArgs |
bool | myReloading |
Definition at line 77 of file PDG_NodeCallback.h.
Enumeration of node callbacks. These enum values are a power of 2 since they go into a bit vector for checking the presence of callbacks
Definition at line 93 of file PDG_NodeCallback.h.
Work item generation type.
Enumerator | |
---|---|
eStaticGenerate | |
eDynamicGenerate | |
eStaticRegenerate | |
eDynamicRegenerate |
Definition at line 81 of file PDG_NodeCallback.h.
PDG_NodeCallback::PDG_NodeCallback | ( | const PDG_BaseType * | type, |
const PDGT_ValueArgs & | extra_args, | ||
PDG_Node * | node | ||
) |
|
override |
void PDG_NodeCallback::enableCallback | ( | CallbackType | callback_type | ) |
Enables a specific node callback.
|
inline |
Convenience method for evaluating a parameter on the underlying node.
Definition at line 232 of file PDG_NodeCallback.h.
|
inline |
Convenience method for evaluating a parameter as an array on the underlying node
Definition at line 245 of file PDG_NodeCallback.h.
|
inline |
Evaluates a parameter as a boolean and returns the value back, instead of an error code.
Definition at line 308 of file PDG_NodeCallback.h.
|
inline |
Evaluates a parameter as a float and returns the value back, instead of an error code.
Definition at line 282 of file PDG_NodeCallback.h.
|
inline |
Evaluates a parameter as an integer and returns the value back, instead of an error code.
Definition at line 295 of file PDG_NodeCallback.h.
|
inline |
Evaluates a parameter as a raw string and returns the value back, instead of an error code.
Definition at line 269 of file PDG_NodeCallback.h.
|
inline |
Evaluates a parameter as a string and returns the value back, instead of an error code.
Definition at line 256 of file PDG_NodeCallback.h.
|
inline |
Evaluates a parameter as an arbitrary type and returns the value back, instad of an error code.
Definition at line 322 of file PDG_NodeCallback.h.
|
overridevirtual |
Returns the memory usage of this callback.
Reimplemented from PDGT_TypeInstance< EnumType >.
bool PDG_NodeCallback::hasCallback | ( | CallbackType | callback_type | ) | const |
Returns true if the node callback has the specified callback installed, else returns false
PDG_Node* PDG_NodeCallback::node | ( | ) | const |
Returns the node associated with this callback.
|
virtual |
Adds dependencies between newly created work items. Called on processors.
|
virtual |
Called when the node should describe itself for the UI.
|
virtual |
Called when a work item wants to cook in-process, but does not have its own cook implementation
|
virtual |
Called when a work item is deselcted.
|
virtual |
Generates static items via a work item holder. Called on processors.
|
virtual |
Adds dependencies between dynamic items above a mapper and static items below the mapper.
|
virtual |
Adds dependencies between static itrems below a mapper node and static ancestors above. Called on mapper nodes.
|
virtual |
Groups upstream work items into partitions that can be non-disjoint and do not necessarily cover the set of all items. Called on partitioner nodes.
|
virtual |
Called on each node in the graph after the cook finishes.
|
virtual |
Called when a work item has completed cooking.
|
virtual |
Called before the graph begins cooking. This is only called on nodes that are on the active cook path, and is guaranteed to be called on each node before any threaded cooking begins. If a Failure result is returned from any of the nodes, the cook is aborted
|
virtual |
Called when a work item has all of its dependencies satisfied, and will be submitted to the scheduler or cooked in-process shortly.
|
virtual |
Regenerates static items, only called when items already exist. The callback can add new items, or dirty/delete existing items.
|
virtual |
Called when a work item is selected by TOPs.
PDG_CallbackResult PDG_NodeCallback::postInvoke | ( | PDG_CallbackResult | invoke_result | ) | const |
Performs post callback invocation logic and returns a final callback result
|
overridevirtual |
Resets this node callback to match changes to the type object.
Reimplemented from PDGT_TypeInstance< EnumType >.
|
protected |
Definition at line 335 of file PDG_NodeCallback.h.
|
protected |
Definition at line 334 of file PDG_NodeCallback.h.