DEP_MicroNode Class Reference

#include <DEP_MicroNode.h>

Inheritance diagram for DEP_MicroNode:

UT_SmallObject< UT_NonCopyable > UT_SmallObjectDefaultSuperClass OP_DataMicroNode PRM_ParmMicroNode OP_ParmMicroNode

List of all members.

Public Types

typedef boost::function2< void,
DEP_MicroNode &, DEP_MicroNode & > 
Visitor
typedef bool(DEP_MicroNode::* GetFlag )() const
typedef void(DEP_MicroNode::* SetFlag )(bool flag)

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)
bool markVisitPass (int pass)
int lastVisitPass () const
virtual exint getMemUsage (bool include_this) const
 Obtain approximate memory usage.
virtual void dump (std::ostream &os, const char *prefix=0, int indent_level=0) const
 Dump contents to output stream, strictly for debugging purposes.
void dumpAsDOT (std::ostream &os, const char *prefix=0, int indent_level=0) const
 Dump the contents is a manner more suitable for DOT.
void addExplicitInput (DEP_MicroNode &inp)
 Methods for manipulating explicit edges.
void getExplicitInputs (DEP_MicroNodeList &inputs) const
 Get list of all non-null explicit inputs.
int getNumExplicitInputs () const
 Get the number of non-null inputs.
int getNumExplicitOutputs () const
 Get the number of non-null outputs.
bool isDirty () const
 Flag accessors.
void setDirty (bool flag, bool allow_clear=true)
 Flag accessors.
bool isTimeDependent () const
 Flag accessors.
void setTimeDependent (bool time_dependent)
 Flag accessors.
bool isTimeInterested () const
 Flag accessors.
void setTimeInterested (bool time_interested)
 Flag accessors.

Static Public Member Functions

static bool canClearDependencies ()
 Global control whether dependencies can be cleared.

Protected Member Functions

virtual bool isEvaluating () const
virtual void evaluateExports ()
virtual bool isExporting () const

Friends

class dep_Visitor
class DEP_KeepDependenciesScope


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 50 of file DEP_MicroNode.h.


Member Typedef Documentation

typedef bool(DEP_MicroNode::* DEP_MicroNode::GetFlag)() const

Definition at line 157 of file DEP_MicroNode.h.

typedef void(DEP_MicroNode::* DEP_MicroNode::SetFlag)(bool flag)

Definition at line 158 of file DEP_MicroNode.h.

typedef boost::function2< void, DEP_MicroNode & , DEP_MicroNode & > DEP_MicroNode::Visitor

Definition at line 114 of file DEP_MicroNode.h.


Constructor & Destructor Documentation

DEP_MicroNode::DEP_MicroNode (  ) 

virtual DEP_MicroNode::~DEP_MicroNode (  )  [virtual]


Member Function Documentation

void DEP_MicroNode::addExplicitInput ( DEP_MicroNode inp  ) 

Methods for manipulating explicit edges.

Add an input that this micronode depends on

static bool DEP_MicroNode::canClearDependencies (  )  [inline, static]

Global control whether dependencies can be cleared.

Definition at line 187 of file DEP_MicroNode.h.

virtual const char* DEP_MicroNode::className ( void   )  const [inline, virtual]

Reimplemented in OP_DataMicroNode, OP_ParmMicroNode, and PRM_ParmMicroNode.

Definition at line 57 of file DEP_MicroNode.h.

virtual void DEP_MicroNode::clearInputs (  )  [inline, virtual]

Clear all inputs, including any state data related to them. Default implementation just calls clearExplicitInputs() and setTimeDependent(false).

Reimplemented in OP_DataMicroNode, and PRM_ParmMicroNode.

Definition at line 67 of file DEP_MicroNode.h.

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 OP_DataMicroNode, OP_ParmMicroNode, and PRM_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 (  )  [inline, protected, virtual]

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 204 of file DEP_MicroNode.h.

void DEP_MicroNode::getExplicitInputs ( DEP_MicroNodeList inputs  )  const

Get list of all non-null explicit inputs.

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 OP_DataMicroNode.

virtual exint DEP_MicroNode::getMemUsage ( bool  include_this  )  const [virtual]

Obtain approximate memory usage.

Reimplemented in OP_DataMicroNode, and PRM_ParmMicroNode.

int DEP_MicroNode::getNumExplicitInputs (  )  const [inline]

Get the number of non-null inputs.

Definition at line 101 of file DEP_MicroNode.h.

int DEP_MicroNode::getNumExplicitOutputs (  )  const [inline]

Get the number of non-null outputs.

Definition at line 105 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 OP_DataMicroNode, and OP_ParmMicroNode.

bool DEP_MicroNode::isDirty (  )  const [inline]

Flag accessors.

Definition at line 162 of file DEP_MicroNode.h.

virtual bool DEP_MicroNode::isEvaluating (  )  const [inline, protected, virtual]

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 199 of file DEP_MicroNode.h.

virtual bool DEP_MicroNode::isExporting (  )  const [inline, protected, virtual]

Used to determine if a micronode requires its exports to be evaluated during the propagation pass.

Reimplemented in OP_DataMicroNode.

Definition at line 208 of file DEP_MicroNode.h.

bool DEP_MicroNode::isTimeDependent (  )  const [inline]

Flag accessors.

Definition at line 175 of file DEP_MicroNode.h.

bool DEP_MicroNode::isTimeInterested (  )  const [inline]

Flag accessors.

Definition at line 180 of file DEP_MicroNode.h.

int DEP_MicroNode::lastVisitPass (  )  const [inline]

Definition at line 140 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 132 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_visit Called for each micronode that is dirtied
only_outputs If 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 [inline, virtual]

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.

Definition at line 87 of file DEP_MicroNode.h.

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

Flag accessors.

Definition at line 164 of file DEP_MicroNode.h.

void DEP_MicroNode::setTimeDependent ( bool  time_dependent  )  [inline]

Flag accessors.

Definition at line 177 of file DEP_MicroNode.h.

void DEP_MicroNode::setTimeInterested ( bool  time_interested  )  [inline]

Flag accessors.

Definition at line 182 of file DEP_MicroNode.h.

virtual void DEP_MicroNode::update ( fpreal  t  )  [inline, virtual]

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 OP_DataMicroNode.

Definition at line 80 of file DEP_MicroNode.h.


Friends And Related Function Documentation

friend class DEP_KeepDependenciesScope [friend]

Definition at line 262 of file DEP_MicroNode.h.

friend class dep_Visitor [friend]

Definition at line 261 of file DEP_MicroNode.h.


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

Generated on Thu Jan 31 00:30:26 2013 for HDK by  doxygen 1.5.9