9 #ifndef __PDG_NODE_CALLBACK_H__
10 #define __PDG_NODE_CALLBACK_H__
23 #define _PDG_INVOKE_CALLBACK(result, type, state, node, item, ...) \
25 PDG_LogUtils::nodeLog( \
26 PDG_LogUtils::eNodeDebugCallback, node, "CALLBACK on" #type, \
27 UT_StringHolder::theEmptyString); \
28 UT_WorkBuffer _event_path; \
29 bool path_has_item = node->performancePath(_event_path, #type, item); \
30 UT_PerfMonAutoPDGCookEvent event( \
31 _event_path.buffer(), (path_has_item ? nullptr : #type)); \
32 PDG_EvaluationContext::StateScope scope(SYSgetSTID(), state, \
33 false, node, item, node->context()); \
38 result = node->callback()->postInvoke( \
39 node->callback()->on ## type (__VA_ARGS__)); \
43 result = PDG_CallbackResult::eFailure; \
48 #define PDG_NODE_CALLBACK(result, type, state, node, ...) \
50 result = PDG_CallbackResult::eMissing; \
51 if (node->callback()->hasCallback(PDG_NodeCallback::e ## type))\
53 _PDG_INVOKE_CALLBACK( \
54 result, type, state, node, nullptr, __VA_ARGS__); \
58 #define PDG_TASK_CALLBACK(result, type, item) \
60 result = PDG_CallbackResult::eMissing; \
61 if (item->node()->callback()->hasCallback(PDG_NodeCallback::e ## type)) \
63 PDG_AttributeMap::ScopedLock<false> auto_lock(item->attributes()); \
64 _PDG_INVOKE_CALLBACK( \
65 result, type, PDG_EvaluationContext::eStateCooking, \
66 item->node(), item, item); \
86 eStaticRegenerate = 2,
87 eDynamicRegenerate = 3,
98 eAddInternalDependencies = 0x0004,
102 eMapDynamic = 0x0020,
107 ePrepareTask = 0x0100,
109 ePostCookTask = 0x0400,
111 eSelectTask = 0x0800,
112 eDeselectTask = 0x1000,
114 eConfigureNode = 0x2000,
116 eProcessorBits =
eGenerate | eRegenerate | eConfigureNode,
118 eMapperBits = eMapStatic | eMapDynamic,
132 bool hasCallback(CallbackType callback_type)
const;
135 void enableCallback(CallbackType callback_type);
150 GenerationType generation_type);
158 GenerationType generation_type);
231 template <
typename T>
239 return myNode->evaluate(result, name, work_item,
index, multi);
244 template <
typename T>
251 return myNode->evaluate(result, name, work_item, multi);
263 myNode->evaluate(result, name, work_item,
index, multi);
276 myNode->evaluateRaw(result, name, work_item,
index, multi);
289 myNode->evaluate(result, name, work_item,
index, multi);
302 myNode->evaluate(result, name, work_item,
index, multi);
315 myNode->evaluate(result, name, work_item,
index, multi);
321 template <
typename T>
329 myNode->evaluate(
result, name, work_item,
index, multi);
UT_StringHolder evaluateS(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
**But if you need a result
exint evaluateI(const UT_StringHolder &name, const PDG_WorkItem *work_item=nullptr, int index=0, int multi=-1) const
virtual bool reloadInstance(UT_WorkBuffer &errors)
virtual int64 getMemoryUsage(bool inclusive) const
T evaluateT(const UT_StringHolder &name, const PDG_WorkItem *work_item=nullptr, int index=0, int multi=-1) const
GLuint const GLchar * name
bool evaluateB(const UT_StringHolder &name, const PDG_WorkItem *work_item=nullptr, int index=0, int multi=-1) const
bool evaluateArray(T &result, const UT_StringHolder &name, const PDG_WorkItem *work_item=nullptr, int multi=-1) const
PDG_CallbackResult
Enumeration of callback return types.
GenerationType
Work item generation type.
UT_StringHolder evaluateRaw(const UT_StringHolder &name, const PDG_WorkItem *work_item=nullptr, int index=0, int multi=-1) const
A partition, which has a list of upstream components.
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.