HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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"
16 #include <SYS/SYS_Math.h>
17 #include <SYS/SYS_Types.h>
18 
19 class OP_Node;
20 
22 {
23 public:
25 
26  const char * className() const override
27  { return "OP_DataMicroNode"; }
28 
29  void getParmInputs(DEP_MicroNodeList &inputs) const;
30  void getUsedDataInputs(DEP_MicroNodeList &inputs) const;
31 
32  bool inheritTimeDependentFromUsedDataInputs();
33  bool inheritTimeInterestedFromUsedDataInputs();
34 
35  void getInputs(DEP_MicroNodeList &inputs) const override;
36  void clearInputs() override;
37  void getOutputs(
38  DEP_MicroNodeList &outputs) const override;
39 
40  /// Like getInputs() but excludes wired OP_Node inputs
41  void getExtraInputs(DEP_MicroNodeList &inputs) const;
42 
43  /// Like getOutputs() but excludes wired OP_Node outputs. For parmlist
44  /// micronodes, this will exclude the its owner OP_Node.
45  void getExtraOutputs(DEP_MicroNodeList &outputs) const;
46 
47  /// update() is used by users of micro-nodes to mark this node as clean at
48  /// the given time t.
49  void update(fpreal t) override;
50 
51  /// requiresUpdate() specifies if the micro-node was dirtied, possibly
52  /// based on the time t.
53  bool requiresUpdate(fpreal t) const override;
54 
55  /// Used to determine if a micronode is currently evaluating. If this
56  /// returns true, during dirty propagation, it will prevent dependencies
57  /// from being removed from it.
58  bool isEvaluating() const override;
59 
60  /// evaluateExports() is called after isExporting() is noted to be true
61  /// during a dirty propagation pass initiated by dirtySubtree().
62  void evaluateExports() override;
63 
64  /// Used to determine if a micronode requires its exports to be evaluated
65  /// during the propagation pass.
66  bool isExporting() const override;
67 
68  int64 getMemoryUsage(bool inclusive) const override;
69 
70  void dump(
71  std::ostream &os,
72  const char *prefix = 0,
73  int indent_level = 0) const override;
74 
75  OP_Node & ownerNode() const
76  { return myNode; }
77 
79  { myModVersion++; }
80  bool isModVersionOutdated() const
81  { return myModVersion != myLastModVersion; }
83  { return myModVersion; }
85  { return myLastModVersion; }
86 
88  const DEP_PropagateData &data) override;
89 
91  { myModVersion = v; }
92 
93 private:
94  using BaseClass = OP_ContextOptionsMicroNode;
95 
96  OP_Node &myNode;
97  // Bumped everytime the node gets dirty.
98  OP_VERSION myModVersion;
99  // Current version of the entire cache
100  OP_VERSION myLastModVersion;
101 };
102 
103 #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
virtual int64 getMemoryUsage(bool inclusive) const
Obtain approximate memory usage.
const GLdouble * v
Definition: glcorearb.h:837
virtual bool isExporting() const
bool requiresUpdate(fpreal t) const override
virtual void clearInputs()
void setModVersion(OP_VERSION v)
OP_VERSION lastModVersion() const
const char * className() const override
virtual bool isEvaluating() const
OP_Node & ownerNode() const
long long int64
Definition: SYS_Types.h:116
GLdouble t
Definition: glad.h:2397
virtual void evaluateExports()
OP_VERSION modVersion() const
fpreal64 fpreal
Definition: SYS_Types.h:277
#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.
void update(fpreal t) override
Propagation info for a dep micro node.
Definition: DEP_MicroNode.h:36
virtual void getOutputs(DEP_MicroNodeList &outputs) const
bool isModVersionOutdated() const
Definition: format.h:895
GLenum src
Definition: glcorearb.h:1793