HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_InterestRef.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_InterestRef.h (OP Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __OP_INTERESTREF_H_INCLUDED__
12 #define __OP_INTERESTREF_H_INCLUDED__
13 
14 #include "OP_API.h"
15 #include "OP_DataTypes.h"
16 
17 class OP_Node;
18 
20 {
21 public:
22  struct EvalChannelTag {};
24 
26  : myNode(0)
27  , myParmIndex(-1)
28  , myParmSubIndex(-1)
29  , myInterestType(OP_INTEREST_DATA)
30  {
31  }
32 
33  explicit OP_InterestRef(
34  OP_Node &node,
36  : myNode(&node)
37  , myParmIndex(-1)
38  , myParmSubIndex(-1)
39  , myInterestType(type)
40  {
41  }
42 
43  // parm_sub_index may be -1 to indicate TYPE_PARM
44  explicit OP_InterestRef(
45  OP_Node &node,
46  int parm_index,
47  int parm_sub_index)
48  : myNode(&node)
49  , myParmIndex(parm_index)
50  , myParmSubIndex(parm_sub_index)
51  , myInterestType(OP_INTEREST_DATA)
52  {
53  }
54 
55  OP_InterestRef(EvalChannelTag, int thread);
56 
57  OP_Node * node() const { return myNode; }
58  void setNode(OP_Node *node) { myNode = node; }
59  int parmIndex() const { return myParmIndex; }
60  void setParmIndex(int pi) { myParmIndex = pi; }
61  int parmSubIndex() const { return myParmSubIndex; }
62  void setParmSubIndex(int vi) { myParmSubIndex = vi; }
63  OP_InterestType interestType() const { return myInterestType; }
65  { myInterestType = t; }
66 
67  bool isValid() const { return (myNode != 0); }
68 
69  enum Type
70  {
74  TYPE_CHANNEL
75  };
76 
77  Type type() const
78  {
79  if (myNode)
80  {
81  if (myParmIndex >= 0)
82  {
83  return (myParmSubIndex >= 0) ?
84  TYPE_CHANNEL : TYPE_PARM;
85  }
86  return TYPE_NODE;
87  }
88  return TYPE_NONE;
89  }
90 
91 private:
92  OP_Node * myNode;
93  int myParmIndex;
94  int myParmSubIndex;
95  OP_InterestType myInterestType;
96 };
97 
98 #endif // __OP_INTERESTREF_H_INCLUDED__
OP_InterestRef(OP_Node &node, OP_InterestType type=OP_INTEREST_DATA)
int parmSubIndex() const
void setParmIndex(int pi)
void setParmSubIndex(int vi)
void setNode(OP_Node *node)
Type type() const
OP_InterestRef(OP_Node &node, int parm_index, int parm_sub_index)
OP_InterestType
Definition: OP_DataTypes.h:45
void setInterestType(OP_InterestType t)
OP_Node * node() const
int parmIndex() const
OP_InterestType interestType() const
static EvalChannelTag EvalChannel
#define OP_API
Definition: OP_API.h:10
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
bool isValid() const