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