HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OP_DataMicroNode.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: OP_DataMicroNode.h (OP Library, C++)
7  *
8  * COMMENTS: DEP_MicroNode subclass representing an OP_Node's output data.
9  */
10 
11 #ifndef __OP_DATAMICRONODE_H_INCLUDED__
12 #define __OP_DATAMICRONODE_H_INCLUDED__
13 
14 #include "OP_API.h"
15 #include "OP_Version.h"
16 #include <DEP/DEP_MicroNode.h>
17 #include <SYS/SYS_Math.h>
18 #include <SYS/SYS_Types.h>
19 
20 class OP_Node;
21 
23 {
24 public:
26 
27  virtual const char * className() const
28  { return "OP_DataMicroNode"; }
29 
30  void getParmInputs(DEP_MicroNodeList &inputs) const;
31  void getUsedDataInputs(DEP_MicroNodeList &inputs) const;
32 
33  virtual void getInputs(DEP_MicroNodeList &inputs) const;
34  virtual void clearInputs();
35  virtual void getOutputs(DEP_MicroNodeList &inputs) const;
36 
37  /// update() is used by users of micro-nodes to mark this node as clean at
38  /// the given time t.
39  virtual void update(fpreal t);
40 
41  /// requiresUpdate() specifies if the micro-node was dirtied, possibly
42  /// based on the time t.
43  virtual bool requiresUpdate(fpreal t) const;
44 
45  /// Used to determine if a micronode is currently evaluating. If this
46  /// returns true, during dirty propagation, it will prevent dependencies
47  /// from being removed from it.
48  virtual bool isEvaluating() const;
49 
50  /// evaluateExports() is called after isExporting() is noted to be true
51  /// during a dirty propagation pass initiated by dirtySubtree().
52  virtual void evaluateExports();
53 
54  /// Used to determine if a micronode requires its exports to be evaluated
55  /// during the propagation pass.
56  virtual bool isExporting() const;
57 
58  virtual int64 getMemoryUsage(bool inclusive) const;
59 
60  virtual void dump(
61  std::ostream &os,
62  const char *prefix = 0,
63  int indent_level = 0) const;
64 
65  OP_Node & ownerNode() const
66  { return myNode; }
67 
69  { myModVersion++; }
70  bool isModVersionOutdated() const
71  { return myModVersion != myLastModVersion; }
73  { return myModVersion; }
75  { return myLastModVersion; }
76 
78  { return myLastUpdateTime; }
79 
81  { return isSameTime(t, myLastUpdateTime); }
82 
83  virtual void becameDirty(DEP_MicroNode &src, const DEP_PropagateData &data);
84 private:
85  OP_Node & myNode;
86  OP_VERSION myModVersion; // Bumped everytime the
87  // node gets dirty.
88  OP_VERSION myLastModVersion; // Current version of
89  // the entire cache
90  fpreal myLastUpdateTime;
91 };
92 
93 #endif // __OP_DATAMICRONODE_H_INCLUDED__
virtual void getInputs(DEP_MicroNodeList &inputs) const
virtual void becameDirty(DEP_MicroNode &src, const DEP_PropagateData &propdata)
uint64 OP_VERSION
Definition: OP_Version.h:6
static SYS_FORCE_INLINE bool isSameTime(fpreal a, fpreal b)
virtual void update(fpreal t)
Definition: DEP_MicroNode.h:89
virtual int64 getMemoryUsage(bool inclusive) const
Obtain approximate memory usage.
virtual bool requiresUpdate(fpreal t) const
Definition: DEP_MicroNode.h:96
virtual bool isExporting() const
virtual void clearInputs()
Definition: DEP_MicroNode.h:76
long long int64
Definition: SYS_Types.h:100
OP_VERSION lastModVersion() const
virtual bool isEvaluating() const
OP_Node & ownerNode() const
virtual const char * className() const
bool isEqualToLastUpdateTime(fpreal t) const
GLboolean * data
Definition: glcorearb.h:130
double fpreal
Definition: SYS_Types.h:263
virtual void evaluateExports()
OP_VERSION modVersion() const
#define OP_API
Definition: OP_API.h:10
virtual void dump(std::ostream &os, const char *prefix=0, int indent_level=0) const
Dump contents to output stream, strictly for debugging purposes.
Propagation info for a dep micro node.
Definition: DEP_MicroNode.h:39
virtual void getOutputs(DEP_MicroNodeList &outputs) const
bool isModVersionOutdated() const
fpreal lastUpdateTime() const
GLenum src
Definition: glcorearb.h:1792