00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __OP_INTERESTREF_H_INCLUDED__
00020 #define __OP_INTERESTREF_H_INCLUDED__
00021
00022 #include "OP_API.h"
00023 #include "OP_DataTypes.h"
00024
00025 class OP_Node;
00026
00027 class OP_API OP_InterestRef
00028 {
00029 public:
00030 struct EvalChannelTag {};
00031 static EvalChannelTag EvalChannel;
00032
00033 OP_InterestRef()
00034 : myNode(0)
00035 , myParmIndex(-1)
00036 , myParmSubIndex(-1)
00037 , myInterestType(OP_INTEREST_DATA)
00038 {
00039 }
00040
00041 explicit OP_InterestRef(
00042 OP_Node &node,
00043 OP_InterestType type = OP_INTEREST_DATA)
00044 : myNode(&node)
00045 , myParmIndex(-1)
00046 , myParmSubIndex(-1)
00047 , myInterestType(type)
00048 {
00049 }
00050
00051
00052 explicit OP_InterestRef(
00053 OP_Node &node,
00054 int parm_index,
00055 int parm_sub_index)
00056 : myNode(&node)
00057 , myParmIndex(parm_index)
00058 , myParmSubIndex(parm_sub_index)
00059 , myInterestType(OP_INTEREST_DATA)
00060 {
00061 }
00062
00063 OP_InterestRef(EvalChannelTag, int thread);
00064
00065 OP_Node * node() const { return myNode; }
00066 void setNode(OP_Node *node) { myNode = node; }
00067 int parmIndex() const { return myParmIndex; }
00068 void setParmIndex(int pi) { myParmIndex = pi; }
00069 int parmSubIndex() const { return myParmSubIndex; }
00070 void setParmSubIndex(int vi) { myParmSubIndex = vi; }
00071 OP_InterestType interestType() const { return myInterestType; }
00072 void setInterestType(OP_InterestType t)
00073 { myInterestType = t; }
00074
00075 bool isValid() const { return (myNode != 0); }
00076
00077 enum Type
00078 {
00079 TYPE_NONE,
00080 TYPE_NODE,
00081 TYPE_PARM,
00082 TYPE_CHANNEL
00083 };
00084
00085 Type type() const
00086 {
00087 if (myNode)
00088 {
00089 if (myParmIndex >= 0)
00090 {
00091 return (myParmSubIndex >= 0) ?
00092 TYPE_CHANNEL : TYPE_PARM;
00093 }
00094 return TYPE_NODE;
00095 }
00096 return TYPE_NONE;
00097 }
00098
00099 private:
00100 OP_Node * myNode;
00101 int myParmIndex;
00102 int myParmSubIndex;
00103 OP_InterestType myInterestType;
00104 };
00105
00106 #endif // __OP_INTERESTREF_H_INCLUDED__