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(
121 {
return countEdges(myExplicitInputs); }
124 void getExplicitOutputs(
129 {
return countEdges(myExplicitOutputs); }
154 bool only_outputs =
false);
166 void traverseAncestorInputs(
167 const TraverseVisitor &visitor)
const;
173 if (myLastVisitPass == pass)
175 myLastVisitPass = pass;
181 {
return myLastVisitPass; }
184 virtual int64 getMemoryUsage(
bool inclusive)
const;
189 const char *prefix = 0,
190 int indent_level = 0)
const;
194 const char *prefix = 0,
195 int indent_level = 0)
const;
199 bool inheritTimeDependentFromExplicitInputs();
203 bool inheritTimeInterestedFromExplicitInputs();
208 bool inheritContextOptionDepsFromExplicitInputs(
221 && canClearDependencies())
229 {
return myTimeDependent; }
232 { myTimeDependent = time_dependent; }
236 {
return myTimeInterested; }
239 { myTimeInterested = time_interested; }
243 {
return myContextOptionDeps &&
244 !myContextOptionDeps->empty(); }
248 myContextOptionDeps); }
252 {
if (opts.empty())
return;
255 &myContextOptionDepsLock).insert(
256 opts.begin(), opts.end()); }
262 &myContextOptionDepsLock).
267 myContextOptionDepsLock);
268 myContextOptionDeps.reset(); }
272 {
return myIsOPDataMicroNode; }
279 {
return (theKeepDependenciesCount == 0); }
284 {
return (theBlockEvaluateExports == 0); }
316 { myIsOPDataMicroNode =
b; }
323 typedef UT_ConcurrentVector<DEP_MicroNode *> MicroNodeOutputPtrVector;
326 void clearExplicitInputs();
327 void clearExplicitOutputs();
329 void compactExplicitInputsAndOutputs();
331 static void compactVector(
332 MicroNodeOutputPtrVector &vec);
333 static void compactVector(
334 MicroNodeInputPtrVector &vec);
336 template <
typename MICRONODE_ARRAY>
337 static void getEdgeList(
338 const MICRONODE_ARRAY &edges,
340 template <
typename MICRONODE_ARRAY>
341 static int countEdges(
const MICRONODE_ARRAY &edges);
347 EdgeLock myExplicitInputsLock;
348 MicroNodeInputPtrVector myExplicitInputs;
349 MicroNodePtrSet myExplicitInputsSet;
350 MicroNodeOutputPtrVector myExplicitOutputs;
358 bool myTimeDependent;
359 bool myTimeInterested;
360 bool myIsOPDataMicroNode;
362 static int theKeepDependenciesCount;
363 static int theBlockEvaluateExports;
365 friend class dep_Visitor;
375 { ++DEP_MicroNode::theKeepDependenciesCount; }
377 { --DEP_MicroNode::theKeepDependenciesCount; }
386 { ++DEP_MicroNode::theBlockEvaluateExports; }
388 { --DEP_MicroNode::theBlockEvaluateExports; }
396 template <
typename MICRONODE_ARRAY>
399 DEP_MicroNode::countEdges(
const MICRONODE_ARRAY &edges)
410 #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