11 #ifndef __DEP_MICRONODE_H_INCLUDED__
12 #define __DEP_MICRONODE_H_INCLUDED__
44 void setExprChange(
bool expr_change)
45 { myExprChange = expr_change; }
47 {
return myExprChange; }
68 virtual const
char * className()
const
69 {
return "DEP_MicroNode"; }
78 virtual void clearInputs();
102 void addExplicitInput(
108 { addExplicitInput(inp,
true); }
111 void addExplicitInputs(
113 bool check_dup =
true);
116 void getExplicitInputs(
120 bool hasExplicitInput(
125 {
return countEdges(myExplicitInputs); }
128 void getExplicitOutputs(
133 {
return countEdges(myExplicitOutputs); }
158 bool only_outputs =
false);
170 void traverseAncestorInputs(
171 const TraverseVisitor &visitor)
const;
177 if (myLastVisitPass == pass)
179 myLastVisitPass = pass;
185 {
return myLastVisitPass; }
188 virtual int64 getMemoryUsage(
bool inclusive)
const;
193 const char *prefix =
nullptr,
194 int indent_level = 0)
const;
198 const char *prefix =
nullptr,
199 int indent_level = 0)
const;
203 bool inheritTimeDependentFromExplicitInputs();
207 bool inheritTimeInterestedFromExplicitInputs();
212 bool inheritContextOptionDepsFromExplicitInputs(
225 && canClearDependencies())
233 {
return myTimeDependent; }
236 { myTimeDependent = time_dependent; }
240 {
return myTimeInterested; }
243 { myTimeInterested = time_interested; }
247 {
return myContextOptionDeps &&
248 !myContextOptionDeps->empty(); }
252 myContextOptionDeps); }
256 {
if (opts.empty())
return;
259 &myContextOptionDepsLock).insert(
260 opts.begin(), opts.end()); }
266 &myContextOptionDepsLock).
271 myContextOptionDepsLock);
272 myContextOptionDeps.reset(); }
276 {
return myIsOPDataMicroNode; }
283 {
return (theKeepDependenciesCount == 0); }
288 {
return (theBlockEvaluateExports == 0); }
320 { myIsOPDataMicroNode =
b; }
327 typedef UT_ConcurrentVector<DEP_MicroNode *> MicroNodeOutputPtrVector;
330 void clearExplicitInputs();
331 void clearExplicitOutputs();
333 void compactExplicitInputsAndOutputs();
335 static void compactVector(
336 MicroNodeOutputPtrVector &vec);
337 static void compactVector(
338 MicroNodeInputPtrVector &vec);
340 template <
typename MICRONODE_ARRAY>
341 static void getEdgeList(
342 const MICRONODE_ARRAY &edges,
344 template <
typename MICRONODE_ARRAY>
345 static int countEdges(
const MICRONODE_ARRAY &edges);
351 EdgeLock myExplicitInputsLock;
352 MicroNodeInputPtrVector myExplicitInputs;
353 MicroNodePtrSet myExplicitInputsSet;
354 MicroNodeOutputPtrVector myExplicitOutputs;
362 bool myTimeDependent;
363 bool myTimeInterested;
364 bool myIsOPDataMicroNode;
366 static int theKeepDependenciesCount;
367 static int theBlockEvaluateExports;
369 friend class dep_Visitor;
379 { ++DEP_MicroNode::theKeepDependenciesCount; }
381 { --DEP_MicroNode::theKeepDependenciesCount; }
390 { ++DEP_MicroNode::theBlockEvaluateExports; }
392 { --DEP_MicroNode::theBlockEvaluateExports; }
400 template <
typename MICRONODE_ARRAY>
403 DEP_MicroNode::countEdges(
const MICRONODE_ARRAY &edges)
414 #endif // __DEP_MICRONODE_H_INCLUDED__
SYS_FORCE_INLINE void setTimeDependent(bool time_dependent)
Flag accessors.
UT_UniquePtr< DEP_ContextOptionDeps > DEP_ContextOptionDepsPtr
virtual void becameDirty(DEP_MicroNode &src, const DEP_PropagateData &propdata)
static SYS_FORCE_INLINE bool isSameTime(fpreal a, fpreal b)
virtual void update(fpreal t)
Global control whether dependencies can be cleared.
SYS_FORCE_INLINE bool isDirty() const
Flag accessors.
virtual bool requiresUpdate(fpreal t) const
DEP_API const DEP_ContextOptionDeps & DEPgetContextOptionDepsFromPtr(const DEP_ContextOptionDepsPtr &ptr)
SYS_FORCE_INLINE bool isTimeInterested() const
Flag accessors.
UT_ConcurrentSet< UT_StringHolder > DEP_ContextOptionDeps
UT_Array< DEP_MicroNode * > DEP_MicroNodeList
virtual bool isExporting() const
GLboolean GLboolean GLboolean GLboolean a
SYS_FORCE_INLINE const DEP_ContextOptionDeps & getContextOptionDeps() const
Flag accessors.
OIIO_FORCEINLINE vbool4 insert(const vbool4 &a, bool val)
Helper: substitute val for a[i].
UT_Function< bool(const DEP_MicroNode &, const DEP_MicroNode &) > TraverseVisitor
void setDirty(bool flag, bool allow_clear=true)
Flag accessors.
~DEP_BlockEvaluateExportsScope()
~DEP_KeepDependenciesScope()
bool markVisitPass(int pass)
SYS_FORCE_INLINE void setIsOpDataMicroNode(bool b)
SYS_FORCE_INLINE int lastVisitPass() const
DEP_BlockEvaluateExportsScope()
SYS_FORCE_INLINE void clearContextOptionDeps()
Flag accessors.
UT_Function< void(DEP_MicroNode &, DEP_MicroNode &) > Visitor
SYS_FORCE_INLINE int getNumExplicitInputs() const
Get the number of non-null inputs.
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
virtual bool isEvaluating() const
SYS_FORCE_INLINE bool isTimeDependent() const
Flag accessors.
SYS_FORCE_INLINE void addContextOptionDep(const UT_StringHolder &opt)
Flag accessors.
static SYS_FORCE_INLINE bool canClearDependencies()
Global control whether dependencies can be cleared.
Global control whether we can evaluate exports.
std::function< T > UT_Function
GLboolean GLboolean GLboolean b
SYS_FORCE_INLINE void addExplicitInput(DEP_MicroNode &inp)
Add an input that this micronode depends on.
bool SYSequalZero(const UT_Vector3T< T > &v)
static SYS_FORCE_INLINE bool canEvaluateExports()
Global control whether we can evaluate exports.
SYS_FORCE_INLINE bool hasContextOptionDeps() const
Flag accessors.
virtual void evaluateExports()
SYS_FORCE_INLINE void setTimeInterested(bool time_interested)
Flag accessors.
SYS_FORCE_INLINE bool isOpDataMicroNode() const
Flag accessors.
Propagation info for a dep micro node.
SYS_FORCE_INLINE void addContextOptionDeps(const DEP_ContextOptionDeps &opts)
Flag accessors.
DEP_API DEP_ContextOptionDeps & DEPcreateContextOptionDepsFromPtr(DEP_ContextOptionDepsPtr &ptr, DEP_ContextOptionDepsLock *lock=nullptr)
SYS_FORCE_INLINE int getNumExplicitOutputs() const
Get the number of non-null outputs.
bool isExprChange() const
DEP_KeepDependenciesScope()
SYS_FORCE_INLINE bool isstring() const