HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_OpCaller.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: UT_OpCaller.h ( UT Library, C++)
7  *
8  */
9 
10 #ifndef __UT_OpCaller__
11 #define __UT_OpCaller__
12 
13 #include "UT_API.h"
14 class UT_OpCallee;
15 
16 /// General documentation for the UT_OpCaller class.
17 ///
18 /// In some cases during the cook of an OP Node, calls will be made into low
19 /// level libraries. These libraries may have callback mechanisms to reference
20 /// data from other existing OPs, but without any dependencies on OPs
21 /// themselves. For example, in resolving the "op:some-op-path" paths, the
22 /// low level libraries don't actually know about OPs, but rely on callbacks
23 /// to perform the evaluation.
24 ///
25 /// However, the caller OP (the OP cooking) isn't notified of these additional
26 /// dependencies and so doesn't end up cooking properly. This pair of classes
27 /// provides a mechanism for implementing the appropriate dependencies.
28 /// Prior to cooking, the OP can create a UT_Caller class which acts as a sink
29 /// for all the OP references which get made. At the conclusion of the cook,
30 /// the OP can then call back to all the classes which made the references
31 /// (the OP_Callee classes) and notify them that the data they built is no
32 /// longer required.
33 ///
34 /// This class is primarily used by VEX at the current time.
35 
37 public:
38  /// This class provides a virtual interface to OP_Nodes so that
39  /// they can query the op-node which is being evaluated.
40  UT_OpCaller();
41  virtual ~UT_OpCaller();
42 
43  /// Callee's might want to find out the unique id of the caller. The /
44  //getOpId() method should provide the correct id for the cooking OP
45  virtual int getOpId() = 0;
46 
47  /// The referenceOtherOp() method is called when a callee magically
48  /// references another operator. This might happen when referencing a
49  /// file using the "op:soppath" syntax.
50  /// At the conclusion of cooking, this cache should be notified that the
51  /// OP is done with the data.
52  virtual void referenceOtherOp(int opid, UT_OpCallee *cache,
53  bool flaginterest) = 0;
54 
55  /// Reference a specific parameter
56  virtual void referenceOtherParameter(int opid, int pi, int vi) = 0;
57 };
58 
60 public:
61  /// The UT_OpCallee class is used as a general mechanism to get callbacks
62  /// when a reference to an OP is no longer needed.
63  UT_OpCallee();
64  virtual ~UT_OpCallee();
65 
66  /// This method should be called by the UT_OpCaller when the data is no
67  /// longer required.
68  virtual void doneWithOp(int opid) = 0;
69 };
70 
71 #endif
72 
#define UT_API
Definition: UT_API.h:13