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 &outputs) const;
36 
37  /// Like getInputs() but excludes wired OP_Node inputs
38  void getExtraInputs(DEP_MicroNodeList &inputs) const;
39 
40  /// Like getOutputs() but excludes wired OP_Node outputs. For parmlist
41  /// micronodes, this will exclude the its owner OP_Node.
42  void getExtraOutputs(DEP_MicroNodeList &outputs) const;
43 
44  /// update() is used by users of micro-nodes to mark this node as clean at
45  /// the given time t.
46  virtual void update(fpreal t);
47 
48  /// requiresUpdate() specifies if the micro-node was dirtied, possibly
49  /// based on the time t.
50  virtual bool requiresUpdate(fpreal t) const;
51 
52  /// Used to determine if a micronode is currently evaluating. If this
53  /// returns true, during dirty propagation, it will prevent dependencies
54  /// from being removed from it.
55  virtual bool isEvaluating() const;
56 
57  /// evaluateExports() is called after isExporting() is noted to be true
58  /// during a dirty propagation pass initiated by dirtySubtree().
59  virtual void evaluateExports();
60 
61  /// Used to determine if a micronode requires its exports to be evaluated
62  /// during the propagation pass.
63  virtual bool isExporting() const;
64 
65  virtual int64 getMemoryUsage(bool inclusive) const;
66 
67  virtual void dump(
68  std::ostream &os,
69  const char *prefix = 0,
70  int indent_level = 0) const;
71 
72  OP_Node & ownerNode() const
73  { return myNode; }
74 
76  { myModVersion++; }
77  bool isModVersionOutdated() const
78  { return myModVersion != myLastModVersion; }
80  { return myModVersion; }
82  { return myLastModVersion; }
83 
85  { return myLastUpdateTime; }
86 
88  { return isSameTime(t, myLastUpdateTime); }
89 
90  virtual void becameDirty(DEP_MicroNode &src, const DEP_PropagateData &data);
91 private:
92  OP_Node & myNode;
93  OP_VERSION myModVersion; // Bumped everytime the
94  // node gets dirty.
95  OP_VERSION myLastModVersion; // Current version of
96  // the entire cache
97  fpreal myLastUpdateTime;
98 };
99 
100 #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:106
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:269
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