HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DEP_MicroNode Class Reference

#include <DEP_MicroNode.h>

+ Inheritance diagram for DEP_MicroNode:

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 voidoperator new (size_t size)
 Regular new/delete operators. More...
 
static void operator delete (void *p, size_t size)
 Regular new/delete operators. More...
 
static voidoperator 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
 

Detailed Description

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.

Member Typedef Documentation

Definition at line 136 of file DEP_MicroNode.h.

Constructor & Destructor Documentation

DEP_MicroNode::DEP_MicroNode ( )
virtual DEP_MicroNode::~DEP_MicroNode ( )
virtual

Member Function Documentation

SYS_FORCE_INLINE void DEP_MicroNode::addContextOptionDep ( const UT_StringHolder opt)
inline

Flag accessors.

Definition at line 258 of file DEP_MicroNode.h.

SYS_FORCE_INLINE void DEP_MicroNode::addContextOptionDeps ( const DEP_ContextOptionDeps opts)
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.

SYS_FORCE_INLINE void DEP_MicroNode::addExplicitInput ( DEP_MicroNode inp)
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.

virtual void DEP_MicroNode::becameDirty ( DEP_MicroNode src,
const DEP_PropagateData propdata 
)
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, SIM_SimulationMicroNode, OP_ParmMicroNode, OP_NamedDataMicroNode, OP_EventMicroNode, and LOP_CheckpointMicroNode.

Definition at line 160 of file DEP_MicroNode.h.

static SYS_FORCE_INLINE bool DEP_MicroNode::canClearDependencies ( )
inlinestatic

Global control whether dependencies can be cleared.

Definition at line 278 of file DEP_MicroNode.h.

static SYS_FORCE_INLINE bool DEP_MicroNode::canEvaluateExports ( )
inlinestatic

Global control whether we can evaluate exports.

Definition at line 283 of file DEP_MicroNode.h.

SYS_FORCE_INLINE void DEP_MicroNode::clearContextOptionDeps ( )
inline

Flag accessors.

Definition at line 265 of file DEP_MicroNode.h.

virtual void DEP_MicroNode::clearInputs ( )
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 void DEP_MicroNode::dump ( std::ostream &  os,
const char *  prefix = 0,
int  indent_level = 0 
) const
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.

virtual void DEP_MicroNode::evaluateExports ( )
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.

SYS_FORCE_INLINE const DEP_ContextOptionDeps& DEP_MicroNode::getContextOptionDeps ( ) const
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 void DEP_MicroNode::getInputs ( DEP_MicroNodeList inputs) const
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 int64 DEP_MicroNode::getMemoryUsage ( bool  inclusive) const
virtual

Obtain approximate memory usage.

Reimplemented in PRM_ParmMicroNode, OP_DataMicroNode, and PRM_ConstMicroNode.

SYS_FORCE_INLINE int DEP_MicroNode::getNumExplicitInputs ( ) const
inline

Get the number of non-null inputs.

Definition at line 120 of file DEP_MicroNode.h.

SYS_FORCE_INLINE int DEP_MicroNode::getNumExplicitOutputs ( ) const
inline

Get the number of non-null outputs.

Definition at line 128 of file DEP_MicroNode.h.

virtual void DEP_MicroNode::getOutputs ( DEP_MicroNodeList outputs) const
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.

SYS_FORCE_INLINE bool DEP_MicroNode::hasContextOptionDeps ( ) const
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.

SYS_FORCE_INLINE bool DEP_MicroNode::isDirty ( ) const
inline

Flag accessors.

Definition at line 214 of file DEP_MicroNode.h.

virtual bool DEP_MicroNode::isEvaluating ( ) const
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.

virtual bool DEP_MicroNode::isExporting ( ) const
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.

SYS_FORCE_INLINE bool DEP_MicroNode::isOpDataMicroNode ( ) const
inline

Flag accessors.

Definition at line 271 of file DEP_MicroNode.h.

static SYS_FORCE_INLINE bool DEP_MicroNode::isSameTime ( fpreal  a,
fpreal  b 
)
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.

SYS_FORCE_INLINE bool DEP_MicroNode::isTimeDependent ( ) const
inline

Flag accessors.

Definition at line 228 of file DEP_MicroNode.h.

SYS_FORCE_INLINE bool DEP_MicroNode::isTimeInterested ( ) const
inline

Flag accessors.

Definition at line 235 of file DEP_MicroNode.h.

SYS_FORCE_INLINE int DEP_MicroNode::lastVisitPass ( ) const
inline

Definition at line 180 of file DEP_MicroNode.h.

bool DEP_MicroNode::markVisitPass ( int  pass)
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.

void DEP_MicroNode::propagateDirty ( Visitor  client_visit,
bool  only_outputs = false 
)

Mark this micronode and all its dependents as dirty. The global dirty counter will be incremented once for each call to propagateDirty().

Parameters
client_visitCalled for each micronode that is dirtied
only_outputsIf true, then *this is ommitted from being dirtied
Note
This method is NOT thread-safe with any operation on any micronode. Only call this when no other micronode operations are running.
virtual bool DEP_MicroNode::requiresUpdate ( fpreal  t) const
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.

void DEP_MicroNode::setDirty ( bool  flag,
bool  allow_clear = true 
)
inline

Flag accessors.

Definition at line 216 of file DEP_MicroNode.h.

SYS_FORCE_INLINE void DEP_MicroNode::setIsOpDataMicroNode ( bool  b)
inlineprotected

Definition at line 315 of file DEP_MicroNode.h.

SYS_FORCE_INLINE void DEP_MicroNode::setTimeDependent ( bool  time_dependent)
inline

Flag accessors.

Definition at line 231 of file DEP_MicroNode.h.

SYS_FORCE_INLINE void DEP_MicroNode::setTimeInterested ( bool  time_interested)
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.

virtual void DEP_MicroNode::update ( fpreal  t)
inlinevirtual

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.

Friends And Related Function Documentation

Definition at line 367 of file DEP_MicroNode.h.

Definition at line 366 of file DEP_MicroNode.h.

friend class dep_Visitor
friend

Definition at line 365 of file DEP_MicroNode.h.


The documentation for this class was generated from the following file: