HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OP_Caller.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_Caller.h ( OP Library, C++)
7  *
8  * COMMENTS: Sub-class of the UT_OpCaller which is used to handle op
9  * references.
10  */
11 
12 #ifndef __OP_Caller__
13 #define __OP_Caller__
14 
15 #include "OP_API.h"
16 #include <UT/UT_OpCaller.h>
17 #include <UT/UT_ConcurrentVector.h>
18 
19 class OP_Node;
20 class DEP_MicroNode;
21 
23 {
24 public:
25  OP_Caller(OP_Node *node);
26  OP_Caller(OP_Node *node, DEP_MicroNode *micronode);
27  virtual ~OP_Caller();
28 
29  /// @{
30  /// Get the calling node (i.e. the node being cooked)
31  virtual int getOpId();
32  OP_Node *getNode() { return myNode; }
33  /// @}
34 
35  /// Tell the calling node that they refer to the data for the other op
36  /// If the @c callee is not NULL, it's doneWithOp() method will be called
37  /// after the caller is finished with the node.
38  virtual void referenceOtherOp(int opid, UT_OpCallee *cache, bool flaginterest);
39 
40  /// Reference a specific parameter
41  virtual void referenceOtherParameter(int opid, int pi, int vi);
42 
43  /// Clear all references (notifying callee's about completion
44  void clearReferences();
45 
46  /// Add operator dependencies -- the user should ensure that this is called
47  /// in a thread-safe fashion.
48  /// @note This is called automatically from the destructor.
49  void addDependencies();
50 
51  /// Flag the caller to ignore time dependencies in addDependencies.
52  /// Used when cooking a channel time range in VEXCHOP
53  bool ignoreTimeDep() const;
54  void setIgnoreTimeDep();
55 
56 protected:
57 
59  {
60  public:
61  NodeInterest(int id, UT_OpCallee *cache, bool flag = false)
62  : myOpId(id)
63  , myCallee(cache)
64  , myFlagInterest(flag)
65  {
66  }
68  : myOpId(src.myOpId)
69  , myCallee(src.myCallee)
70  , myFlagInterest(src.myFlagInterest)
71  {
72  }
74  {
75  myOpId = src.myOpId;
76  myCallee = src.myCallee;
77  myFlagInterest = src.myFlagInterest;
78  return *this;
79  }
80  bool operator==(const NodeInterest &src) const
81  {
82  return myOpId == src.myOpId &&
83  myCallee == src.myCallee &&
84  myFlagInterest == src.myFlagInterest;
85  }
86 
87  int getOpId() const { return myOpId; }
88  UT_OpCallee *getCallee() const { return myCallee; }
89  bool getFlagInterest() const{ return myFlagInterest; }
90 
91  private:
92  int myOpId;
93  bool myFlagInterest;
94  UT_OpCallee *myCallee;
95  };
96 
97  typedef UT_ConcurrentVector<NodeInterest> ListType;
98 
103 };
104 
105 #endif
NodeInterest(int id, UT_OpCallee *cache, bool flag=false)
Definition: OP_Caller.h:61
bool getFlagInterest() const
Definition: OP_Caller.h:89
UT_OpCallee * getCallee() const
Definition: OP_Caller.h:88
NodeInterest(const NodeInterest &src)
Definition: OP_Caller.h:67
int getOpId() const
Definition: OP_Caller.h:87
virtual void referenceOtherOp(int opid, UT_OpCallee *cache, bool flaginterest)=0
UT_ConcurrentVector< NodeInterest > ListType
Definition: OP_Caller.h:97
NodeInterest & operator=(const NodeInterest &src)
Definition: OP_Caller.h:73
bool myIgnoreTimeDep
Definition: OP_Caller.h:102
OP_Node * myNode
Definition: OP_Caller.h:100
virtual int getOpId()=0
Callee's might want to find out the unique id of the caller. The /.
virtual void referenceOtherParameter(int opid, int pi, int vi)=0
Reference a specific parameter.
bool operator==(const NodeInterest &src) const
Definition: OP_Caller.h:80
#define OP_API
Definition: OP_API.h:10
png_infop png_uint_32 flag
Definition: png.h:2242
DEP_MicroNode * myMicroNode
Definition: OP_Caller.h:101
ListType myInterests
Definition: OP_Caller.h:99
OP_Node * getNode()
Definition: OP_Caller.h:32
GLenum src
Definition: glcorearb.h:1792