HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PRM_ParmMicroNode.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: PRM_ParmMicroNode.h (PRM Library, C++)
7  *
8  * COMMENTS: DEP_MicroNode subclass representing a PRM_Parm component
9  */
10 
11 #ifndef __PRM_PARMMICRONODE_H_INCLUDED__
12 #define __PRM_PARMMICRONODE_H_INCLUDED__
13 
14 #include "PRM_API.h"
15 #include <DEP/DEP_MicroNode.h>
16 #include <UT/UT_ValArray.h>
17 #include <SYS/SYS_Types.h>
18 #include <stddef.h>
19 
20 class PRM_Parm;
22 
23 
25 
26 class PRM_ParmMicroNode;
27 
28 // PRM_ConstMicroNode is a simple micro node that is implicitly
29 // connected to a PRM_ParmMicroNode.
30 // It doesn't inherrit the time dependency from myParent because
31 // it's an implicit dependency.
33 {
34 public:
36  : myParent(p)
37  {}
38 
39  const char * className() const override
40  { return "PRM_ConstMicroNode"; }
41 
42  // Set the parent and adjust its myConstMicroNode to this.
43  void init(PRM_ParmMicroNode* p);
44 
45  // Overloaded to return myParent.
46  void getInputs(DEP_MicroNodeList &inputs) const override;
47 
48  int64 getMemoryUsage(bool inclusive) const override;
49 private:
50  PRM_ParmMicroNode* myParent;
51 };
52 
54 {
55 public:
57  : myParm(NULL)
58  , mySubIndex(-1)
59  , myConstMicroNode(nullptr)
60  {
61  }
62 
63  PRM_ParmMicroNode(PRM_Parm &parm, int sub_index)
64  : myConstMicroNode(nullptr)
65  {
66  init(parm, sub_index);
67  }
68 
69  void init(PRM_Parm &parm, int sub_index);
70 
71  void clearInputs() override;
72 
73  const char * className() const override
74  { return "PRM_ParmMicroNode"; }
75 
76  int64 getMemoryUsage(bool inclusive) const override;
77 
78  void dump(
79  std::ostream &os,
80  const char *prefix = 0,
81  int indent_level = 0) const override;
82 
83  const PRM_Parm & ownerParm() const
84  { return *myParm; }
86  { return *myParm; }
87 
88  int parmIndex() const;
89  int subIndex() const
90  { return mySubIndex; }
91 
92  // Overloaded to return myConstMicroNode implicitly.
93  void getOutputs(DEP_MicroNodeList &outputs) const override;
94 
95 private:
96  friend class PRM_ConstMicroNode;
97 
98  PRM_Parm * myParm;
99  int mySubIndex;
100 
101  // Optional const micronode not owned but this.
102  // PRM_Instance creates the micronodes and updates this.
103  PRM_ConstMicroNode *myConstMicroNode;
104 };
105 
106 
107 #endif // __PRM_PARMMICRONODE_H_INCLUDED__
virtual void getInputs(DEP_MicroNodeList &inputs) const
virtual int64 getMemoryUsage(bool inclusive) const
Obtain approximate memory usage.
PRM_ParmMicroNode(PRM_Parm &parm, int sub_index)
const char * className() const override
virtual void clearInputs()
PRM_ConstMicroNode(PRM_ParmMicroNode *p=nullptr)
long long int64
Definition: SYS_Types.h:116
GLfloat GLfloat p
Definition: glew.h:16656
PRM_Parm & ownerParm()
int subIndex() const
UT_ValArray< PRM_ParmMicroNode * > PRM_ParmMicroNodeList
const PRM_Parm & ownerParm() const
virtual void dump(std::ostream &os, const char *prefix=0, int indent_level=0) const
Dump contents to output stream, strictly for debugging purposes.
virtual void getOutputs(DEP_MicroNodeList &outputs) const
#define PRM_API
Definition: PRM_API.h:10
const char * className() const override