HDK
|
#include <DEP_MicroNode.h>
Public Types | |
typedef UT_Function< void(DEP_MicroNode &, DEP_MicroNode &) > | Visitor |
typedef UT_Function< bool(const DEP_MicroNode &, const DEP_MicroNode &) > | TraverseVisitor |
Public Member Functions | |
DEP_MicroNode () | |
virtual | ~DEP_MicroNode () |
virtual const char * | className () const |
virtual void | getInputs (DEP_MicroNodeList &inputs) const |
virtual void | clearInputs () |
virtual void | getOutputs (DEP_MicroNodeList &outputs) const |
virtual void | update (fpreal t) |
virtual bool | requiresUpdate (fpreal t) const |
void | propagateDirty (Visitor client_visit, bool only_outputs=false) |
virtual void | becameDirty (DEP_MicroNode &src, const DEP_PropagateData &propdata) |
void | traverseAncestorInputs (const TraverseVisitor &visitor) const |
Traverse all ancestor inputs of this micronode. More... | |
bool | markVisitPass (int pass) |
SYS_FORCE_INLINE int | lastVisitPass () const |
virtual int64 | getMemoryUsage (bool inclusive) const |
Obtain approximate memory usage. More... | |
virtual void | dump (std::ostream &os, const char *prefix=0, int indent_level=0) const |
Dump contents to output stream, strictly for debugging purposes. More... | |
void | dumpAsDOT (std::ostream &os, const char *prefix=0, int indent_level=0) const |
Dump the contents is a manner more suitable for DOT. More... | |
bool | inheritTimeDependentFromExplicitInputs () |
bool | inheritTimeInterestedFromExplicitInputs () |
bool | inheritContextOptionDepsFromExplicitInputs (const UT_StringArray &ignore_deps) |
void | addExplicitInput (DEP_MicroNode &inp, bool check_dup) |
Methods for manipulating explicit edges. More... | |
SYS_FORCE_INLINE void | addExplicitInput (DEP_MicroNode &inp) |
Add an input that this micronode depends on. More... | |
void | addExplicitInputs (const DEP_MicroNodeList &sources, bool check_dup=true) |
Bulk add multiple explicit inputs at once. More... | |
void | getExplicitInputs (DEP_MicroNodeList &inputs) const |
Get list of all non-null explicit inputs. More... | |
SYS_FORCE_INLINE int | getNumExplicitInputs () const |
Get the number of non-null inputs. More... | |
void | getExplicitOutputs (DEP_MicroNodeList &outputs) const |
Get list of all non-null explicit outputs. More... | |
SYS_FORCE_INLINE int | getNumExplicitOutputs () const |
Get the number of non-null outputs. More... | |
SYS_FORCE_INLINE bool | isDirty () const |
Flag accessors. More... | |
void | setDirty (bool flag, bool allow_clear=true) |
Flag accessors. More... | |
SYS_FORCE_INLINE bool | isTimeDependent () const |
Flag accessors. More... | |
SYS_FORCE_INLINE void | setTimeDependent (bool time_dependent) |
Flag accessors. More... | |
SYS_FORCE_INLINE bool | isTimeInterested () const |
Flag accessors. More... | |
SYS_FORCE_INLINE void | setTimeInterested (bool time_interested) |
Flag accessors. More... | |
SYS_FORCE_INLINE bool | hasContextOptionDeps () const |
Flag accessors. More... | |
SYS_FORCE_INLINE const DEP_ContextOptionDeps & | getContextOptionDeps () const |
Flag accessors. More... | |
SYS_FORCE_INLINE void | addContextOptionDeps (const DEP_ContextOptionDeps &opts) |
Flag accessors. More... | |
SYS_FORCE_INLINE void | addContextOptionDep (const UT_StringHolder &opt) |
Flag accessors. More... | |
SYS_FORCE_INLINE void | clearContextOptionDeps () |
Flag accessors. More... | |
SYS_FORCE_INLINE bool | isOpDataMicroNode () const |
Flag accessors. More... | |
Static Public Member Functions | |
static SYS_FORCE_INLINE bool | canClearDependencies () |
Global control whether dependencies can be cleared. More... | |
static SYS_FORCE_INLINE bool | canEvaluateExports () |
Global control whether we can evaluate exports. More... | |
static SYS_FORCE_INLINE bool | isSameTime (fpreal a, fpreal b) |
Static Public Member Functions inherited from UT_SmallObject< DEP_MicroNode > | |
static void * | operator new (size_t size) |
Regular new/delete operators. More... | |
static void | operator delete (void *p, size_t size) |
Regular new/delete operators. More... | |
static void * | operator new (size_t, void *p) |
static void | operator delete (void *, void *) |
Protected Member Functions | |
SYS_FORCE_INLINE void | setIsOpDataMicroNode (bool b) |
virtual bool | isEvaluating () const |
virtual void | evaluateExports () |
virtual bool | isExporting () const |
Friends | |
class | dep_Visitor |
class | DEP_KeepDependenciesScope |
class | DEP_BlockEvaluateExportsScope |
Represent an atomic unit of computation for dependency tracking.
DEP_MicroNode's form a dependency graph that are connected both implicitly and explicitly. The base class maintains the explicit edges while subclasses maintain the implicit edges by overriding the getInputs()/getOutputs() methods.
Definition at line 60 of file DEP_MicroNode.h.
typedef UT_Function< bool (const DEP_MicroNode & , const DEP_MicroNode & ) > DEP_MicroNode::TraverseVisitor |
Definition at line 140 of file DEP_MicroNode.h.
typedef UT_Function< void (DEP_MicroNode & , DEP_MicroNode & ) > DEP_MicroNode::Visitor |
Definition at line 136 of file DEP_MicroNode.h.
DEP_MicroNode::DEP_MicroNode | ( | ) |
|
virtual |
|
inline |
Flag accessors.
Definition at line 258 of file DEP_MicroNode.h.
|
inline |
Flag accessors.
Definition at line 250 of file DEP_MicroNode.h.
void DEP_MicroNode::addExplicitInput | ( | DEP_MicroNode & | inp, |
bool | check_dup | ||
) |
Methods for manipulating explicit edges.
Add an input that this micronode depends on, with control on whether to check for duplicates.
|
inline |
Add an input that this micronode depends on.
Definition at line 107 of file DEP_MicroNode.h.
void DEP_MicroNode::addExplicitInputs | ( | const DEP_MicroNodeList & | sources, |
bool | check_dup = true |
||
) |
Bulk add multiple explicit inputs at once.
|
inlinevirtual |
Callbacks for what to do when the micronode becomes dirty. Derived micronodes can override this. Note that it requires knowledge of who made it dirty as they may behave differently. Currently used by OP_Node::propagateDirtyMicroNode
Reimplemented in OP_DataMicroNode, VOP_SnippetMicroNode, COP_MicroNodeWithCallback, SIM_SimulationMicroNode, OP_ParmMicroNode, OP_NamedDataMicroNode, OP_EventMicroNode, and LOP_CheckpointMicroNode.
Definition at line 160 of file DEP_MicroNode.h.
|
inlinestatic |
Global control whether dependencies can be cleared.
Definition at line 278 of file DEP_MicroNode.h.
|
inlinestatic |
Global control whether we can evaluate exports.
Definition at line 283 of file DEP_MicroNode.h.
|
inlinevirtual |
Reimplemented in VOP_SnippetMicroNode, PRM_ParmMicroNode, SIM_SimulationMicroNode, PRM_ConstMicroNode, OP_NamedDataMicroNode, DEP_TimedMicroNode, OP_DopParentMicroNode, OP_ParmMicroNode, OP_EventMicroNode, VOP_ErrorMicroNode, VOP_ExportedParmLayoutMicroNode, VOP_ParmDSMicroNode, OP_DataMicroNode, VOP_DataMicroNode, and OP_ContextOptionsMicroNode.
Definition at line 68 of file DEP_MicroNode.h.
|
inline |
Flag accessors.
Definition at line 265 of file DEP_MicroNode.h.
|
virtual |
Clear all inputs, including any state data related to them. Default implementation just calls clearExplicitInputs() and setTimeDependent(false).
Reimplemented in GusdOP_ParmChangeMicroNode, PRM_ParmMicroNode, OP_DataMicroNode, and VOP_ErrorMicroNode.
|
virtual |
Dump contents to output stream, strictly for debugging purposes.
Reimplemented in PRM_ParmMicroNode, OP_DataMicroNode, and OP_ParmMicroNode.
void DEP_MicroNode::dumpAsDOT | ( | std::ostream & | os, |
const char * | prefix = 0 , |
||
int | indent_level = 0 |
||
) | const |
Dump the contents is a manner more suitable for DOT.
|
inlineprotectedvirtual |
evaluateExports() is called after isExporting() is noted to be true during a dirty propagation pass initiated by dirtySubtree().
Reimplemented in OP_DataMicroNode.
Definition at line 305 of file DEP_MicroNode.h.
|
inline |
Flag accessors.
Definition at line 246 of file DEP_MicroNode.h.
void DEP_MicroNode::getExplicitInputs | ( | DEP_MicroNodeList & | inputs | ) | const |
Get list of all non-null explicit inputs.
void DEP_MicroNode::getExplicitOutputs | ( | DEP_MicroNodeList & | outputs | ) | const |
Get list of all non-null explicit outputs.
|
virtual |
Get list of all our non-null inputs, both implicit and explicit. The base class returns the list of explicit inputs.
Reimplemented in VIS_MountMicroNode, VIS_ParmsMicroNode, PRM_ConstMicroNode, OP_DataMicroNode, VOP_ErrorMicroNode, VOP_ExportedParmLayoutMicroNode, and VOP_ParmDSMicroNode.
|
virtual |
Obtain approximate memory usage.
Reimplemented in PRM_ParmMicroNode, OP_DataMicroNode, and PRM_ConstMicroNode.
|
inline |
Get the number of non-null inputs.
Definition at line 120 of file DEP_MicroNode.h.
|
inline |
Get the number of non-null outputs.
Definition at line 128 of file DEP_MicroNode.h.
|
virtual |
Get list of all our non-null outputs, both implicit and explicit. The base class returns the list of explicit outputs.
Reimplemented in PRM_ParmMicroNode, VIS_MountMicroNode, VIS_ParmsMicroNode, OP_DataMicroNode, OP_ParmMicroNode, VOP_ErrorMicroNode, VOP_ParmDSMicroNode, and VOP_DataMicroNode.
|
inline |
Flag accessors.
Definition at line 242 of file DEP_MicroNode.h.
bool DEP_MicroNode::inheritContextOptionDepsFromExplicitInputs | ( | const UT_StringArray & | ignore_deps | ) |
Inherit extra dependencies from all explicit inputs. The ignore_deps string array MUST BE SORTED. Returns true if any extra dependencies are found.
bool DEP_MicroNode::inheritTimeDependentFromExplicitInputs | ( | ) |
Set time dependent flag if any explicit inputs are set. Returns true if any explicit inputs are true.
bool DEP_MicroNode::inheritTimeInterestedFromExplicitInputs | ( | ) |
Set time interested flag if any explicit inputs are set. Returns true if any explicit inputs are true.
|
inline |
Flag accessors.
Definition at line 214 of file DEP_MicroNode.h.
|
inlineprotectedvirtual |
These methods are overriden by subclasses to be used by the dirty propagation algorithm.Used to determine if a micronode is currently evaluating. If this returns true, during dirty propagation, it will prevent dependencies from being removed from it.
Reimplemented in OP_DataMicroNode.
Definition at line 300 of file DEP_MicroNode.h.
|
inlineprotectedvirtual |
Used to determine if a micronode requires its exports to be evaluated during the propagation pass.
Reimplemented in OP_DataMicroNode.
Definition at line 309 of file DEP_MicroNode.h.
|
inline |
Flag accessors.
Definition at line 271 of file DEP_MicroNode.h.
|
inlinestatic |
One true method to compare equality of time values for caching. This particular form originates from what OP_Node::cook() did from the dawn of time.
Definition at line 289 of file DEP_MicroNode.h.
|
inline |
Flag accessors.
Definition at line 228 of file DEP_MicroNode.h.
|
inline |
Flag accessors.
Definition at line 235 of file DEP_MicroNode.h.
|
inline |
Definition at line 180 of file DEP_MicroNode.h.
|
inline |
Mark this micronode as having seen the given global dirty counter. Returns false if we've already seen it.
Definition at line 171 of file DEP_MicroNode.h.
Mark this micronode and all its dependents as dirty. The global dirty counter will be incremented once for each call to propagateDirty().
client_visit | Called for each micronode that is dirtied |
only_outputs | If true, then *this is ommitted from being dirtied |
|
inlinevirtual |
requiresUpdate() specifies if the micro-node was dirtied, possibly based on the time t. By default, it returns isDirty() but subclasses override this to handle other conditions that make this micro-node requiring an update.
Reimplemented in OP_DataMicroNode, DEP_TimedMicroNode, and OP_ContextOptionsMicroNode.
Definition at line 94 of file DEP_MicroNode.h.
|
inline |
Flag accessors.
Definition at line 216 of file DEP_MicroNode.h.
|
inlineprotected |
Definition at line 315 of file DEP_MicroNode.h.
|
inline |
Flag accessors.
Definition at line 231 of file DEP_MicroNode.h.
|
inline |
Flag accessors.
Definition at line 238 of file DEP_MicroNode.h.
void DEP_MicroNode::traverseAncestorInputs | ( | const TraverseVisitor & | visitor | ) | const |
Traverse all ancestor inputs of this micronode.
update() is used by users of micro-nodes to mark this node as clean at the given time t. By default, it simply marks it as no longer dirty but subclasses override this to do more work.
Reimplemented in GusdOP_ParmChangeMicroNode, OP_DataMicroNode, DEP_TimedMicroNode, and OP_ContextOptionsMicroNode.
Definition at line 87 of file DEP_MicroNode.h.
|
friend |
Definition at line 367 of file DEP_MicroNode.h.
|
friend |
Definition at line 366 of file DEP_MicroNode.h.
|
friend |
Definition at line 365 of file DEP_MicroNode.h.